-
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
Determine what should be done about --(install|global)-option with Wheels #2677
Comments
I had previously opened #1716 for this. I'll close that. |
the only extra tidbit from #1716 is just the awareness that install-options are recognized when placed in distutils config files. |
The main use I've made of
This lets me add build options to the extension build (by injecting an explicit Maybe having a means to add section.key=value items into the source archive's setup.cfg when doing the build would be a more general solution, that is explicitly a "build step" option. Something like (Whether this would be viable depends on what uses other people have for |
According to the recently merged #2537 , people seem to have a need for these options. An implied |
So the problem (and its not unique to the wheel autobuilding) is scoping those options. We can and should use the options from requirements file binding to pass through to the wheels. But the top level --install-option is only defined as applying to the thing being installed, isn't it? Or is it global? Anyhow, if someone can define 'right' here, I'll happily write the code for it. Remember too that folk can always use 'pip wheel' and then -f wheelhouse to get exactly what they want. |
Scoping is certainly a problem, and I've thought before that maybe we should remove those options and instead we should do something like There's also the question of what On the other hand, we might not want to define the API for In the short term it might just make the most sense that using |
@dstufft and I discussed this on IRC, he says that the resolution is: "--install-option, --global-option, --build-option will all disable the consumption of wheels, and any autobuilding of wheels." And that follow on work can be done to assess what we really want/need longer term. |
why doesn't feels like a loss for wheel installs to have less flexibility than sdists. how would this get sorted out in the "longer term"? |
Because Longer term I think that the way to solve this is something like that:
|
In short, the basic problem with those options is that they are explicitly tied to executing |
these all seem like valid uses of install-options that could be applied to wheels.
yes, these options are conceptually tied to setuptools, but don't have to be literally. we'd map them over to our distutils scheme utility. for sure, it's weird to use setuptools options when there's no "setup.py" involved, but the reality is things are fractured right now, and maybe it's ok to break a conceptual line, to give people support for install flexibility in the mean time. to be clear, I'm ok with the approach of ignoring them for wheels for now, but just making it clear, that we could do otherwise, if a lot of people wanted this. |
We already support |
yes, agreed, I'd like to see new top-level options that are setuptools-agnostic |
|
Using --install-options, --build-options, --global-options changes the way that setup.py behaves, and isn't honoured by the wheel code. The new wheel autobuilding code made this very obvious - disable the use of wheels when these options are supplied.
Using --install-options, --build-options, --global-options changes the way that setup.py behaves, and isn't honoured by the wheel code. The new wheel autobuilding code made this very obvious - disable the use of wheels when these options are supplied.
Using --install-options, --build-options, --global-options changes the way that setup.py behaves, and isn't honoured by the wheel code. The new wheel autobuilding code made this very obvious - disable the use of wheels when these options are supplied.
Using --install-options, --build-options, --global-options changes the way that setup.py behaves, and isn't honoured by the wheel code. The new wheel autobuilding code made this very obvious - disable the use of wheels when these options are supplied.
Using --install-options, --build-options, --global-options changes the way that setup.py behaves, and isn't honoured by the wheel code. The new wheel autobuilding code made this very obvious - disable the use of wheels when these options are supplied.
Using --install-options, --build-options, --global-options changes the way that setup.py behaves, and isn't honoured by the wheel code. The new wheel autobuilding code made this very obvious - disable the use of wheels when these options are supplied.
Using --install-options, --build-options, --global-options changes the way that setup.py behaves, and isn't honoured by the wheel code. The new wheel autobuilding code made this very obvious - disable the use of wheels when these options are supplied.
Using --install-options, --build-options, --global-options changes the way that setup.py behaves, and isn't honoured by the wheel code. The new wheel autobuilding code made this very obvious - disable the use of wheels when these options are supplied.
Using --install-options, --build-options, --global-options changes the way that setup.py behaves, and isn't honoured by the wheel code. The new wheel autobuilding code made this very obvious - disable the use of wheels when these options are supplied.
Using --install-options, --build-options, --global-options changes the way that setup.py behaves, and isn't honoured by the wheel code. The new wheel autobuilding code made this very obvious - disable the use of wheels when these options are supplied.
Using --install-options, --build-options, --global-options changes the way that setup.py behaves, and isn't honoured by the wheel code. The new wheel autobuilding code made this very obvious - disable the use of wheels when these options are supplied.
Using --install-options, --build-options, --global-options changes the way that setup.py behaves, and isn't honoured by the wheel code. The new wheel autobuilding code made this very obvious - disable the use of wheels when these options are supplied.
I too have now ran into this (or at least something similar). I need 'wheel install-scripts' to be able to install to a custom path. Right now, it zonks the script wrapper always in '/usr/bin' without the ability to change the prefix path. Is there really no way to have console scripts post wheel install to a custom path? I can certainly do this with eggs. |
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.
+1 to |
The "Disabling all use of wheels due to the use of --build-options / --global-options / --install-options" when building a wheel is quite confusing. It probably should not exist at all when |
I agree this is confusing. Actually |
I'm thinking about this in the context of #8102 (deprecating the To progress with that deprecation, I think we need to decide between one of these two paths:
My current impression is that the road towards (2) is still quite long, and (1) could be a reasonable intermediary step with an alternative that we can support quite easily (i.e. replace |
I agree. I think we should aim towards (2) - config settings are still relatively untried in practice, precisely because the toolchain doesn't support them yet - but I don't want improvements like #8102 to be blocked on it. So (1) as an immediate step sounds perfectly reasonable to me. |
I think I just ran into this too. I'm trying to pass an argument to pip install that can be accessed in setup.py so that I can adjust the installation according to the parameter. I would definitely not expect this behavior and would expect install options to be easily accessible in setup.py |
I ran into a similar issue where I want to pass a prebuilt directory to pip wheel to avoid building a Python extension that I have already built from sources on the machine somewhere. What is the best way? I don't think this is working:
|
I am also having (roughly) this issue- I want to set The
The warning I see is:
@sbidoul @pfmoore, I'm having a hard time following this issue and the linked/referenced issues and can't quite figure out if this is. If you have a moment, I'm just looking for a quick answer for these (I think it could be a sentence):
There are plenty of ways for me to work around this, they're just clunkier than I would expect for what seems like a relatively simple (even if unusual) use-case. That said, I understand that if this is a non-trivial change due to the way the dependencies are handled then it won't be much of a priority and I will hack around it by installing the package with an additional (separate) command if possible |
@mzpqnxow as the last comment on this issue is from 12 months ago, and there has been no activity since, I'll be honest and say that I don't recall a lot of the details. But in the interests of giving you the quick answer you asked for:
No, it's not.
When someone gets round to it is the best answer I can give. This is a volunteer project and the issue has languished mostly ignored since 2015, so it's clearly not that important to anyone. A longer answer follows with a bit more background, if you care. If you were to switch to For anything other than a stopgap fix, we need proper adoption of the PEP 517 "config settings" mechanisms for pip to communicate with the build backend. That's not in our hands - build backend projects like setuptools, flit, enscons, etc, need to start working on support for config settings before we can work out how pip can provide a UX for passing data to them. |
Thanks for taking the time
Understood
Fair enough
I do care, thanks again for the time, especially this bit with the background
|
Currently pip has
--install-option
and--global-option
to make it possible to pass flags to thesetup.py
invocation. However these currently get ignored completely when installing from Wheel. This previously wasn't a big deal because commonly these options are only used for compiled packages and those often don't have Wheels on the platforms you might need these options on. However now in pip 7.0 via #2618 we now attempt to automatically build wheels for all projects. This means that, assuming we can build a wheel, these options are just completely ignored.So what do we do with these options? Do we make their use imply
--no-use-wheel
? Do we attempt to convert them? Get rid of them?The text was updated successfully, but these errors were encountered: