Skip to content

Commit f67067a

Browse files
committed
Respect the installed version of the extension.
1 parent 3a3498e commit f67067a

File tree

1 file changed

+3
-9
lines changed

1 file changed

+3
-9
lines changed

sphinx_json_schema_spec/__init__.py

+3-9
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,6 @@
99
from lxml import html
1010
import certifi
1111

12-
__version__ = "2.0.0"
13-
1412
BASE_URL = "https://json-schema.org/draft/2020-12/"
1513
VOCABULARIES = {
1614
"core": urljoin(BASE_URL, "json-schema-core.html"),
@@ -45,7 +43,7 @@ def setup(app):
4543
}
4644
app.add_role("kw", docutils_does_not_allow_using_classes(documents))
4745

48-
return dict(version=__version__, parallel_read_safe=True)
46+
return dict(parallel_read_safe=True)
4947

5048

5149
def fetch_or_load(vocabulary_path, url):
@@ -63,12 +61,8 @@ def fetch_or_load(vocabulary_path, url):
6361
the URL of the vocabulary document
6462
"""
6563

66-
headers = {
67-
"User-Agent": "python-jsonschema v{} - documentation build v{}".format(
68-
metadata.version("jsonschema"),
69-
__version__,
70-
),
71-
}
64+
version = metadata.version("sphinx-json-schema-spec")
65+
headers = {"User-Agent": f"sphinx-json-schema-spec v{version}"}
7266

7367
with suppress(FileNotFoundError):
7468
modified = datetime.utcfromtimestamp(vocabulary_path.stat().st_mtime)

0 commit comments

Comments
 (0)