feat: implement extras with conditional dependencies#1542
Merged
wolfv merged 14 commits intoconda:mainfrom Aug 11, 2025
Merged
Conversation
…extras-using-conditional-dependencies
wolfv
reviewed
Jul 24, 2025
wolfv
reviewed
Jul 24, 2025
wolfv
reviewed
Jul 24, 2025
Contributor
|
The benchmarks show a inconsistent difference of +-3% which seems fine to me! |
Contributor
|
ugh, somehow the extras printing adds a single space after |
Contributor
|
I think prefix-dev/resolvo#164 should fix this. |
…extras-using-conditional-dependencies
Collaborator
Author
|
I updated the resolvo dependencies, merged main, and fixed the thing you find. This looks good from my perspective @wolfv |
Contributor
|
Awesome stuff! I think now I need to rebase my PR in #1545 |
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.
Uses conditional dependency support in resolve to implement extras. Result of some late-night hacking with @wolfv .
Extras a written as condition dependencies, e.g. if a package
foohas an optional dependency group calledbarThen conditional requirements are added for
fooin the form of:numpy; if foo[bar]. We add a special "extra" package that representsfoo[bar]. So as a user depends onfoowithbar(foo[bar]),numpywill also be selected.This also adds extras in a different way. Extras are completely optional now, so if a user depends on an extra that doesnt exist the solver will happily continue. Its up to users of the library to warn if an extra is selected that is not actually available for the selected package.