uv/crates/pep440-rs/src
Ibraheem Ahmed e6ddce0246
Normalize python_version markers to python_full_version (#6126)
## Summary

Normalize all `python_version` markers to their equivalent
`python_full_version` form. This avoids false positives in forking
because we currently cannot detect any relationships between the two
forms. It also avoids subtle bugs due to the truncating semantics of
`python_version`. For example, given `requires-python = ">3.12"`, we
currently simplify the marker `python_version <= 3.12` to `false`.
However, the version `3.12.1` will be truncated to `3.12` for
`python_version` comparisons, and thus it satisfies the python
requirement and evaluates to `true`.

It is possible to simplify back to `python_version` when writing markers
to the lockfile. However, the equivalent `python_full_version` markers
are often clearer and easier to simplify, so I lean towards leaving them
as `python_full_version`.

There are *a lot* of snapshot updates from this change. I'd like more
eyes on the transformation logic in `python_version_to_full_version` to
ensure that they are all correct.

Resolves https://github.com/astral-sh/uv/issues/6125.
2024-08-15 21:42:15 -04:00
..
lib.rs Use "pre-release" in prose and Prerelease in code (#5697) 2024-08-01 20:56:29 +00:00
version.rs Normalize python_version markers to python_full_version (#6126) 2024-08-15 21:42:15 -04:00
version_specifier.rs Normalize python_version markers to python_full_version (#6126) 2024-08-15 21:42:15 -04:00