Skip to content

Commit 25e4517

Browse files
committed
Deprecate jsonschema.__version__.
importlib.metadata is in the standard library now, so there's not much purpose in pre-calculating this attribute.
1 parent d159f90 commit 25e4517

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

sphinx_json_schema_spec/__init__.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
from datetime import datetime
2+
from importlib import metadata
23
from urllib.parse import urljoin
34
import errno
45
import os
@@ -8,8 +9,6 @@
89
from lxml import html
910
import certifi
1011

11-
import jsonschema
12-
1312
__version__ = "1.2.0"
1413

1514
BASE_URL = "https://json-schema.org/draft-07/"
@@ -57,7 +56,8 @@ def fetch_or_load(spec_path):
5756

5857
headers = {
5958
"User-Agent": "python-jsonschema v{} - documentation build v{}".format(
60-
jsonschema.__version__, __version__,
59+
metadata.version("jsonschema"),
60+
__version__,
6161
),
6262
}
6363

0 commit comments

Comments
 (0)