Clarify which portions of requires-python behavior are consistent with pip (#14752)

See: #14711
This commit is contained in:
Charlie Marsh 2025-07-20 09:44:25 -04:00 committed by GitHub
parent d0efe1ed9c
commit 9c9db9b547
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 3 additions and 1 deletions

View File

@ -447,7 +447,7 @@ By default, uv does not write any index URLs to the output file, while `pip-comp
in the output file, pass the `--emit-index-url` flag to `uv pip compile`. Unlike `pip-compile`, uv in the output file, pass the `--emit-index-url` flag to `uv pip compile`. Unlike `pip-compile`, uv
will include all index URLs when `--emit-index-url` is passed, including the default index URL. will include all index URLs when `--emit-index-url` is passed, including the default index URL.
## `requires-python` enforcement ## `requires-python` upper bounds
When evaluating `requires-python` ranges for dependencies, uv only considers lower bounds and When evaluating `requires-python` ranges for dependencies, uv only considers lower bounds and
ignores upper bounds entirely. For example, `>=3.8, <4` is treated as `>=3.8`. Respecting upper ignores upper bounds entirely. For example, `>=3.8, <4` is treated as `>=3.8`. Respecting upper
@ -455,6 +455,8 @@ bounds on `requires-python` often leads to formally correct but practically inco
as, e.g., resolvers will backtrack to the first published version that omits the upper bound (see: as, e.g., resolvers will backtrack to the first published version that omits the upper bound (see:
[`Requires-Python` upper limits](https://discuss.python.org/t/requires-python-upper-limits/12663)). [`Requires-Python` upper limits](https://discuss.python.org/t/requires-python-upper-limits/12663)).
## `requires-python` specifiers
When evaluating Python versions against `requires-python` specifiers, uv truncates the candidate When evaluating Python versions against `requires-python` specifiers, uv truncates the candidate
version to the major, minor, and patch components, ignoring (e.g.) pre-release and post-release version to the major, minor, and patch components, ignoring (e.g.) pre-release and post-release
identifiers. identifiers.