Skip to content
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

New dependency resolver triggers unnecessary downloads #8966

Closed
bersbersbers opened this issue Oct 8, 2020 · 1 comment
Closed

New dependency resolver triggers unnecessary downloads #8966

bersbersbers opened this issue Oct 8, 2020 · 1 comment

Comments

@bersbersbers
Copy link

bersbersbers commented Oct 8, 2020

What did you want to do?
Start with a fresh environment, in particular:

pip uninstall astroid lazy-object-proxy

Then install the two packages again:

pip install --upgrade --upgrade-strategy eager --no-cache-dir --use-feature=2020-resolver astroid lazy-object-proxy

Output
Note how pip downloads two versions of lazy-object-proxy. Obviously, only once can be installed:

Collecting lazy-object-proxy
  Downloading lazy_object_proxy-1.5.1-cp38-cp38-manylinux1_x86_64.whl (54 kB)
     |████████████████████████████████| 54 kB 3.3 MB/s
Collecting astroid
  Downloading astroid-2.4.2-py3-none-any.whl (213 kB)
     |████████████████████████████████| 213 kB 11.2 MB/s
Requirement already satisfied: wrapt~=1.11 in /home/bers/.pyenv/versions/3.8.6/lib/python3.8/site-packages (from astroid) (1.12.1)
Requirement already satisfied: six~=1.12 in /home/bers/.pyenv/versions/3.8.6/lib/python3.8/site-packages (from astroid) (1.15.0)
Collecting lazy-object-proxy
  Downloading lazy_object_proxy-1.4.3-cp38-cp38-manylinux1_x86_64.whl (58 kB)
     |████████████████████████████████| 58 kB 22.3 MB/s
Installing collected packages: lazy-object-proxy, astroid
Successfully installed astroid-2.4.2 lazy-object-proxy-1.4.3

Running an upgrade later again downloads the unneeded package version 1.5.1 without installing it (which is correct as astroid==2.4.2 pins lazy-object-proxy==1.4.*):

pip install --upgrade --upgrade-strategy eager --no-cache-dir --use-feature=2020-resolver astroid lazy-object-proxy
Requirement already satisfied: astroid in /home/bers/.pyenv/versions/3.8.6/lib/python3.8/site-packages (2.4.2)
Requirement already satisfied: lazy-object-proxy in /home/bers/.pyenv/versions/3.8.6/lib/python3.8/site-packages (1.4.3)
Collecting lazy-object-proxy
  Downloading lazy_object_proxy-1.5.1-cp38-cp38-manylinux1_x86_64.whl (54 kB)
     |████████████████████████████████| 54 kB 3.3 MB/s
Requirement already satisfied: wrapt~=1.11 in /home/bers/.pyenv/versions/3.8.6/lib/python3.8/site-packages (from astroid) (1.12.1)
Requirement already satisfied: lazy-object-proxy in /home/bers/.pyenv/versions/3.8.6/lib/python3.8/site-packages (1.4.3)
Requirement already satisfied: six~=1.12 in /home/bers/.pyenv/versions/3.8.6/lib/python3.8/site-packages (from astroid) (1.15.0)

Additional information

  • Issue is not fixed in today's master.
@uranusjr
Copy link
Member

uranusjr commented Oct 8, 2020

This is unavoidable. pip does not know about the lazy-object-proxy==1.4.* specification before it downloads astroid, so it has to start with the best version allowed by the unqualified lazy-object-proxy from the command line).

See discussion in #8893 if you want to ask the next natural question “why doesn’t pip try astroid and its dependencies first?”

@uranusjr uranusjr closed this as completed Oct 8, 2020
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Oct 9, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants