Fixed propagation of markers to dependencies. Fixes #3254#3660
Merged
kasteph merged 1 commit intopython-poetry:masterfrom Feb 9, 2021
Merged
Fixed propagation of markers to dependencies. Fixes #3254#3660kasteph merged 1 commit intopython-poetry:masterfrom
kasteph merged 1 commit intopython-poetry:masterfrom
Conversation
apollo13
commented
Feb 8, 2021
| ), | ||
| "d": dependency_from_pep_508( | ||
| "d==0.0.1; python_version < '3.7' and platform_system == 'Windows' and sys_platform == 'win32'" | ||
| "d==0.0.1; platform_system == 'Windows' and python_version < '3.7' or sys_platform == 'win32' and python_version < '3.7'" |
Contributor
Author
There was a problem hiding this comment.
@abn This change changes tested behavior but I'd argue that the previous behavior was in fact wrong:
ahaspython_version < 3.7adepends onb&cwhich have the markersplatform_system == 'Windows'andsys_platform == 'win32'respectivelybandcboth depends ondand as such their markers should trickle down, butdshould get installed whenever one of the parent markers is true, not only when both are true.
On the other hand this python_version<3.7 is required for all packages, so the constraint could be rewritten as:
(platform_system == 'Windows' or sys_platform == 'win32' ) and python_version < '3.7'"
but that would probably be more work (and the current form is technically correct). For large dependency trees it might be worth to get the python version out of the nested constraints as far as possible though. But I guess this might require plenty of specialcasing.
kasteph
approved these changes
Feb 9, 2021
1 task
2 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: #3254
I ticked the documentation checkbox simply because I think there is no part in the documentation that I could adjust for this.
@abn This issue got introduced in 1188b31 which you authored; do you think you could give this PR a review?
The main logic change here is that I changed marker merging from
intersecttounion. The rationale for this can be followed easier if you look at the following (commented) dependency graph from the ticket:Now the situation is as follows: Since
altgraphis a non-marked dependency byPyInstallerit should always be installed, there is no way around this. An intersection of*andsys_platform='darwin'yieldssys_platform='darwin'which would resultaltgraphto be only installed ondarwin. An union ensure that it is installed always.