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

rororo should require jsonschema <= 4.17.3 #394

Open
playpauseandstop opened this issue Nov 15, 2023 · 1 comment
Open

rororo should require jsonschema <= 4.17.3 #394

playpauseandstop opened this issue Nov 15, 2023 · 1 comment
Assignees
Labels
bug Something isn’t working dependencies Changes that update dependency file

Comments

@playpauseandstop
Copy link
Owner

As jsonschema==~4.18 will result in,

  File ".venv/lib/python3.11/site-packages/rororo/__init__.py", line 15, in <module>
    from rororo.openapi import (
  File ".venv/lib/python3.11/site-packages/rororo/openapi/__init__.py", line 11, in <module>
    from rororo.openapi.contexts import openapi_context
  File ".venv/lib/python3.11/site-packages/rororo/openapi/contexts.py", line 6, in <module>
    from rororo.openapi.data import OpenAPIContext
  File ".venv/lib/python3.11/site-packages/rororo/openapi/data.py", line 15, in <module>
    from openapi_core.validation.request.datatypes import RequestParameters
  ...
  File ".venv/lib/python3.11/site-packages/openapi_schema_validator/validators.py", line 11, in <module>
    meta_schema=_utils.load_schema("draft4"),
                ^^^^^^^^^^^^^^^^^^
AttributeError: module 'jsonschema._utils' has no attribute 'load_schema'

And jsonschema==~4.19 will result in,

  ...
  File ".venv/lib/python3.11/site-packages/openapi_schema_validator/validators.py", line 3, in <module>
    from jsonschema import _legacy_validators, _utils, _validators
ImportError: cannot import name '_legacy_validators' from 'jsonschema' (/Users/idavydenko/Projects/playpauseandstop/igordavydenko/.venv/lib/python3.11/site-packages/jsonschema/__init__.py)
@playpauseandstop playpauseandstop added bug Something isn’t working dependencies Changes that update dependency file labels Nov 15, 2023
@playpauseandstop playpauseandstop self-assigned this Nov 15, 2023
@playpauseandstop playpauseandstop changed the title rororo might only work with jsonschema <= 4.17.3 rororo should require jsonschema <= 4.17.3 Nov 15, 2023
@Julian
Copy link

Julian commented Nov 17, 2023

Hi. I happen to be seeing this issue while doing a general GitHub search -- can I ask if there's anything I can do to make it even clearer that these are private and can change without warning? They follow Python conventions (beginning with an underscore) -- and they also have trivial replacements (specifically the VALIDATORS attribute on a Validator is the way to access functions which validate particular keywords, and there's no reason to call load_schema outside of the package itself, you should use importlib.resources).

It's the first time seeing this package (congrats on writing it) -- so just my 0.02, but I wouldn't be trying to pin jsonschema from above if it were me, I'd simply ensure you were using public APIs instead of private ones. Happy to answer questions if needed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn’t working dependencies Changes that update dependency file
Projects
None yet
Development

No branches or pull requests

2 participants