Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 12 additions & 9 deletions source/specifications/dependency-specifiers.rst
Original file line number Diff line number Diff line change
Expand Up @@ -457,15 +457,16 @@ DO NOT need to define these fields.

The ``extra`` field is also special, as it expects set-like behaviour, but
predates the addition of ``Set of strings`` as a defined marker field type.
Accordingly, ``extra == "name"`` in a dependency declaration is similar to
``"name" in extras``, while ``extra != "name"`` is similar to
``"name" not in extras``. For dependency marker evaluations, the set of extra
names used for these comparisons is the full set of requested extras for *that
particular package*, whether requested directly in a top level dependency
declaration, or indirectly in a transitive dependency declaration. Other
comparison operations on ``extra`` are not defined and publishing tools SHOULD
emit an error, index servers MAY disallow uploads containing such environment
markers, while locking and installation tools SHOULD evaluate them as False.
It only supports one operation, ``extra == "name"``, which is similar to
``"name" in extras``. ``extra != "name"`` SHOULD NOT be used anymore and MAY
be rejected or evaluated to false. For dependency marker evaluations, the set
of extra names used for these comparisons is the full set of requested extras
for *that particular package*, whether requested directly in a top level
dependency declaration, or indirectly in a transitive dependency declaration.
Other comparison operations on ``extra`` are not defined and publishing tools
SHOULD emit an error, index servers MAY disallow uploads containing such
environment markers, while locking and installation tools SHOULD evaluate them
as False.

Unlike the newer ``extras`` field, environment markers using this field SHOULD
be accepted by both publishing tools and index servers. Marker evaluation
Expand Down Expand Up @@ -707,6 +708,8 @@ History
work. [#marker_comparison_logic]_
- January 2026: fix outdated references to other documents that were
inadvertently retained from :pep:`508`
- July 2026: Explain that ``extra != "name"`` is not (properly) supported
(https://discuss.python.org/t/ban-negative-extras-for-extras-marker/108022/24)


References
Expand Down
Loading