Repository navigation
[pull] main from pypa:main - #198
Merged
Merged
Conversation
Negative extras (`extra !=`) are currently technically allowed in the grammar, but they behave strangely: `extra !=` means that package could transitively remove a package from selection through activating an extra. This turns incremental resolution into a global problem: We can't exit a resolution with a conflict when we've exhausted all versions in range including backtracking, we also have to exhaustively search for any package version that may activate the extra which deactivates the `extra !=` requirement which is part of the conflict. This would be fatal to resolver complexity and performance, preventing most of the short-circuiting that makes resolving tractable. Much weirder, with negative extras, adding a new dependency can make a previously impossible resolution solvable: ``` [project] name = "foo" version = "0.1.0" dependencies = [ "numpy >2", "numpy <2; extra != 'old-science'", ] ``` Only by adding a package with `Requires-Dist: foo[old-science]`, this resolves. Using PEP 621, users only get positive extras: `project.optional-dependencies.foo` gets translated into a conjunction of `extra == "foo"` with each requirement's marker. While this may look like a breaking change, it only clarifies the current state of support in tools. From [pip not supporting it](pypa/pip#14139) and [uv not supporting it](astral-sh/uv#20107), we know it is not currently used and safe to remove. This solves the [confusion for users who want to use negative extras for conflicting packages](astral-sh/uv#20107).
Ban negative extras (`extra !=` markers)
Update uv_build version to 0.12.17
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
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.
See Commits and Changes for more details.
Created by
pull[bot] (v2.0.0-alpha.4)
Can you help keep this open source service alive? 💖 Please sponsor : )