Skip to content

[pull] main from pypa:main - #198

Merged
pull[bot] merged 8 commits into
All-Blockchains:mainfrom
pypa:main
Sep 22, 2026
Merged

pull[bot] merged 8 commits into
All-Blockchains:mainfrom
pypa:main

Conversation

@pull

@pull pull Bot commented Sep 22, 2026 •

Copy link
Copy Markdown

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 : )

konstin and others added 8 commits August 5, 2026 22:39
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)
@pull pull Bot locked and limited conversation to collaborators Sep 22, 2026
@pull pull Bot added the ⤵️ pull label Sep 22, 2026
@pull
pull Bot merged commit ded8541 into All-Blockchains:main Sep 22, 2026
1 check failed
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants