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

allow use of not-embedded pip #6062

Merged
merged 1 commit into from
Aug 31, 2022

Conversation

dimbleby
Copy link
Contributor

Fixes #6060

The code still falls back to embedded pip if no other pip can be found - see the implementation of Env.pip().

(Tests change because we save ourselves a call to get_embedded_wheel() which causes a python script to be run to get environment info.)

I realise that the discussion in #6060 hasn't yet reached a conclusion but this is trivial enough that we might as well have it available.

@dimbleby
Copy link
Contributor Author

seeing #6205 reminded me of this one.

Certainly this doesn't bring such large gains as are claimed there but I reckon it does take about 50% off a typical "poetry install" (with warm caches, downloaded artifacts).

Copy link
Member

@neersighted neersighted left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm fine with this, but I'd like to hear from a few others.

@radoering
Copy link
Member

I thought, it might make a difference when updating pip as a locked dependency (at least on Windows). But it seems it makes no difference if the embedded pip or the pip inside the venv is used. I always get the following error:

ERROR: To modify pip, please run the following command: ...\python.exe -m pip install ...

So I'm fine with it, too.

@neersighted neersighted merged commit 0a5e4b5 into python-poetry:master Aug 31, 2022
@dimbleby dimbleby deleted the allow-unembedded-pip branch August 31, 2022 18:51
@brandon-leapyear
Copy link

brandon-leapyear commented Oct 26, 2022

This is an old work account. Please reference @brandonchinn178 for all future communication


Note: it seems like this PR fixed a bug in 1.2.0 where an upgrade to virtualenv would fail poetry self update when trying to call the embedded pip (virtualenv just released a new version today, which is causing the issue).

Repro:

docker run --rm -it python:3.10 bash

# in docker
python3 -m venv venv
venv/bin/pip install poetry==1.2.0 virtualenv==20.16.5
venv/bin/poetry self update

Fails with:

  Command ['/venv/bin/python3', '/venv/lib/python3.10/site-packages/virtualenv/seed/wheels/embed/pip-22.2.2-py3-none-any.whl/pip', 'install', '--disable-pip-version-check', '--prefix', '/venv', '--upgrade', '--no-deps', '/root/.cache/pypoetry/artifacts/8a/85/69/120758446f5ee47cfa1c7c237156c8eaf982af2f9f5778dd1aa1395273/poetry-1.2.2-py3-none-any.whl'] errored with the following return code 2, and output: 
  /venv/bin/python3: can't open file '/venv/lib/python3.10/site-packages/virtualenv/seed/wheels/embed/pip-22.2.2-py3-none-any.whl/pip': [Errno 2] No such file or directory

Opening an issue doesn't seem appropriate since this is now fixed, but maybe a test should be added to ensure this doesn't regress?

Copy link

This pull request has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Mar 28, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

using embedded pip is slow
4 participants