Fix and improve handling of extras while resolving dependencies#2887
Merged
Fix and improve handling of extras while resolving dependencies#2887
Conversation
f9cafca to
c08e155
Compare
9ad2e5d to
d38c901
Compare
d38c901 to
4bb3c83
Compare
2639c45 to
c94d2a6
Compare
abn
previously approved these changes
Sep 18, 2020
c94d2a6 to
55ebb9c
Compare
abn
approved these changes
Sep 18, 2020
Merged
3 tasks
3 tasks
3 tasks
|
This pull request has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs. |
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 subscribe to this conversation on GitHub.
Already have an account?
Sign in.
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.
Pull Request Check List
Resolves: #2545
Resolves: #2494
Resolves: #2300
Resolves: #2080
Resolves: #1609
Resolves: #1616
This one was bothering for a while and was quite the struggle to fix.
Basically, extras could trip up Poetry if the package already existed in the dependency graph leading to dependencies being ignore or uninstalled when updating dependencies.
To make it work, a rather big refactoring was required (see python-poetry/poetry-core#78) to make dependencies and packages comparison more accurate.
The main trick here is that a package with extras will now have its non-extra version as a dependency to help the resolver figure out what needs to be done.
Overall, it simplifies the code by always adding all dependencies of packages (even optional ones) and it's the
Providerthat will now decide which ones should be exposed to the resolver based on the extras selected.One last thing of note is that source urls of file and directory dependencies will now be the fully resolved path, i.e. absolute, to actually be able to make comparisons.