Yelp / swagger_spec_validator

Other
104 stars 71 forks source link

Bug: jsonschema.compat #149

Open peterdudfield opened 3 years ago

peterdudfield commented 3 years ago

ModuleNotFoundError: No module named 'jsonschema.compat

Jsonschema has a new version out, where this does not exist, and causes an error.

https://github.com/Yelp/swagger_spec_validator/blob/master/swagger_spec_validator/ref_validators.py#L14

See error more detail here

tirkarthi commented 3 years ago

Given that this project supports 2.7 and jsonschema 4.0 drop support for 2.7 it makes sense to pin the version number in setup.py .

tirkarthi commented 3 years ago

See also https://github.com/Julian/jsonschema/issues/845

peterdudfield commented 3 years ago

so maybe https://github.com/Yelp/swagger_spec_validator/pull/148 this the fix do - just pin it in the requirements? But this doesnt seem so nice a solution

tirkarthi commented 3 years ago

This seems to be an issue with python_requires being not honored. This is fixed in https://github.com/Julian/jsonschema/commit/e61dcbcb2a156b8d517c4ee7ea08c8e9e2acfb35 . There is also 4.0.1 tagged with the commit https://github.com/Julian/jsonschema/releases/tag/v4.0.1 . So probably once 4.0.0 is yanked with the fixed version (4.0.1) in PyPI tools will continue to pull jsonschema < 4.0.0 automatically.

tirkarthi commented 3 years ago

Sorry, I was wrong here. It seems the version for jsonschema needs to be pinned here or to fix jsonschema.compat usage https://github.com/netbox-community/netbox/issues/7401

uoxiu commented 3 years ago

Yep, swagger_spec_validator should be fixed to work with jsonschema==4.x or set in setup.py max version 3.x

temporary fix is to install manually version 3.x pip install jsonschema==3.2.0

peterdudfield commented 3 years ago

https://github.com/Yelp/swagger_spec_validator/pull/146 this is a good solution - using 'six'

leplatrem commented 2 years ago

What is the status of this issue?

peterdudfield commented 2 years ago

I think it go fixed in https://github.com/Yelp/swagger_spec_validator/commit/734c7e1e77b09899146b17cd96781a28a5bfebd1#diff-f63c3ee26a4134e668551fb48835df29afe314537b277b8ffe33de979262210b and all unittest tests pass with jsonschema=4.3.3

So I reckon this issue can be closed