bluesky / event-model

data model for event-based data collection and analysis
https://blueskyproject.io/event-model
BSD 3-Clause "New" or "Revised" License
13 stars 30 forks source link

Use importlib.metadata to determine jsonschema version #227

Closed callumforrester closed 1 year ago

callumforrester commented 1 year ago

Use importlib.metadata to determine jsonschema version. event-model contains some conditional logic depending on the version.

Description

Pure refactor: no change in behaviour, this just uses a more up-to-date method of determining the version.

Motivation and Context

The current method is deprecated and produces the following warning:

DeprecationWarning: Accessing jsonschema.__version__ is deprecated and will be removed in a future release. Use importlib.metadata directly to query for jsonschema's version.

How Has This Been Tested?

The docs build passes in CI, which validates the case for jsonschema>=3.0.0. I have tested locally with 2.6.0 for the other case.