fix: improve python version specifier handling in pypi.rs#5211
Merged
ruben-arts merged 3 commits intoprefix-dev:mainfrom Jan 2, 2026
Merged
fix: improve python version specifier handling in pypi.rs#5211ruben-arts merged 3 commits intoprefix-dev:mainfrom
ruben-arts merged 3 commits intoprefix-dev:mainfrom
Conversation
Contributor
|
I think looking at this change and the issue, that this is the intended way I wanted to set the version. So if this works, we should give it a go. |
Contributor
Author
|
I've been testing this some more with actually creating a interpreter specific wheel and depending on that. [pypi-dependencies]
minimal-project = { path = "minimal-project/dist/minimal_project-0.1-cp314-cp314-macosx_15_0_arm64.whl" }And that works with this implementation to take that package. And the old code originally fixed an issue with #2481 which still works with this change. |
Contributor
|
Should we take it out of draft and merge? |
Contributor
Author
|
I've added a more specific test to test the functionallity. |
Contributor
Author
|
@tdejager I've enabled auto merge, if you could take another look and approve it github will take over. |
tdejager
approved these changes
Jan 2, 2026
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.
Description
Pixi has to create a
requires-pythonvalue for the pypi solve. It bases that on the Python record from the conda solve.We normally transfrom
python-3.12.4intorequires-python = ">=3.12"But this doesn't work in theuvsolve when it also checks the actuallyrequires-pythonin the pyproject.toml and it doesn't match. e.g. in the case of issue #5202. Where==3.10.6doesn't satisfy>=3.10.*. This is all happening somewhere in the UV code. I checked what uv does with that information and it seems to use the installed python version directly. So change in this PR should do the same.What would be a better fix is to actually get the information from the
requires_pythonspec. This would be more correct. But I don't see a nice way to transfer that information to this solving function.Fixes #5205
Draft because I don't trust the fix yet, @tdejager could you take a critical look?
How Has This Been Tested?
I've tested the issue and tried to break the wheel fetching that is described in the comment above the removed code.
Checklist: