-
Notifications
You must be signed in to change notification settings - Fork 2.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
[1.1.0b2] Bumping version leaves orphaned dist-info in site-packages #2918
Comments
Hello @MrGreenTea, I guess #2855 is related, is it? fin swimmer |
@finswimmer Looks like the same cause, yeah. |
Does running |
Using |
It seems however, that you will get a certain error message whenever pip has removed all the different versions: $ pip uninstall b
Found existing installation: b 0.0.5
Uninstalling b-0.0.5:
Would remove:
/home/fredrik/code/repos/a/.venv/bin/bclix
/home/fredrik/code/repos/a/.venv/lib/python3.9/site-packages/b-0.0.5.dist-info/*
/home/fredrik/code/repos/a/.venv/lib/python3.9/site-packages/b.pth
Proceed (y/n)? y
Successfully uninstalled b-0.0.5
$ pip uninstall b
Found existing installation: b 0.0.4
Uninstalling b-0.0.4:
Would remove:
/home/fredrik/code/repos/a/.venv/lib/python3.9/site-packages/b-0.0.4.dist-info/*
Proceed (y/n)? y
Successfully uninstalled b-0.0.4
$ pip uninstall b
WARNING: Skipping b as it is not installed. |
Yup but parsing messages is silly :) Re. |
It's kind of annoying that pip doesn't exit with something non-zero when a package was not installed. I understand why it doesn't but if it did, one could just run uninstall in a while loop until the command fails to be sure it was completely cleaned up... |
So, it could be possible to run |
Nice! Thank you, that is actually really helpful in my project as workaround for now. |
Can you please try the fix at #3900. Using pipxpipx install --suffix=@3900 'poetry @ git+https://github.com/python-poetry/poetry.git@refs/pull/3900/head'
alias poetry=poetry@3900
poetry config virtualenvs.in-project true
poetry new example
pushd example
poetry install
find .venv/ -type d -name 'example*.dist-info'
poetry version minor
poetry install
find .venv/ -type d -name 'example*.dist-info'
poetry run pip show example
poetry version 0.1.0
poetry install
poetry run pip show example Using a container (podman | docker)podman run --rm -i --entrypoint bash python:3.8 <<EOF
set -xe
python -m pip install -q git+https://github.com/python-poetry/poetry.git@refs/pull/3900/head
poetry config virtualenvs.in-project true
poetry new example
pushd example
poetry install
find .venv/ -type d -name 'example*.dist-info'
poetry version minor
poetry install
find .venv/ -type d -name 'example*.dist-info'
poetry run pip show example
poetry version 0.1.0
poetry install
poetry run pip show example
EOF |
@abn I just tried the #3900 fix (pipx approach) and I no longer see the lingering .dist-info folders accumulating. 👍 However, I can see a couple of weird things. Maybe expected, but I figured I would mention them... Output on Python 3.9.2 below. You can see how the "Installing..." never turns into the actual version on completed installation:
What was also a bit weird was that I somehow managed to break the output by first using a poetry 1.1.5:
and then I tried poetry@3900 again:
As you can see, that last time the output was very messy... I'm including a screenshot. Maybe this was because I was mixing poetry 1.1.5 and poetry@3900? |
Oh, I misread the issue. Looks like there is a new issue in the lines not being updated during install. But this might not be related to the #3900 fix. Also you will note that in
This is because the new venv does not have pip in it (#2826). |
Still seeing this behavior in v1.1.15 |
This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs. |
I am on the latest Poetry version.
I have searched the issues of this repo and believe that this is not a duplicate.
If an exception occurs when executing a command, I executed it again in debug mode (
-vvv
option).OS version and name: elementary OS 5.1 Hera
Poetry version: 1.1.0b2
Link of a Gist with the contents of your pyproject.toml file: https://gist.github.com/MrGreenTea/992a1795471c00d727c02920d4288f16
Issue
When updating my packages version with
poetry version
old dist-info directories are left insite-packages
.This trips up
pip
,importlib
andpkg_resources
for example when trying to find the packages information.To reproduce:
(run with
poetry config virtualenvs.in-project true
)❯ poetry new example
❯ poetry install
❯ ls .venv/lib/python3.8/site-packages/example*.dist-info
❯ poetry version minor && poetry install
❯ ls .venv/lib/python3.8/site-packages/example*.dist-info
❯ poetry run pip show example
❯ poetry version 0.1.0
❯ poetry run pip show example
The text was updated successfully, but these errors were encountered: