summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJulian Berman <Julian@GrayVines.com>2023-03-20 13:01:45 -0400
committerJulian Berman <Julian@GrayVines.com>2023-03-20 13:01:45 -0400
commit529b57aefb4810866c3de0750349fb227fac816e (patch)
tree090beb89818d6751f5df2abb979afc9706031573
parentabc4fcf5e49d3a4003c3b3cad5c425cfb53b72af (diff)
downloadjsonschema-529b57aefb4810866c3de0750349fb227fac816e.tar.gz
Bump the minimum jsonschema-specifications/rpds versions to avoid #1059v4.18.0a2
This should re-enable validating from a thread other than the one that originall imported jsonschema.
-rw-r--r--docs/requirements.txt10
-rw-r--r--jsonschema/tests/test_validators.py31
-rw-r--r--pyproject.toml9
3 files changed, 39 insertions, 11 deletions
diff --git a/docs/requirements.txt b/docs/requirements.txt
index 0db48a3..17e8c28 100644
--- a/docs/requirements.txt
+++ b/docs/requirements.txt
@@ -14,7 +14,7 @@ attrs==22.2.0
# referencing
babel==2.12.1
# via sphinx
-beautifulsoup4==4.11.2
+beautifulsoup4==4.12.0
# via furo
certifi==2022.12.7
# via requests
@@ -26,7 +26,7 @@ cycler==0.11.0
# via matplotlib
docutils==0.19
# via sphinx
-fonttools==4.39.0
+fonttools==4.39.2
# via matplotlib
furo==2022.12.7
# via -r docs/requirements.in
@@ -40,7 +40,7 @@ jinja2==3.1.2
# sphinx-autoapi
file:.#egg=jsonschema
# via -r docs/requirements.in
-jsonschema-specifications==2023.3.4
+jsonschema-specifications==2023.3.5
# via jsonschema
kiwisolver==1.4.4
# via matplotlib
@@ -76,13 +76,13 @@ python-dateutil==2.8.2
# via matplotlib
pyyaml==6.0
# via sphinx-autoapi
-referencing==0.24.4
+referencing==0.25.0
# via
# jsonschema
# jsonschema-specifications
requests==2.28.2
# via sphinx
-rpds-py==0.6.1
+rpds-py==0.7.0
# via
# jsonschema
# referencing
diff --git a/jsonschema/tests/test_validators.py b/jsonschema/tests/test_validators.py
index 8afdbe4..a9b7f6a 100644
--- a/jsonschema/tests/test_validators.py
+++ b/jsonschema/tests/test_validators.py
@@ -2115,6 +2115,37 @@ class TestValidate(TestCase):
self.assertIn("12 is less than the minimum of 20", str(e.exception))
+class TestThreading(TestCase):
+ """
+ Threading-related functionality tests.
+
+ jsonschema doesn't promise thread safety, and its validation behavior
+ across multiple threads may change at any time, but that means it isn't
+ safe to share *validators* across threads, not that anytime one has
+ multiple threads that jsonschema won't work (it certainly is intended to).
+
+ These tests ensure that this minimal level of functionality continues to
+ work.
+ """
+
+ def test_validation_across_a_second_thread(self):
+ failed = []
+
+ def validate():
+ try:
+ validators.validate(instance=37, schema=True)
+ except: # noqa: E722, pragma: no cover
+ failed.append(sys.exc_info())
+
+ validate() # just verify it succeeds
+
+ from threading import Thread
+ thread = Thread(target=validate)
+ thread.start()
+ thread.join()
+ self.assertEqual((thread.is_alive(), failed), (False, []))
+
+
class TestRefResolver(TestCase):
base_uri = ""
diff --git a/pyproject.toml b/pyproject.toml
index 784ada3..d9e4097 100644
--- a/pyproject.toml
+++ b/pyproject.toml
@@ -32,12 +32,9 @@ dynamic = ["version", "readme"]
dependencies = [
"attrs>=22.2.0",
- "jsonschema-specifications>=2023.03.4",
- "referencing>=0.24.4",
- "rpds-py>=0.6.1",
-
- "importlib_metadata;python_version<'3.8'",
- "typing_extensions;python_version<'3.8'",
+ "jsonschema-specifications>=2023.03.5",
+ "referencing>=0.25.0",
+ "rpds-py>=0.7.0",
"importlib_resources>=1.4.0;python_version<'3.9'",
"pkgutil_resolve_name>=1.3.10;python_version<'3.9'",