Comments (7)
Looks like the underlying issue was with the poetry cache (at least for me). This worked and allowed me to use 4.22.0:
poetry cache list
poetry cache clear <cache> --all
from jsonschema.
I don't use poetry but it certainly should work, I have no issues here. Why are you specifying attrs
in your command?
Specifically this works fine here:
⊙ poetry new foo && cd foo && poetry add [email protected] && poetry run python -c 'import jsonschema; print(jsonschema)' julian@Airm
Created package foo in foo
Creating virtualenv foo-6IPkgmQ4-py3.12 in /Users/julian/Library/Caches/pypoetry/virtualenvs
Updating dependencies
Resolving dependencies... (0.6s)
Package operations: 5 installs, 0 updates, 0 removals
- Installing attrs (23.2.0)
- Installing rpds-py (0.18.1)
- Installing referencing (0.35.1)
- Installing jsonschema-specifications (2023.12.1)
- Installing jsonschema (4.22.0)
Writing lock file
<module 'jsonschema' from '/Users/julian/Library/Caches/pypoetry/virtualenvs/foo-6IPkgmQ4-py3.12/lib/python3.12/site-packages/jsonschema/__init__.py'>
The same of course works with attrs
, but there's no reason to be specifying that. Closing but feel free to provide something which reproduces.
from jsonschema.
Hi,
I can confirm that I've experienced this as well.
I'm using poetry 1.8.2, python 3.12 and updating dependencies:
poetry add jsonschema
This installs the library in version 4.22.0. Then in my python script I call
import jsonschema
def my_function()
try:
jsonschema.validate(value, schema)
except (jsonschema.exceptions.ValidationError, jsonschema.exceptions.SchemaError) as ex:
pass
And get the same Traceback as @miguel-mi-silva .
Pinning jsonschema
to <4.22.0
resolves the issue.
from jsonschema.
Please provide something which reproduces.
from jsonschema.
we also have the same problem, poetry 1.7.1 and python 3.10.
Upping the version in pyproject.toml
from 4.21.1 to 4.22.0 creates the following diff in poetry.lock after poetry lock --no-update
: (also tried just poetry lock with similar results)
[[package]]
name = "jsonschema"
-version = "4.21.1"
-description = "An implementation of JSON Schema validation for Python"
-optional = false
-python-versions = ">=3.8"
-files = [
- {file = "jsonschema-4.21.1-py3-none-any.whl", hash = "sha256:7996507afae316306f9e2290407761157c6f78002dcf7419acb99822143d1c6f"},
- {file = "jsonschema-4.21.1.tar.gz", hash = "sha256:85727c00279f5fa6bedbe6238d2aa6403bedd8b4864ab11207d07df3cc1b2ee5"},
-]
-
-[package.dependencies]
-attrs = ">=22.2.0"
-importlib-resources = {version = ">=1.4.0", markers = "python_version < \"3.9\""}
-jsonschema-specifications = ">=2023.03.6"
-pkgutil-resolve-name = {version = ">=1.3.10", markers = "python_version < \"3.9\""}
-referencing = ">=0.28.4"
-rpds-py = ">=0.7.1"
-
-[package.extras]
-format = ["fqdn", "idna", "isoduration", "jsonpointer (>1.13)", "rfc3339-validator", "rfc3987", "uri-template", "webcolors (>=1.11)"]
-format-nongpl = ["fqdn", "idna", "isoduration", "jsonpointer (>1.13)", "rfc3339-validator", "rfc3986-validator (>0.1.0)", "uri-template", "webcolors (>=1.11)"]
-
-[package.source]
-type = "legacy"
-url = "https://pypi.cartwatch.de/simple"
-reference = "signatrix"
-
-[[package]]
-name = "jsonschema-specifications"
-version = "2023.12.1"
-description = "The JSON Schema meta-schemas and vocabularies, exposed as a Registry"
+version = "4.22.0"
+description = ""
optional = false
-python-versions = ">=3.8"
+python-versions = "*"
files = [
- {file = "jsonschema_specifications-2023.12.1-py3-none-any.whl", hash = "sha256:87e4fdf3a94858b8a2ba2778d9ba57d8a9cafca7c7489c46ba0d30a8bc6a9c3c"},
- {file = "jsonschema_specifications-2023.12.1.tar.gz", hash = "sha256:48a76787b3e70f5ed53f1160d2b81f586e4ca6d1548c5de7085d1682674764cc"},
+ {file = "jsonschema-4.22.0-py3-none-any.whl", hash = "sha256:ff4cfd6b1367a40e7bc6411caec72effadd3db0bbe5017de188f2d6108335802"},
+ {file = "jsonschema-4.22.0.tar.gz", hash = "sha256:5b22d434a45935119af990552c862e5d6d564e8f6601206b305a61fdf661a2b7"},
]
-[package.dependencies]
-importlib-resources = {version = ">=1.4.0", markers = "python_version < \"3.9\""}
-referencing = ">=0.31.0"
-
[package.source]
type = "legacy"
from jsonschema.
I also had this issue, the suggested solution of pinning jsonschema to <4.22.0 worked for me
from jsonschema.
There's nothing I can really look into here without some way of reproducing -- it sounds like a poetry issue, especially given that's the situation it sounds like for all of you above? But yeah I can't really look into anything without a way to reproduce. Pinning clearly isn't a real solution to whatever is up.
from jsonschema.
Related Issues (20)
- `"format":"date-time"` not working HOT 6
- The latest version is slower than 3.2.0 validator HOT 5
- Validation error messages changed after upgrading jsonschema version from 3.2.0 to 4.21.1 HOT 5
- multipleOf fails to validate that 4.02 is a multiple of 0.01 due to floating point math HOT 1
- Unexpected KeyError while running test suite inside GitLab Worker HOT 3
- Enhancing the multipleOf Validator for Improved Decimal Handling in jsonschema HOT 1
- @FormatChecker.checks decorator not a classmethod HOT 1
- RefResolver deprecation docs are confusing and do not explain how to replace a very simple usage (a RefResolver which just specifies a base_uri) HOT 1
- Using the copy button of the code block in the README results in error "zsh: command not found: $" HOT 2
- Support installation via Homebrew HOT 1
- Improve `best_match` when used with applicators HOT 2
- Documentation is out to date HOT 6
- Mitigate undesired side effect of new `best_match` behaviour with alternative proposal HOT 3
- jsonschema not work with python3.13 HOT 1
- When certain types of error messages are converted to strings, certain schema properties are incorrectly converted HOT 3
- Python 3,.13 not yet working due to PyO3 maximum supported version HOT 3
- Relative pointers fail to evaluate HOT 5
- 4.22 fails with pytest, black and so on HOT 1
- `jsonschema._format.is_css_color_code` and `jsonschema._format.is_css21_color` never exist if the latest version of `webcolors` is installed HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from jsonschema.