Skip to content

✨ feat(package): validate extras against package metadata#3696

Merged
gaborbernat merged 1 commit into
tox-dev:mainfrom
gaborbernat:feat/validate-extras
Feb 15, 2026
Merged

✨ feat(package): validate extras against package metadata#3696
gaborbernat merged 1 commit into
tox-dev:mainfrom
gaborbernat:feat/validate-extras

Conversation

@gaborbernat

@gaborbernat gaborbernat commented Feb 15, 2026

Copy link
Copy Markdown
Member

tox silently ignored invalid extras names, leading to missing dependencies with no error. When a user configures extras = typo-extra but the package only provides testing, docs, format, the dependency filtering finds nothing and the environment appears to work — but required packages are missing, causing confusing test failures that waste debugging time.

Validation now happens at dependency resolution time using the metadata already available at each code path: static PEP-621 optional-dependencies keys, built distribution Provides-Extra headers, and wheel/sdist metadata. Invalid extras raise a Fail with a clear message listing both the unknown and available extras, e.g. extras not found for package demo: typo (available: alpha, beta).

Closes #1113

Tox silently ignored invalid extras names, leading to missing
dependencies with no error. When a user configures extras that
don't exist in the package (e.g. a typo), the dependency filtering
finds nothing and the environment appears to work — but required
packages are missing, causing confusing test failures.

Validation now happens at dependency resolution time using the
metadata already available at each code path: static PEP-621
optional-dependencies keys, built distribution Provides-Extra
headers, and wheel/sdist metadata. Invalid extras raise a Fail
with a message listing the unknown and available extras.
@gaborbernat gaborbernat enabled auto-merge (squash) February 15, 2026 05:17
@gaborbernat gaborbernat merged commit 4afd60b into tox-dev:main Feb 15, 2026
28 checks passed
@gaborbernat gaborbernat deleted the feat/validate-extras branch February 18, 2026 07:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Validate extras option in tox.ini

1 participant