Resolve python version to work with compatible operator#446
Merged
Conversation
jayqi
requested changes
Mar 19, 2025
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 |
Member
There was a problem hiding this comment.
- 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.
Contributor
Author
There was a problem hiding this comment.
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.
jayqi
approved these changes
Mar 24, 2025
proinsias
added a commit
to proinsias/cookiecutter-data-science-proinsias
that referenced
this pull request
Nov 3, 2025
* upstream/master: (24 commits) Add poetry as an env manager (drivendataorg#460) Support pixi as environment manager (drivendataorg#459) Docs: Add guidelines for contributing and requesting tools (drivendataorg#456) Fix terminal animation generation in docs build (drivendataorg#451) Fix failing pipenv installation on Windows GH actions runners (drivendataorg#453) Fix typo in using-the-template.md (drivendataorg#448) Bump to v2.2.0 [skip ci] Update HISTORY.md [skip ci] Add option for tests (drivendataorg#447) Resolve python version to work with compatible operator (drivendataorg#446) Add pyproject.toml as a dependencies file option (drivendataorg#436) Make PyPI badges links to PyPI (drivendataorg#440) Update to version v2.1.0 (drivendataorg#438) Add back isort configuration that was removed in drivendataorg#387 (drivendataorg#439) add badges to readme and docs homepage (drivendataorg#434) Added support for the uv package and project manager (drivendataorg#408) Add ruff as default linting + formatting option (drivendataorg#387) Add PyTest IDs for better readability and filtering (drivendataorg#409) prepare for 2.0.1 release by bumping version in pyproject.toml and updating change log (drivendataorg#422) Fix pre-prompt ccds version error (drivendataorg#426) ...
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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: