Skip to content

Skip .egg-info build metadata during distribution discovery#13762

Open
fireattack wants to merge 2 commits intopypa:mainfrom
fireattack:fix-uninstall-with-local-egg-info
Open

Skip .egg-info build metadata during distribution discovery#13762
fireattack wants to merge 2 commits intopypa:mainfrom
fireattack:fix-uninstall-with-local-egg-info

Conversation

@fireattack
Copy link

Fixes #13459.

When the current directory is in sys.path and contains .egg-info without installation records, pip would incorrectly identify it as the installed package location instead of the actual installation in site-packages, causing uninstall to fail with 'No files were found to uninstall'.

This fix adds a check to skip .egg-info directories that lack installation record files (installed-files.txt or RECORD), ensuring pip finds the actual installed package.

Fixes an issue where pip uninstall would fail when run from a directory containing .egg-info build metadata (created by 'pip install .' or 'python setup.py egg_info').

When the current directory is in sys.path and contains .egg-info without installation records, pip would incorrectly identify it as the installed package location instead of the actual installation in site-packages, causing uninstall to fail with 'No files were found to uninstall'.

This fix adds a check to skip .egg-info directories that lack installation record files (installed-files.txt or RECORD), ensuring pip finds the actual installed package.
@ichard26
Copy link
Member

Hello!

Thank you for your interest in improving pip! As a community supported project, we greatly appreciate it! Unfortunately, we currently have limited capacity to review contributions, so it may take some time until we are able to review your PR. We would appreciate your patience.

If you have any questions, concerns, or want to remind us to take a look at your PR, feel free to leave a comment at any time.

In the meanwhile... could you add a changelog entry and a test verifying that the bug is actually fixed? Preferably, it would be an unit test under tests/unit/metadata but it may very well be difficult to find the metadata logic independently. If so, you can add a functional test under tests/functional. The script fixture can be used to install packages and run external commands, including setuptools which are available in the testing environment. Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Uninstalling editable install in the same directory is interfered by the generated egg-info folder

2 participants