Yelp / swagger_spec_validator

Other
104 stars 71 forks source link

Dependencies without versioning #116

Closed worroc closed 5 years ago

worroc commented 5 years ago

Project Dependencies mentioned in setup.py doesn't contain their versions and denies to pin the version of the swagger_spec_validator itself.

setup.py ... install_requires=[ 'jsonschema', 'pyyaml', 'six', ],

In my project I pin the version of swagger-spec-validator to 2.0.2 suddenly I started to get an error:

swagger_spec_validator.common.SwaggerValidationError: module 'jsonschema._validators' has no attribute 'properties_draft4'

the docker install log shows that the reason is a version of jsonschema

pip install: Collecting jsonschema (from swagger-spec-validator==2.0.2->-r /requirements.txt (line 5)) Downloading https://files.pythonhosted.org/packages/cd/e6/be1b2a6ebebdaf1f790f1e750bb720fbda0335c2a19601ea9d8bb5059f38/jsonschema-3.0.0-py2

the version swagger_spec_validator==2.0.2 work perfectly with jsonschema==2.6.0 but not with 3.0.0

macisamuele commented 5 years ago

@worroc thanks a lot for the reporting. Some time ago I did address the concern related to jsonschema-validator v3.0.0 release (https://github.com/Yelp/swagger_spec_validator/pull/103). The latest version should work properly with v3.0.0 too so I would recommend to bump swagger-spec-validator

edit: I did see that from jsonschema-validator release our build is failing ... going to address it soon-ish

Side note: Generally speaking is recommendable to pin your dependencies in order to preserve environment reproducibility, but this should be done not only with the direct dependencies but also the indirect ones (ie. jsonschema-validator in your case)

macisamuele commented 5 years ago

@worroc I'm going to close it for now. Free free to re-open it in case bump-ing swagger-spec-validator does not help you out.