-
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
pip download --no-binary :all: --no-build-isolation importlib_medata fails to fetch a proper sdist or takes a long time to complete #10917
Comments
Can you try running with -v or even -vv and identify where the slowdown occurs? I'm pretty sure it's an issue with importlib metadata or setuptools-scm that's causing problems here. This message is a symptom of that problem:
I'll take a note that we need to improve this warning. /cc @jaraco for the kind of weird failures that setuptools is causing due to having a default version instead of failing. This is the sort of thing that I'm concerned about, in pypa/setuptools#2329 (comment). |
Also, if the issue here is that you don't have setuptools-scm installed, then you should get better behaviour from pip in |
@pradyunsg Thanks for the quick reply... not that the PKG-INFO metadata are correct... it's only the setup.cfg which is of partially filled in. The build isolation seems to create some complete virtual env with pip/setuptools/setuptools_scm ... from scratch and seem to build everything from source, may be it is mining bitcoins? 👼 😇 ... which is not needed since I do not require a build but only a mere sdist download, and I do not require the deps either ... so there is a lot of work likely done extra when I would likely only expect a lookup to PyPI to get the URL to download at most before the download proper and nothing else beyond this. |
And here is a verbose log with --no-buidl-isolation At least this fails fast. In all cases setuptools_scm has been involved. |
@pradyunsg I tend to think that setuptools-scm should never be needed when I merely download a source distribution. No build should ever be attempted in the first place IMHO. |
Well, pip download pkg will download pkg and its dependencies. Discovering the dependencies needs the metadata to be generated (pip doesn't read PKG-INFO files, only METADATA, if I remember correctly -- there's also a PEP standardising metadata format for sdists that hasn't been implemented yet). And, if you're thinking you can circumvent that by passing no-deps, you're right but right now "download" and "generate metadata" are highly coupled in pip -- there's an open issue for no-deps pip download and metadata generation as well. |
@pradyunsg ok, fair enough. How can I help there? Practically pip download is essentially useless in its current incarnation as it never can reliably download all the things you ask it to, even if it takes a long time. I have medium size pinned requirements files with about 100 specs and this never completes correctly. So the alternative for me is either: help fix it here or craft my own effective and working downloader. What would you recommend? |
@pradyunsg I am not sure why you labeled this |
Description
This fails with a pinned version:
This works but gets a very old version after trying to fetch almost all versions:
or this works without
--no-build-isolation
but takes a very long time to complete which makes it impractical to use.Expected behavior
The sdist should be downloaded alright, reasonably fast and never fail.
BUT instead of reading the sdist PKG-INFO metadata (which IMHO should not even ever be opened), pip opens the setup.cfg which is using setuptools_scm and fails.... because there is no version there. And fails because it somehow would need setuptools_scm to read a PKG-INFO file?
Instead the command (without
--no-build-isolation
) eventually works but takes forever because it is somehow running something... I would expect a mere read of the metadata not to require running anything for an sdist. I would expect reading metadata not even br needed for a --no-deps download.So with all these, it becomes rather hard to reliably or practically fetch ONLY the sdist: either it takes a long time, or it fails, or is incorrect (returning a very old version like in the first example above)
pip version
pip 22.0.3
Python version
3.9
OS
linux
How to Reproduce
pip download --no-binary=:all: --dest wheels/ --no-build-isolation importlib_metadata==4.11.1
Output
No response
Code of Conduct
The text was updated successfully, but these errors were encountered: