Support for multiple-constraint direct origin dependencies with same version#5715
Merged
radoering merged 4 commits intopython-poetry:masterfrom May 30, 2022
Merged
Conversation
Closed
3 tasks
3 tasks
Closed
neersighted
requested changes
May 29, 2022
…t origin dependencies with same name and version
cdda8b2 to
4a4a8a8
Compare
neersighted
approved these changes
May 29, 2022
Member
Author
|
The base class still has several (more than 10) direct instances. |
3 tasks
3 tasks
Merged
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.
Resolves: #4810
Resolves: #5447
Resolves: #5714
Prior to #5640 dependencies with same version from different sources were merged, which led to incorrect lock files. However, according to #4810 at least in some cases the installer was able to mitigate the incorrect lock files by installing a suitable wheel anyway.
With #5640 instead of generating incomplete lock files a solver error is raised. Although, in terms of correctness that's an improvement, it could also be considered a minor regression by some users. This PR, improves the handling of multiple-constraint direct origin (path, url, git) dependencies fundamentally.
The first commit of this PR enables the provider/solver to handle multiple-constraint direct origin dependencies correctly by considering them as duplicates and not merging them by version anyway. However, that is not enough to create correct lock files because the installer discards direct origin dependencies with same name and version as well.
In order to enable the installer to handle this kind of dependencies a new Repository type, which can distinguish between multiple direct origin dependencies with the same version, is introduced.
Further, a consistent order of direct origin dependencies in the lock file is ensured.