question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

pip download --no-deps tries to use PEP517 so badly it is not usable to download stuff

See original GitHub issue

pip 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:closed
  • Created 3 years ago
  • Reactions:1
  • Comments:6 (6 by maintainers)

github_iconTop GitHub Comments

1reaction
uranusjrcommented, Mar 10, 2021

I assumed PyPI can be trusted to serve the right sdist version.

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 potentially pip 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.

0reactions
pradyunsgcommented, Jul 19, 2021

Closing as a duplicate of #7995.

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found