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.
Undoing #407 and taking a different approach. (Can confirm that this still fixes python-poetry/poetry#5591).
When setting python versions we also construct a marker to carry the same information. Prior to #407, the python constraint and python marker were not consistent, which that MR fixed by re-parsing the constructed marker into a fresh constraint.
This was nonsense: the constraint was right all along, it was the constructed marker that was wrong.
The result is that as of today a python requirement like
<=3.10
is interpreted as<3.11
- whereas it should be equivalent to<=3.10.0
NB there is no problem with the normalization of python markers: a marker like
python_version <= "3.10"
is equivalent topython_version < "3.11"
. But that was never the correct marker for the python requirement.So in this MR I revert #407, and make the construction of a
python_version
marker from a constraint be more careful of this edge condition, we now explicitly zero-pad and usepython_full_version
when we hit it.(IMO this is not important enough to delay the upcoming 1.2.0 release).