-
-
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
pip-compile on 1.10.2+ fails to handle mypy; >= '3.2' on python 2.7 #635
Comments
Hello @tuukkamustonen, sorry for the delay. You are right, this is due to how we handle the markers in the requirement file. This is a known issue; The reason it "worked" under v1.10.0 and v1.10.1 was actually due to a bug where the python 3 wheels would be used even on python 2 to get the dependencies (effectively meaning you were getting the python 3 variant of the dependencies, which may or may not be different). As a result, the .tar.gz was never used, the setup.py not executed, and you weren't getting any issue (beside getting the dependencies list of a python 3 wheel while on python 2, of course). This is something I would like to see fixed in the future of course, but I'm bit short on time. |
@vphilippon I had a similar issue while trying to install install_requires=[
"attrs>=17.3.0",
"pyrsistent>=0.14.0",
"six>=1.11.0",
"functools32;python_version<'3'",
],
Could you please point me to the specific sections of the codebase where I can take a look for investigating the bug, so that I can submit a PR? |
This is because pip-compile currently does not support parsing of environment markers. See: jazzband/pip-tools#635
Hi @onyb, thanks for your offer! I can point you to https://github.com/jazzband/pip-tools/blob/master/piptools/scripts/compile.py#L187 and https://github.com/jazzband/pip-tools/blob/master/piptools/resolver.py#L74 Although, the solution might be be to do something similar to https://github.com/jazzband/pip-tools/blob/master/piptools/sync.py#L114 (use But we have to be carefull with to not break the If we mix the 2, what I forsee is that we will get in a state where we compute dependencies only for the dependencies of the current system/environment, while introducing potential "unresolved" packages in the final file, essentially breaking the reproductibility promise. If we want to support the workflow where you have a single requirements.in file with markers, with which you perform a pip-compile on each target environment (python version + OS), then we would have to revert #460, as it appears simply incompatible to me. @barrywhart @suutari-ai @davidovich Any input here? |
I have had similar issue with
The environment marker is passed through to
But your case is interesting, because
|
FWIW, I can't reproduce the
And it generated the following requirements.txt:
|
@onyb i did the same check as Barry, and couldn't reproduce either. What's the --
@barrywhart You summarized the whole pain of trying to deal with cross-environment dependency resolution. Thank you 👍 Regarding your My honest feeling is that I think that a clear statement regarding this should be made: That the vision of Sadly, this wouldn't cover the case where a lib forgets to put environment markers on a package, as given by @barrywhart . The "real" answer is to have the offending package fix its dependencies, as it would with any version conflicts. The only other way around that would be to keep the environment markers from To be a 100% honest, I would prefer this feature (copying environment markers) to be removed. I hate to take away any contribution to the Open-Source (heck, we need more!), While it appeared to be a first step toward a better solution at first, I fear that keeping this feature would give us a lot of headache and a lot more trouble with this change now. I had to deal with a similar behavior when offering help and support with
@barrywhart If you have a maintainable idea to keep that feature to un-break some cases as you mentioned, I would be happy to hear it. Of course, such a change would be done as part of a Major release. (That was quite a wall of text. There was a lot to point out. I really wish this was easier to deal with.) |
Perhaps we could keep the environment marker copying, but make it optional (i.e. the default is to not propagate them). I see your point about people getting confused using it, but TBH, I wonder how many people who use @vphilippon, can you clarify your question here:
Are you referring to something I said on this ticket, or is it a general question? |
@barrywhart That was a general question. And of course, I intend to better document and put upfront the idea that pip-tools aims to take care of a single environment. I'll let the idea of keeping the optional marker-copy behavior running in my head for a while, see how it comes out. |
Idea: Just as
It could also include details on the environment. |
Idea: Provide a tool similar in spirit to |
Todo: Document the expectation that @barrywhart For your first idea, that wouldn't play too well with the For your second idea, that sounds like a good tool idea. I wonder how well it could be done simply with |
Oopsie, accidentally closed it :) Though, it really should be closed now that #647 is in. Will give 2.x a spin tomorrow! |
I believe this is related to how environment markers are handled.
With
requirements.in
of:On python 2.7, run:
Produces:
This works on
1.10.0
and1.10.1
but not on1.10.2+
or1.9.x
.On python 3.5 and
1.11.0
, it works, and output even retains the environment marker:Environment Versions
linux
2.7.12
9.0.1
1.11.0
The text was updated successfully, but these errors were encountered: