Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

jsonschema 4.0.0 removes compat module #478

Open
marksutherland opened this issue Sep 30, 2021 · 6 comments · Fixed by volkamerlab/opencadd#108 or volkamerlab/teachopencadd#297
Open

Comments

@marksutherland
Copy link

The latest version of the jsonschema packages seems to have removed a compat module which is causing bravado is issue a stacktrace:

❯ pip install bravado
Defaulting to user installation because normal site-packages is not writeable
Collecting bravado
  Downloading bravado-11.0.3-py2.py3-none-any.whl (38 kB)
Collecting requests>=2.17
  Downloading requests-2.26.0-py2.py3-none-any.whl (62 kB)
     |████████████████████████████████| 62 kB 636 kB/s 
Collecting six
  Downloading six-1.16.0-py2.py3-none-any.whl (11 kB)
Requirement already satisfied: pyyaml in /home/vscode/.local/lib/python3.8/site-packages (from bravado) (5.4.1)
Collecting simplejson
  Downloading simplejson-3.17.5-cp38-cp38-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_12_x86_64.manylinux2010_x86_64.whl (139 kB)
     |████████████████████████████████| 139 kB 2.8 MB/s 
Collecting typing-extensions
  Downloading typing_extensions-3.10.0.2-py3-none-any.whl (26 kB)
Collecting python-dateutil
  Downloading python_dateutil-2.8.2-py2.py3-none-any.whl (247 kB)
     |████████████████████████████████| 247 kB 5.4 MB/s 
Collecting msgpack
  Downloading msgpack-1.0.2-cp38-cp38-manylinux1_x86_64.whl (302 kB)
     |████████████████████████████████| 302 kB 7.0 MB/s 
Collecting bravado-core>=5.16.1
  Downloading bravado_core-5.17.0-py2.py3-none-any.whl (67 kB)
     |████████████████████████████████| 67 kB 3.9 MB/s 
Collecting monotonic
  Downloading monotonic-1.6-py2.py3-none-any.whl (8.2 kB)
Collecting jsonschema[format]>=2.5.1
  Downloading jsonschema-4.0.0-py3-none-any.whl (69 kB)
     |████████████████████████████████| 69 kB 4.4 MB/s 
Collecting swagger-spec-validator>=2.0.1
  Downloading swagger_spec_validator-2.7.3-py2.py3-none-any.whl (27 kB)
Collecting jsonref
  Downloading jsonref-0.2-py3-none-any.whl (9.3 kB)
Collecting pytz
  Downloading pytz-2021.1-py2.py3-none-any.whl (510 kB)
     |████████████████████████████████| 510 kB 6.5 MB/s 
Collecting pyrsistent!=0.17.0,!=0.17.1,!=0.17.2,>=0.14.0
  Downloading pyrsistent-0.18.0-cp38-cp38-manylinux1_x86_64.whl (118 kB)
     |████████████████████████████████| 118 kB 6.8 MB/s 
Collecting attrs>=17.4.0
  Downloading attrs-21.2.0-py2.py3-none-any.whl (53 kB)
     |████████████████████████████████| 53 kB 2.0 MB/s 
Collecting uri-template
  Downloading uri_template-1.1.0-py3-none-any.whl (10 kB)
Collecting fqdn
  Downloading fqdn-1.5.1-py3-none-any.whl (9.1 kB)
Collecting idna
  Downloading idna-3.2-py3-none-any.whl (59 kB)
     |████████████████████████████████| 59 kB 4.6 MB/s 
Collecting jsonpointer>1.13
  Downloading jsonpointer-2.1-py2.py3-none-any.whl (7.4 kB)
Collecting isoduration
  Downloading isoduration-20.11.0-py3-none-any.whl (11 kB)
Collecting rfc3339-validator
  Downloading rfc3339_validator-0.1.4-py2.py3-none-any.whl (3.5 kB)
Collecting rfc3987
  Downloading rfc3987-1.3.8-py2.py3-none-any.whl (13 kB)
Collecting webcolors>=1.11
  Downloading webcolors-1.11.1-py3-none-any.whl (9.9 kB)
Requirement already satisfied: urllib3<1.27,>=1.21.1 in /home/vscode/.local/lib/python3.8/site-packages (from requests>=2.17->bravado) (1.26.6)
Collecting charset-normalizer~=2.0.0
  Downloading charset_normalizer-2.0.6-py3-none-any.whl (37 kB)
Requirement already satisfied: certifi>=2017.4.17 in /home/vscode/.local/lib/python3.8/site-packages (from requests>=2.17->bravado) (2021.5.30)
Collecting arrow>=0.15.0
  Downloading arrow-1.1.1-py3-none-any.whl (60 kB)
     |████████████████████████████████| 60 kB 3.4 MB/s 
Installing collected packages: six, python-dateutil, pyrsistent, attrs, arrow, webcolors, uri-template, rfc3987, rfc3339-validator, jsonschema, jsonpointer, isoduration, idna, fqdn, swagger-spec-validator, simplejson, pytz, msgpack, jsonref, charset-normalizer, typing-extensions, requests, monotonic, bravado-core, bravado
Successfully installed arrow-1.1.1 attrs-21.2.0 bravado-11.0.3 bravado-core-5.17.0 charset-normalizer-2.0.6 fqdn-1.5.1 idna-3.2 isoduration-20.11.0 jsonpointer-2.1 jsonref-0.2 jsonschema-4.0.0 monotonic-1.6 msgpack-1.0.2 pyrsistent-0.18.0 python-dateutil-2.8.2 pytz-2021.1 requests-2.26.0 rfc3339-validator-0.1.4 rfc3987-1.3.8 simplejson-3.17.5 six-1.16.0 swagger-spec-validator-2.7.3 typing-extensions-3.10.0.2 uri-template-1.1.0 webcolors-1.11.1
WARNING: You are using pip version 21.1.3; however, version 21.2.4 is available.
You should consider upgrading via the '/usr/local/bin/python -m pip install --upgrade pip' command.
❯ pip show bravado
Name: bravado
Version: 11.0.3
Summary: Library for accessing Swagger-enabled API's
Home-page: https://github.com/Yelp/bravado
Author: Digium, Inc. and Yelp, Inc.
Author-email: [email protected]
License: BSD 3-Clause License
Location: /home/vscode/.local/lib/python3.8/site-packages
Requires: python-dateutil, bravado-core, pyyaml, msgpack, requests, simplejson, monotonic, typing-extensions, six
Required-by: 
❯ python3
Python 3.8.11 (default, Jun 29 2021, 19:54:56) 
[GCC 8.3.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> from bravado.client import SwaggerClient
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/home/vscode/.local/lib/python3.8/site-packages/bravado/client.py", line 53, in <module>
    from bravado_core.param import marshal_param
  File "/home/vscode/.local/lib/python3.8/site-packages/bravado_core/param.py", line 13, in <module>
    from bravado_core.marshal import marshal_schema_object
  File "/home/vscode/.local/lib/python3.8/site-packages/bravado_core/marshal.py", line 11, in <module>
    from bravado_core.model import Model
  File "/home/vscode/.local/lib/python3.8/site-packages/bravado_core/model.py", line 13, in <module>
    from swagger_spec_validator.ref_validators import attach_scope
  File "/home/vscode/.local/lib/python3.8/site-packages/swagger_spec_validator/__init__.py", line 8, in <module>
    from swagger_spec_validator.util import validate_spec_url
  File "/home/vscode/.local/lib/python3.8/site-packages/swagger_spec_validator/util.py", line 9, in <module>
    from swagger_spec_validator import validator12
  File "/home/vscode/.local/lib/python3.8/site-packages/swagger_spec_validator/validator12.py", line 29, in <module>
    from swagger_spec_validator.ref_validators import default_handlers
  File "/home/vscode/.local/lib/python3.8/site-packages/swagger_spec_validator/ref_validators.py", line 14, in <module>
    from jsonschema.compat import iteritems
ModuleNotFoundError: No module named 'jsonschema.compat'

Pinning < 4.0.0 seems to prevent this.

@tirkarthi
Copy link

swagger_spec_validation issue : Yelp/swagger_spec_validator#149

@tirkarthi
Copy link

This was an issue with jsonschema release 4.0.0 where python_requires was not honored. This is fixed in python-jsonschema/jsonschema@e61dcbc with 4.0.1 released and 4.0.0 yanked.

@kpfleming
Copy link

I'm still getting this with jsonschema 4.0.1 installed...

@tirkarthi
Copy link

Yelp/swagger_spec_validator#146 needs to be merged.

@dominiquesydow
Copy link

@tirkarthi, it seems like the problem is resolved, right?

@tirkarthi
Copy link

I guess so 2.7.4 has been released with the merged fix https://pypi.org/project/swagger-spec-validator/

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
4 participants