Skip to content

feat(pypi): evaluate the extras and dependency_groups markers - #4

Draft
aignas wants to merge 1 commit into
feat.aignas.pycross-parity-01-docsfrom
feat.aignas.pycross-parity-02-pep508-sets
Draft

aignas wants to merge 1 commit into
feat.aignas.pycross-parity-01-docsfrom
feat.aignas.pycross-parity-02-pep508-sets

Conversation

@aignas

@aignas aignas commented Nov 19, 2026

Copy link
Copy Markdown
Owner

PEP 751 adds the extras and dependency_groups marker variables, which
hold a list of names and are used as "<name>" in extras or
"<name>" not in dependency_groups. pylock.toml files use them to select
the packages of the requested extras and dependency groups, but the marker
evaluation only supported string values, so such markers silently evaluated
to False.

This evaluates them with normalized names, like packaging does in the lock
file context. A caller that evaluates lock files sets them to an empty list
when nothing is requested; when they are not set, the non-strict evaluation
keeps the expression and the strict evaluation fails. Any other use of them,
e.g. extras == "a", fails.

Stack (fork test PRs): on top of #3.

PEP 751 adds the list valued 'extras' and 'dependency_groups' marker
variables, which are used as '"<name>" in <var>'. Evaluate them with
normalized names, so that the markers in pylock.toml files can be
evaluated. The callers that evaluate the lock files need to set them to an
empty list when there are none; other uses of them fail.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant