Skip to content

Commit 90b4cc4

Browse files
committed
Bump for the newer referencing API.
1 parent bcbe09f commit 90b4cc4

File tree

4 files changed

+23
-28
lines changed

4 files changed

+23
-28
lines changed

docs/requirements.txt

Lines changed: 17 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,20 @@
11
#
2-
# This file is autogenerated by pip-compile with python 3.11
3-
# To update, run:
2+
# This file is autogenerated by pip-compile with Python 3.11
3+
# by the following command:
44
#
55
# pip-compile docs/requirements.in
66
#
7-
alabaster==0.7.12
7+
alabaster==0.7.13
88
# via sphinx
99
attrs==22.2.0
1010
# via referencing
1111
babel==2.11.0
1212
# via sphinx
13-
beautifulsoup4==4.11.1
13+
beautifulsoup4==4.11.2
1414
# via furo
1515
certifi==2022.12.7
1616
# via requests
17-
charset-normalizer==2.1.1
17+
charset-normalizer==3.0.1
1818
# via requests
1919
docutils==0.19
2020
# via sphinx
@@ -30,34 +30,34 @@ jinja2==3.1.2
3030
# via sphinx
3131
file:.#egg=jsonschema_specifications
3232
# via -r docs/requirements.in
33-
markupsafe==2.1.1
33+
markupsafe==2.1.2
3434
# via jinja2
3535
multidict==6.0.4
3636
# via yarl
37-
packaging==22.0
37+
packaging==23.0
3838
# via sphinx
3939
pyenchant==3.2.2
4040
# via sphinxcontrib-spelling
41-
pygments==2.13.0
41+
pygments==2.14.0
4242
# via
4343
# furo
4444
# pygments-github-lexers
4545
# sphinx
4646
pygments-github-lexers==0.0.5
4747
# via -r docs/requirements.in
48-
pyrsistent==0.19.2
48+
pyrsistent==0.19.3
4949
# via referencing
50-
pytz==2022.7
50+
pytz==2022.7.1
5151
# via babel
52-
referencing==0.8.10
52+
referencing==0.9.2
5353
# via jsonschema-specifications
54-
requests==2.28.1
54+
requests==2.28.2
5555
# via sphinx
5656
snowballstemmer==2.2.0
5757
# via sphinx
5858
soupsieve==2.3.2.post1
5959
# via beautifulsoup4
60-
sphinx==5.3.0
60+
sphinx==6.1.3
6161
# via
6262
# -r docs/requirements.in
6363
# furo
@@ -69,11 +69,11 @@ sphinx-basic-ng==1.0.0b1
6969
# via furo
7070
sphinx-copybutton==0.5.1
7171
# via -r docs/requirements.in
72-
sphinxcontrib-applehelp==1.0.2
72+
sphinxcontrib-applehelp==1.0.4
7373
# via sphinx
7474
sphinxcontrib-devhelp==1.0.2
7575
# via sphinx
76-
sphinxcontrib-htmlhelp==2.0.0
76+
sphinxcontrib-htmlhelp==2.0.1
7777
# via sphinx
7878
sphinxcontrib-jsmath==1.0.1
7979
# via sphinx
@@ -83,9 +83,9 @@ sphinxcontrib-serializinghtml==1.1.5
8383
# via sphinx
8484
sphinxcontrib-spelling==7.7.0
8585
# via -r docs/requirements.in
86-
sphinxext-opengraph==0.7.4
86+
sphinxext-opengraph==0.7.5
8787
# via -r docs/requirements.in
88-
urllib3==1.26.13
88+
urllib3==1.26.14
8989
# via requests
9090
yarl==1.8.2
9191
# via referencing

jsonschema_specifications/_core.py

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
except ImportError:
1010
from importlib_resources import files # type: ignore
1111

12-
from referencing import IdentifiedResource, Registry
12+
from referencing import Registry, Resource
1313

1414

1515
def _schemas():
@@ -30,10 +30,8 @@ def _schemas():
3030
children = [child] if child.is_file() else child.iterdir()
3131
for path in children:
3232
contents = json.loads(path.read_text())
33-
resource = IdentifiedResource.from_resource(contents)
33+
resource = Resource.from_contents(contents)
3434
yield resource.id(), resource
3535

3636

37-
REGISTRY = Registry().with_identified_resources(_schemas())
38-
# FIXME: as soon as _crawl has a public replacement
39-
REGISTRY = REGISTRY._crawl()
37+
REGISTRY: Registry = Registry().with_resources(_schemas()).crawl()
Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,7 @@
1-
import jsonschema_specifications
1+
from jsonschema_specifications import REGISTRY
22

33

44
def test_it_contains_metaschemas():
5-
resource, _, _ = jsonschema_specifications.REGISTRY.resource_at(
6-
"http://json-schema.org/draft-07/schema#",
7-
)
8-
schema = resource.resource
5+
schema = REGISTRY.contents("http://json-schema.org/draft-07/schema#")
96
assert schema["$id"] == "http://json-schema.org/draft-07/schema#"
107
assert schema["title"] == "Core schema meta-schema"

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ classifiers = [
3232
dynamic = ["version"]
3333

3434
dependencies = [
35-
"referencing>=0.8.10",
35+
"referencing>=0.9.2",
3636
"importlib_resources>=1.4.0;python_version<'3.9'",
3737
]
3838

0 commit comments

Comments
 (0)