Skip to content

Add candidate-extra evaluation to Marker.evaluate - #1395

Open
r266-tech wants to merge 1 commit into
pypa:mainfrom
r266-tech:oss-autonomy/7b4b8f0d7e39-67ceda4af6a8
Open

Add candidate-extra evaluation to Marker.evaluate#1395
r266-tech wants to merge 1 commit into
pypa:mainfrom
r266-tech:oss-autonomy/7b4b8f0d7e39-67ceda4af6a8

Conversation

@r266-tech

Copy link
Copy Markdown
Contributor

Adds a keyword-only extras parameter to Marker.evaluate for evaluating a marker against candidate extras. The complete marker expression is evaluated independently for each candidate, names are normalized with existing PEP 685 rules, an empty set returns False, and the candidate set takes precedence over environment['extra']; existing scalar evaluation and extras/dependency_groups membership behavior remain unchanged.

Adds focused tests for the issue's Requirement("a[b,c]") / extra == 'b' example, normalization, empty and nonmatching sets, and whole-expression conjunctions, plus documentation in docs/markers.rst.

git diff --check and the repository lint session passed. The focused candidate-extra assertions passed in completed test sessions, but the broader tests nox command exceeded its runtime budget and did not complete; its selective coverage report also failed the repository's 100% threshold, so the full suite result is inconclusive.

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