-
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
Optimize pip download --no-binary
for packages using PEP-517 by ignoring --no-binary when building isolated build environment for purposes of verifying downloaded sdist metadata
#10589
Comments
pip download --no-binary
for packages using PEP-517 by ignoring --no-binary when building isolated build environment for purposes of verifying downloaded sdist metadata.pip download --no-binary
for packages using PEP-517 by ignoring --no-binary when building isolated build environment for purposes of verifying downloaded sdist metadata
One immediate idea is to add an |
I think one question to answer is, what do we want If they don't care about downloading build dependencies, then If we think that |
I don't know the answer to the question "what do people want", but I do know that in the past there has been a strong insistence from some areas that downloading everything as source is an important use case. This came up when So I agree with you that it's important to find out what people want in this area, and hopefully, if you hunt out those (and other) prior discussions, that might help clarify that question. I don't have any insights personally - I have no interest in |
In a sense, we are having this conversation exactly because we listened to use cases and actually implemented them. As Paul said, Since the people requesting this new "packages that I consider a part of |
It sounds like for this use case, build dependencies would need to be installed (or preinstalled) from sources as well.
I may be misundestanding this point, but I think the change here is that now we have PEP-517, which can specify build dependencies, and the question is, should
Great point, and thanks for listening to users. As a user, I opened this issue because of a noticeable regression in |
Here's an explicit answer: Yes, and people already depend on this being the case so this behaviour likely will not change.
Given that your usecase is covered by a different flag, is there anything actionable here? |
If the point here is "PEP 517 builds are slow and, hence, a regression" , then... well, there's already many open issues for that and I'd prefer that we close this one in favour of those. |
I don't think this is the case. For example, for numpy:
As we see, pip downloaded only the source tarball of numpy, but not sources of PEP-517 build dependencies of numpy (setuptools, wheel, Cython). As I mentioned, this can be a separate issue of it's own, leaving it up to pip maintainers if we need to open one.
If you think that |
I have not seen an issue that actually explained the rootcause of the slowdown (which I described in this issue, that's why I opened it), but if there is a duplicate, feel free to deduplicate. |
You're misunderstanding the use case. The goal is to not run any downloaded binary, which |
@uranusjr I see, thanks for correction. In this case, this behavior sounds like "Working as intended". I thought the intent / primary use case of the |
Sounds like a |
This semantic is shared between multiple pip commands (I think |
What's the problem this feature will solve?
pip download --no-binary :all:
is sometimes too slow for packages that switched to use PEP-517, or have packages using PEP-517 in their dependency chain.To observe this issue, run pip download in verbose mode:
Users have brought up this issue couple of times, however there seems to be some confusion as to actual reasons of this behavior.
Possible explanations that are likely incorrect:
pip -v download --dest /tmp poetry --no-deps --no-binary :all:
pip download --no-deps ...
#1884pip download --no-binary
usability has decreased to the point of becoming unusable, example: pip download --no-deps tries to use PEP517 so badly it is not usable to download stuff #9701.Describe the solution you'd like
A user of
pip download --no-binary
cares about sdists of the package and its dependencies. However a user likely doesn't care whether sdists or bdists of build deps are used for package metadata verification purposes.After
pip download --no-binary
has downloaded an sdist, and starts verifying package metadata viaprepare_metadata_for_build_wheel
hook, pip should ignore--no-binary
flag when creating an isolated build environment for the purpose of metadata verification.Also if users don't specify
--no-deps
, and specify--no-binary
, chances are they may still want to download PEP-517 build dependencies as well, not just runtime dependencies, and if they specify--no-binary :all:
, then it would make sense to download and save sdists of build dependencies in target download folder (this doesn't happen right now but may be worth a separate issue?). But in any case, we don't have to install build deps from sdists for metadata verification, and can use bdists.Alternative Solutions
pip download --no-deps ...
#1884 is addressed. However that issue looks like it may be a harder problem to solve, based on the history of the issue and reasons for why metadata checks are done currently.--prefer-binary-in-pep-517-build-environment
pip download --no-deps --no-binary project-name
pip download --no-deps ...
#1884 (comment).Additional context
Aspects of this issue have been discussed at various points in
pip download --no-deps ...
#1884pip download --no-binary
#10195Code of Conduct
The text was updated successfully, but these errors were encountered: