Code Monkey home page Code Monkey logo

Comments (7)

JAEarly avatar JAEarly commented on June 11, 2024 2

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.

Julian avatar Julian commented on June 11, 2024

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.

evelyn9191 avatar evelyn9191 commented on June 11, 2024

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.

Julian avatar Julian commented on June 11, 2024

Please provide something which reproduces.

from jsonschema.

felix1m avatar felix1m commented on June 11, 2024

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.

JAEarly avatar JAEarly commented on June 11, 2024

I also had this issue, the suggested solution of pinning jsonschema to <4.22.0 worked for me

from jsonschema.

Julian avatar Julian commented on June 11, 2024

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)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.