-
Notifications
You must be signed in to change notification settings - Fork 2.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix and improve handling of extras while resolving dependencies #2887
Merged
Conversation
This file contains 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
sdispater
force-pushed
the
fix-transitive-extras
branch
10 times, most recently
from
September 7, 2020 20:18
f9cafca
to
c08e155
Compare
sdispater
force-pushed
the
fix-transitive-extras
branch
4 times, most recently
from
September 16, 2020 19:31
9ad2e5d
to
d38c901
Compare
sdispater
force-pushed
the
fix-transitive-extras
branch
from
September 18, 2020 12:35
d38c901
to
4bb3c83
Compare
abn
requested changes
Sep 18, 2020
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looking good. Some minor fixes.
sdispater
force-pushed
the
fix-transitive-extras
branch
3 times, most recently
from
September 18, 2020 15:12
2639c45
to
c94d2a6
Compare
abn
previously approved these changes
Sep 18, 2020
sdispater
force-pushed
the
fix-transitive-extras
branch
from
September 18, 2020 15:30
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. |
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
Provider
that 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.