Do not use EOL python version if no version was requested#1595
Do not use EOL python version if no version was requested#1595jvllmr wants to merge 1 commit intoj178:masterfrom
Conversation
Signed-off-by: Jan Vollmer <jan@vllmr.dev>
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #1595 +/- ##
=======================================
Coverage 91.66% 91.66%
=======================================
Files 93 93
Lines 18312 18315 +3
=======================================
+ Hits 16785 16788 +3
Misses 1527 1527 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
📦 Cargo Bloat ComparisonBinary size change: +0.00% (23.7 MiB → 23.7 MiB) Expand for cargo-bloat outputHead Branch ResultsBase Branch Results |
|
Thanks for the PR @jvllmr! I appreciate the fix, but I have some concerns about the approach. It'll need periodic bumps as Python versions reach EOL, and it may be both too restrictive (for unmaintained hooks that support/require older Python) and not restrictive enough (for hooks needing >=3.12). I think it would be better to just read I spun up #1596 if you have any feedback. |
|
It's indeed not a catch-all solution, but I think it is feasible because most projects support all versions in |
|
Thanks for the PR! I don’t think we need to put a strict version limit on this. Just because it’s EOL doesn’t mean people can’t still use it. Let’s go with #1596 instead. |
This PR makes sure no EOL python versions are used when creating a python venv without a specific requested version.
Otherwise uv chooses i.e. python 3.9 if it was downloaded via uv before.
I think this is only a workaround to uv not resolving a python version from the target
pyproject.toml, but this should cover most cases where the target hook does not specify alanguage_versionkey since most projects support all versions that are not EOL. This change adds the--python >=3.10arg to theuv venvcommand to achieve that.This is just a suggested work around. I can provide tests if the change is generally accepted.
fixes #1594