-
Notifications
You must be signed in to change notification settings - Fork 3k
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
--global-option for a specific requirement in requirements file disables use of wheels globally #4118
Comments
Hey @fillest! Thanks for filing this issue and sorry for the lack of a response all this while. Could someone try reproducing this on the current master, with a small test case? I'm not sure why this is this way. Looking at the code, I don't see any hints as to why it was done. My suggestion would be to split up the requirements to install all the wheel-only dependencies in a separate pip run from one using Thanks and sorry again for the wait. |
I have the same issue with pip 10.0.1. It can be reproduced if you have a package which fails to install if it is not from a wheel, e.g. because of missing include files. For example with lxml, on CentOS I do not have libxml2-devel installed, so if I have the requirement:
It fails to compile lxml, while it works without the --install-option on the other package. |
Is there any update on this? I created a functional test for it and attempted a fix in this commit: I am not familiar with the code so if somebody could have a look at it :) |
you need to `pip install celery[sqs]` to get the additional dependencies that celery needs to use SQS queues - there are two libs - boto3 and pycurl. pycurl is a bunch of python handles around curl, so needs to be installed from source so it can link to your curl/ssl libs. On paas and in docker this works fine (needed to add `libcurl4-openssl-dev` to the docker container), but on macos it can't find openssl. We need to pass a couple of flags in: * set the environment variable PYCURL_SSL_LIBRARY=openssl * pass in the global options `build_ext` and `-I{openssl_headers_path}`. As shown here: pycurl/pycurl#530 (comment) Env var is no biggie, but using any install-option flags disables wheels for the whole pip install run. (See pypa/pip#2677 and pypa/pip#4118 for more context on the install-options flags). A whole bunch of our dependencies don't install nicely from source (but do from wheel), so this commit installs pycurl separately as an initial step, with the requisite flags, and then installs the rest of the requirements as before. I've updated the makefile and bootstrap.sh files to reflect this, but if you run `pip install -r requirements.txt` from scratch you will run into issues.
you need to `pip install celery[sqs]` to get the additional dependencies that celery needs to use SQS queues - there are two libs - boto3 and pycurl. pycurl is a bunch of python handles around curl, so needs to be installed from source so it can link to your curl/ssl libs. On paas and in docker this works fine (needed to add `libcurl4-openssl-dev` to the docker container), but on macos it can't find openssl. We need to pass a couple of flags in: * set the environment variable PYCURL_SSL_LIBRARY=openssl * pass in the global options `build_ext` and `-I{openssl_headers_path}`. As shown here: pycurl/pycurl#530 (comment) Env var is no biggie, but using any install-option flags disables wheels for the whole pip install run. (See pypa/pip#2677 and pypa/pip#4118 for more context on the install-options flags). A whole bunch of our dependencies don't install nicely from source (but do from wheel), so this commit installs pycurl separately as an initial step, with the requisite flags, and then installs the rest of the requirements as before. I've updated the makefile and bootstrap.sh files to reflect this, but if you run `pip install -r requirements.txt` from scratch you will run into issues.
Related to #2677, where I think the motivation for the current behavior is indicated. |
#5795 notes that this is the case for |
I'm stuck on this too. @pradyunsg is there any reason why disabling wheels if there is option for the line itself? |
Honestly, I don't know it off the top of my head. I'm pretty sure this entire area needs a whole suite of changes, and #2677 should cover that entire discussion. |
My guess is that pip needs to disable wheel for the specified requirement (and perhaps its dependencies, see #1883), but that’s very tedious to do and requires significant work in the dependency resolver (e.g. the resolver selects a wheel, but later on discovers it should have built from source with custom options instead), so the original implementation decided to cut corners and disables all binaries outright. This isn’t unreasonable since binary distributions were not nearly as prevalent back then (it’s possible wheels might not even exist at the time). |
I think it'd be more reasonable to disable wheel if the |
It’s no that simple. pip currently pass down I’d say that we need to decide on #1883 first. If we decide pip should pass down options to dependencies, the current behaviour is “good enough” since the dependency resolution work would be too significant. But if we don’t (i.e. |
That's a good point. Someone in the thread did mention |
Honestly I’m not sure either. As mentioned above, the whole hunk of logic here needs some rework. And now there’s also PEP 517 to consider. This needs someone to sit down and think through to derive a workable plan going forward. 😥 |
Agreed. The current situation has basically arisen because we've gone through a process of adding functionality on a case by case basis, looking only at local considerations. That was historically a reasonable approach, but it has downsides, which people are now discovering (this issue being a concrete example). We can of course make another "local" assumption on how best to address this one case - and that would almost certainly give the people here something usable. But we'd just be accumulating yet more technical debt by doing so, and at some point pip will become unmaintainable due to the weight of all those individually justifiable decisions. Particularly given how short of manpower the pip development team is. Finding someone with the expertise, time and energy¹ to undertake a full redesign of pip's build option logic is not going to be easy, especially given that the existing mechanisms don't map properly onto PEP 517's config option logic (and backends have been slow in adopting the new logic). But nor is dealing with the consequences of adding another "local" fix. I don't know the right answer, to be honest. ¹ The biggest drain in a redesign exercise like this is not coding - it's making sense of all the demands that every edge case is critically important to someone, making hard judgements on what not to support, and enduring the subsequent negative feedback. |
See pypa#4118. Update documentation to state that using command line options on any requirements will disable all usage of wheels. Since this is unexpected behavior, move text to a warning.
See pypa#4118. Update documentation to state that using command line options on any requirements will disable all usage of wheels. Since this is unexpected behavior, move text to a warning.
See pypa#4118. Update documentation to state that using command line options on any requirements will disable all usage of wheels. Since this is unexpected behavior, move text to a warning.
Facing the same issue with |
Same here... |
#11325 (comment) by @sbidoul :
|
Description:
We have a big requirements file and use wheels. Now we've added a new package and need to pass some build arguments to it. I've figured out it can be placed into requirements file this way:
Pip is invoked like this:
This message is printed:
I expected it to use wheels for other packages but it stopped to use wheels for all the packages mentioned in
deploy/requirements/all.txt
. This breaks the installation process for us, because we use some private wheel-only packages uploaded to ourdevpi
transparent index mirror.Is it intended (why then?) or per-requirement handling is not implemented yet?
(Also after upgrading pip to 9.0.1 and reverting pip version back to 7.1.2 in our requirements file I got
Could not find a version that satisfies the requirement pip==7.1.2 (from -r deploy/requirements/pip.txt (line 1)) (from versions: )
but this one may be adevpi
issue, not sure yet)The text was updated successfully, but these errors were encountered: