Repository navigation
Infer tags from pyproject optional dependencies - #23691
Open
MaicoTimmerman wants to merge 2 commits into
Open
MaicoTimmerman wants to merge 2 commits into
MaicoTimmerman wants to merge 2 commits into
Conversation
DLukeNelson
reviewed
Oct 22, 2026
Associate requirements generated from project.optional-dependencies with their group names. Combine inferred tags with generator and override tags while preserving order and removing duplicates. Wrap requirements from other parsers without inferred tags to retain their existing behavior. Co-Authored-By: GPT‑5.6 Sol using Factory Droid harnass
MaicoTimmerman
force-pushed
the
pyproject-toml-tags
branch
from
November 1, 2026 13:33
30f0fec to
031e151
Compare
Treat optional-dependency group tags as defaults, not mandatory metadata. Without a tags override, combine and deduplicate generator tags and group tags. When an override contains tags, use that value unchanged, including an empty list to clear all default tags. Check for the presence of the tags key rather than its truthiness so tags=[] remains an intentional override. This keeps override behavior consistent between optional and ordinary requirements and avoids forcing inferred labels onto targets whose tags users explicitly configure. Keep parsing separate from override handling: parsers carry inferred tags in ParsedRequirement, and the shared generator applies field precedence. Unlike the approach removed from PR pantsbuild#16932, parsing does not mutate the overrides mapping. These tags are labels, not a lossless representation of optional-dependency constraints for packaging metadata. Extend the existing target-generation test to cover non-empty and empty tag overrides while retaining multi-group inference coverage. Validation: staged diff passes git diff --check. Pants tests and lint could not run: bootstrap attempts encountered a shared-venv race, and native bootstrap requires rustup, which is not on PATH.
Author
|
I'm hoping to get a review on this PR, would @Eric-Arellano / @stuhood have capacity for that? Since you both participated in the review of @bryanwweber's PR (#16932). |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Associate requirements generated from
project.optional-dependencieswith their group names. Combine inferred tags with generator and override tags while preserving order and removing duplicates.Wrap requirements from other parsers without inferred tags. Open to extension for Poetry dependency groups.
LLM notice:
Hand curated code and initial investigations with GPT‑5.6 Sol using Factory Droid harnass
Fixed #23690