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

python [requirements]: Added maximum version for jsonschema #8748

Conversation

minosgalanakis
Copy link
Contributor

Description

This PR is using PEP0440/ PYPA spec to lock the jsonschema version to versions between 3.2.0 and 4.17.X.

The problem is caused by version 4.18 of jsonschema which added an indirect extra dependency rpds_py without listing it in the changelog.

prds_py brings in a lot of rust dependencies since it is compiled from source, and pip install will fai in a system that does not have properly configured rustc and cargo.

The issue has been documented in multiple other projects:
python-poetry/poetry#8160
pydantic/pydantic#4790
canonical/prometheus-k8s-operator#493

PR checklist

Please tick as appropriate and edit the reasons (e.g.: "backport: not needed because this is a new feature")

  • changelog Not required, does not modify the library, just build enviroment.
  • backport Not required, the driver auto-generation does not exist in 2.28X
  • tests Not required, only changes build enviroment.

@minosgalanakis minosgalanakis added bug component-platform Portability layer and build scripts priority-medium Medium priority - this can be reviewed as time permits size-xs Estimated task size: extra small (a few hours at most) labels Jan 25, 2024
@@ -15,5 +15,5 @@ Jinja2 >= 2.10.1; python_version < '3.10'
Jinja2 >= 2.10.3; python_version >= '3.10'
# Jinja2 >=2.10, <3.0 needs a separate package for type annotations
types-Jinja2 >= 2.11.9
jsonschema >= 3.2.0
types-jsonschema >= 3.2.0
jsonschema >= 3.2.0, < 4.18.*
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think that's right: it forbids recent versions of jsonschema. If you have the latest version installed, you should be able to run our scripts,

The problem is a recurring one due to jsonschema's dependencies. It goes away once prebuilt wheels for the latest version become available, which generally takes a few days after each release.

We offer a script scripts/min_requirements.py which installs the minimum required version of each package. That's what we run on the CI.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we need recent versions though? There is no harm in locking the maximum version of a library that is a moving target, unti it reaches EOL or we need to utilise some of their newest features.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug component-platform Portability layer and build scripts priority-medium Medium priority - this can be reviewed as time permits size-xs Estimated task size: extra small (a few hours at most)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants