-
-
Notifications
You must be signed in to change notification settings - Fork 611
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
environment markers for different versions of same package override each other #518
Comments
There is also another problem: a dependency of a requirement which has an environment marker is always added unconditionally without a marker. In the example above, the python3-version of I think that the dependencies of install requirements that have environment markers should only be installed when the top-level requirement is. That means, the marker should propagate to all the dependencies of marked requirements (unless these are also required by some other package which has no marker?). |
I think the problem demonstrated in your first The second issue, of wanting combined/unified environment compilation, may be better continued at #826, which is really about "combined output" or "merged markers." The third issue, about "deep" markers, is more directly discussed at #563, but closed by adding documentation. The discussion at #826 includes a hack demonstrating deep markers in a way, which is more feasible now that Can you confirm that the first issue is resolved? |
I think this issue could use some clarification. I'll start by including the output generated from the original input, using Python 3 and Linux: cloudpickle==2.0.0
# via doit
doit==0.33.1 ; python_version >= "3"
# via -r requirements.in
pyinotify==0.9.6
# via doit
Are you experiencing that with no pre-existing output file?
|
I have a
requirements.in
file which lists the same package twice, each time using a different environment marker. For python 2.7, I want to pin the version to the last python2-supported one; whereas for python 3 and above, I want to install the current version (which is python3 only).Now, when I use
pip
to install from such an abstract requirements.in file, it manages to correctly read the different environment markers, and will install the pinned version on python 2.7 and the latest one on python 3.However, if I use
pip-compile
the resultingrequirements.txt
has wrong version specifier and environment markers.Here is the content of
requirements.in
:And here is the output from pip-compile:
You'll notice that
doit
is pinned to==0.29.0
but it is followed by the wrong environment marker: it says; python_version >= "3"
but it should have been; python_version == "2.7"
.And the current
doit
version0.30.3
(as of 29 May 2017) is not listed forpython_version >= "3"
.The expected output should have been:
I get the same result -
doit==0.29.0 ; python_version >= "3"
- whether I run pip-compile from python 3.6.1 or from python 2.7.13.I haven't looked at the code yet, but it looks like the environment marker of the last defined package with a given name overrides previous ones; whereas for the version specifiers, the first one for a given package name holds even if subsequently redefined.
I wonder if there are plans to support this kind of behavior in pip-compile?
Thank you in advance.
Related issues and PRs:
Environment Versions
The text was updated successfully, but these errors were encountered: