diff --git a/docs/concepts/resolution.md b/docs/concepts/resolution.md index b680a29fe..7f4e6b256 100644 --- a/docs/concepts/resolution.md +++ b/docs/concepts/resolution.md @@ -112,7 +112,10 @@ version of a dependency requires Python 3.9 or later, while all prior versions s versions for users running Python 3.8. 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`. +ignores upper bounds entirely. For example, `>=3.8, <4` is treated as `>=3.8`. Respecting upper +bounds on `requires-python` often leads to formally correct but practically incorrect resolutions, +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)). ## Platform-specific resolution diff --git a/docs/pip/compatibility.md b/docs/pip/compatibility.md index efa70af31..7898ea7b8 100644 --- a/docs/pip/compatibility.md +++ b/docs/pip/compatibility.md @@ -449,6 +449,12 @@ will include all index URLs when `--emit-index-url` is passed, including the def ## `requires-python` enforcement +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 +bounds on `requires-python` often leads to formally correct but practically incorrect resolutions, +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)). + 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 identifiers.