fix(spec): allow extras and flags on source dependency specs#6274
Closed
hunger wants to merge 1 commit into
Closed
fix(spec): allow extras and flags on source dependency specs#6274hunger wants to merge 1 commit into
hunger wants to merge 1 commit into
Conversation
The manifest reference promises requesting a source package's
extra-dependencies group via 'pkg = { path = "...", extras = [...] }',
but the TOML spec validation swept 'extras' and 'flags' into the blanket
source-spec rejection list, so they only worked on binary specs.
Carry both fields on the manifest-side PathSpec, UrlSpec, and GitSpec and
hoist them into SourceSpec on conversion; location copies (which end up in
lock-file sources maps) always stay clean. Binary archives ('.conda',
'.tar.bz2') reject the fields with a dedicated error since they cannot
honor them.
Two consistency fixes ride along so the feature doesn't thrash the lock
file:
- The satisfiability walker now traverses the experimental_extra_depends
entries of requested extras (per package+extra pair) and rejects locked
records that don't provide a requested group. Previously extras-activated
packages were unreachable and every install re-solved.
- The conda solve validates requested extras (direct, dev-source, and
transitive depends strings) against the solved records, because the
solver itself treats extras as conditional activation and silently
ignores unknown groups. Typos now fail loudly with the available groups.
The passthrough test backend forwards [package.extra-dependencies] from
the project model so integration tests can exercise the full pipeline.
StringMatcher is added to clippy's ignore-interior-mutability list: its
Hash/Eq derive from the pattern string, the interior mutability is only a
lazily-built regex cache.
Contributor
|
@Hofer-Julian has multiple PRs open that address this. |
Contributor
Author
|
Sorry, I ended up here as I was trying to do a tutorial and discovered this is not implemented yet. Without source dependencies having these options, it is really hard to demo this feature as I can not find interesting binary packages ;-) I hoe I have not misunderstood the entire thing :-) |
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.
The manifest reference promises requesting a source package's extra-dependencies group via 'pkg = { path = "...", extras = [...] }', but the TOML spec validation swept 'extras' and 'flags' into the blanket source-spec rejection list, so they only worked on binary specs.
Carry both fields on the manifest-side PathSpec, UrlSpec, and GitSpec and hoist them into SourceSpec on conversion; location copies (which end up in lock-file sources maps) always stay clean. Binary archives ('.conda', '.tar.bz2') reject the fields with a dedicated error since they cannot honor them.
Two consistency fixes ride along so the feature doesn't thrash the lock file:
The passthrough test backend forwards [package.extra-dependencies] from the project model so integration tests can exercise the full pipeline.
StringMatcher is added to clippy's ignore-interior-mutability list: its Hash/Eq derive from the pattern string, the interior mutability is only a lazily-built regex cache.
Description
Fixes #{issue}
How Has This Been Tested?
More unit tests
AI Disclosure
Tools: Claude
Checklist:
schema/model.py.