feat: use range when adding requirement #536
Merged
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.
Implements the behavior described in #285 .
When running
pixi add python
we would previously look at all platforms, add the requirement, and solve the environment. We would then take the lowest version between all platforms and pin that. So currently for python that would result in the requirement:This is a very strict requirement. And would also fail to resolve if this version (or a higher version) is not available for all platforms (see #526 ).
This PR changes the behavior by instead adding a range requirement that allows change in the last segment of the version. And allowing for multiple versions if a version is not available for all platforms.
For python this would become:
For the issue described in #526, this becomes:
Note that
1.4
is selected instead of1.3
. This is because1.2
is not available for all platforms.Fix #526
Fix #285