-
Notifications
You must be signed in to change notification settings - Fork 2.6k
Resolve python version to work with compatible operator #446
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
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ccds/hook_utils/dependencies.py
Outdated
| Examples: | ||
| - 3.13 should result in ~=3.13.0 which installs the latest version of Python that is compatible | ||
| with 3.13, so the highest patch number for 3.13 (3.13.3 at the time of writing) | ||
| - 3.13.2 should result in ~=3.13.2 which ensures Python 3.13.2 is used |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
- 3.13.2 should result in ~=3.13.2 which ensures Python 3.13.2 is used
This is not correct. ~=3.13.2 is equivalent to >= 3.13.2, == 3.13.*, so 3.13.3, 3.13.4, etc. will also satisfy it.
https://packaging.python.org/en/latest/specifications/version-specifiers/#compatible-release
In the case of 3 parts, I think we want to use an exact version match.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Aha thanks, I had misunderstood that. Updated, and confirmed that it works when providing . (use ~=) and .. (use ==).
Use uv in CI Fix python version of created environment in tests Pipenv should create its own virtualenv Remove sys import Remove extraneous parenthesis Fix wrong input to configs product Fix virtualenvwrapper to set Python version instead of Python interpreter Install Python executables into PATH
This reverts commit f16bcc7.
Closes #444
Add a post gen hook to resolves a Python version string to one that behaves as expected with the "compatible release" operator which we use in
pyproject.toml[requires-python], for example: