Skip to content
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

Properly propagate dependency markers #1829

Merged
merged 1 commit into from
Jan 10, 2020
Merged

Conversation

sdispater
Copy link
Member

Pull Request Check List

  • Added tests for changed code.
  • Updated documentation for changed code.

This PR fixes the propagation of environment markers for dependencies. Before this change, the environment markers where not properly propagated which could cause false reports of incompatibilities. For instance, if you had the black dependency with the python_version >= '3.6' and implementation_name != 'pypy' environment marker, the resolution would fail with the following message:

[SolverProblemError]
The current project's Python requirement (~2.7 || ^3.4) is not compatible with some of the required packages Python requirement:
  - black requires Python >=3.6

Because no versions of black match >19.10b0,<20.0
 and black (19.10b0) requires Python >=3.6, black is forbidden.
So, because my-package depends on black (^19.10b0), version solving failed.

This is obviously wrong since we specified python_version >= '3.6' but the marker was lost during the resolution.

I took this opportunity to improve the way we handle markers to avoid producing markers that are obviously wrong or that can't be satisfied.

@sdispater sdispater added kind/bug Something isn't working as expected area/solver Related to the dependency resolver labels Jan 5, 2020
@sdispater sdispater requested a review from a team January 5, 2020 15:35
Copy link
Member

@kasteph kasteph left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This PR looks good, just one comment I have below which is more of a question :)

poetry/puzzle/provider.py Show resolved Hide resolved
@sdispater sdispater merged commit 6e053e5 into master Jan 10, 2020
@sdispater sdispater deleted the propagate-dependency-markers branch January 10, 2020 09:34
Copy link

github-actions bot commented Mar 1, 2024

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.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Mar 1, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
area/solver Related to the dependency resolver kind/bug Something isn't working as expected
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants