pip download --no-deps tries to use PEP517 so badly it is not usable to download stuff
See original GitHub issuepip version
21.0.1
Python version
3.9.2
OS
Fedora Linux 33, x86_64
Additional information
No response
Description
Let’s say I want to download an sdist from PyPI with pip download
:
$ pip download --no-deps --no-binary :all: --no-build-isolation dnspython==2.1.0
...
ModuleNotFoundError: No module named 'poetry'
Or even:
$ pip download --no-deps --no-binary :all: --no-build-isolation --no-use-pep517 dnspython==2.1.0
Collecting dnspython==2.1.0
Using cached dnspython-2.1.0.zip (389 kB)
ERROR: Disabling PEP 517 processing is invalid: project specifies a build backend of poetry.masonry.api in pyproject.toml
I can use:
$ pip download --no-deps --no-binary :all: dnspython==2.1.0
Collecting dnspython==2.1.0
Using cached dnspython-2.1.0.zip (389 kB)
Installing build dependencies ... done
Getting requirements to build wheel ... done
Preparing wheel metadata ... done
Saved ./dnspython-2.1.0.zip
Successfully downloaded dnspython
However, that takes 3 minutes. I assume because it installs poetry and all the transitive deps from sdists.
Expected behavior
I expect pip download --no-deps --no-binary :all:
to just download the sdist without trying to build it.
How to Reproduce
See Description.
Output
See Description.
Code of Conduct
- I agree to follow the PSF Code of Conduct
Issue Analytics
- State:
- Created 3 years ago
- Reactions:1
- Comments:6 (6 by maintainers)
Top Results From Across the Web
ERROR: Could not build wheels for scipy which use PEP 517 ...
When i gave pip3 install scipy --trusted-host pypi.org --trusted-host files.pythonhosted.org , I got the error Failed building wheel for scipy .
Read more >PEP 517 and projects that can't install via wheels - Packaging
Currently the pip workflow for installing an sdist goes (roughly) like this: download sdist, prepare build environment, create a wheel ( python ...
Read more >could not build wheels for pycairo which use pep 517 and ...
Tried installing PyGObject through python, but it's throwing an error; tried pip install PyGObject --no-use-pep517; pip install --upgrade wheel; Reset $PATH ...
Read more >Changelog history — tox 3.3.0 documentation
Switch pip invocations to use the module -m pip instead of direct invocation. This could help avoid some of the shebang limitations.
Read more >Python SDK install failed with PEP 517 - Couchbase Forums
Then I tried “pip install --no-binary :all: couchbase”, get the same error again. ERROR: Could not build wheels for couchbase which use PEP...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Well actually… (OK sorry let’s not do that.)
There are some previous discussions on this, see #7995 (and the multiple references in it). I think it’s a valid argument that distribution validation is probably counter-intuitive for
pip download
(and potentiallypip wheel
), or at least when--no-deps
is specified.The biggest roadblock (aside from coming up with a rule that makes sense) is implementation; validation should only be skipped on very specific subcommand-option combinations, and it’s not trivial to pass all the needed context all the way down to where the validation is done. Definitely technically feasible, but falls very much in the “those who can don’t care; who care can’t” territory.
Closing as a duplicate of #7995.