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

sdispater commented Jan 5, 2020

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 requested a review from python-poetry/core Jan 5, 2020
@sdispater sdispater added this to In Progress in Bugs Jan 5, 2020
Copy link
Member

stephsamson left a comment

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
32 checks passed
32 checks passed
Linting
Details
Linting
Details
Linux (2.7)
Details
Linux (2.7)
Details
Linux (3.5)
Details
Linux (3.5)
Details
Linux (3.6)
Details
Linux (3.6)
Details
Linux (3.7)
Details
Linux (3.7)
Details
Linux (3.8)
Details
Linux (3.8)
Details
MacOS (2.7)
Details
MacOS (2.7)
Details
MacOS (3.5)
Details
MacOS (3.5)
Details
MacOS (3.6)
Details
MacOS (3.6)
Details
MacOS (3.7)
Details
MacOS (3.7)
Details
MacOS (3.8)
Details
MacOS (3.8)
Details
Windows (2.7)
Details
Windows (2.7)
Details
Windows (3.5)
Details
Windows (3.5)
Details
Windows (3.6)
Details
Windows (3.6)
Details
Windows (3.7)
Details
Windows (3.7)
Details
Windows (3.8)
Details
Windows (3.8)
Details
Bugs automation moved this from In Progress to Closed Jan 10, 2020
@sdispater sdispater deleted the propagate-dependency-markers branch Jan 10, 2020
@StephenBrown2 StephenBrown2 mentioned this pull request Jan 10, 2020
5 of 5 tasks complete
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Bugs
  
Closed
2 participants
You can’t perform that action at this time.