Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 927818 - distutils-r1.eclass: defang pip uninstall by removing RECORD
Summary: distutils-r1.eclass: defang pip uninstall by removing RECORD
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Eclasses (show other bugs)
Hardware: All Linux
: Normal normal (vote)
Assignee: Michał Górny
URL:
Whiteboard:
Keywords: PATCH, PullRequest
Depends on:
Blocks:
 
Reported: 2024-03-25 14:45 UTC by Eli Schwartz
Modified: 2024-04-01 09:40 UTC (History)
2 users (show)

See Also:
Package list:
Runtime testing required: ---


Attachments
distutils-r1.eclass: remove wheel metadata that is bad for distros (0001-distutils-r1.eclass-remove-wheel-metadata-that-is-ba.patch,1.48 KB, patch)
2024-03-25 14:45 UTC, Eli Schwartz
Details | Diff
distutils-r1.eclass: get rid of setuptools egg files as well (0001-distutils-r1.eclass-get-rid-of-setuptools-egg-files-.patch,1.25 KB, patch)
2024-03-25 17:16 UTC, Eli Schwartz
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Eli Schwartz 2024-03-25 14:45:54 UTC
Created attachment 888550 [details, diff]
distutils-r1.eclass: remove wheel metadata that is bad for distros

pip has a wonderful track record of inconsistency and half measures. At times, gentoo has patched pip to prevent it running as root at all. Currently, a pip option to require an option before modifying the global packages is enabled, but that has the downside of, well, permitting users to pass an option to mess things up.

In order for pip to uninstall existing portage-managed packages, it needs to know what files are owned by the package. The pip equivalent of portage's CONTENTS is "RECORD". It is optional and as an installing tool we should exercise our discretion to not install it:

https://packaging.python.org/en/latest/specifications/recording-installed-packages/#the-dist-info-directory
Comment 1 Eli Schwartz 2024-03-25 14:49:04 UTC
Other files that may appear:

- METADATA: needed
- entry_points.txt: needed


- top_level.txt: useful to applications mapping available imports


- direct_url.json: not created by gpep517
- INSTALLER: not created by gpep517
Comment 2 Eli Schwartz 2024-03-25 17:16:17 UTC
Created attachment 888561 [details, diff]
distutils-r1.eclass: get rid of setuptools egg files as well

A couple more files created by setuptools exclusively, and even that only by accident.
Comment 3 Larry the Git Cow gentoo-dev 2024-04-01 09:40:53 UTC
The bug has been closed via the following commit(s):

https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=73c49f3c00415dee99407dabba8d3b22895c9d25

commit 73c49f3c00415dee99407dabba8d3b22895c9d25
Author:     Michał Górny <mgorny@gentoo.org>
AuthorDate: 2024-03-25 19:01:52 +0000
Commit:     Michał Górny <mgorny@gentoo.org>
CommitDate: 2024-04-01 09:36:34 +0000

    distutils-r1.eclass: Remove more junk from .dist-info
    
    Closes: https://bugs.gentoo.org/927818
    Signed-off-by: Michał Górny <mgorny@gentoo.org>

 eclass/distutils-r1.eclass | 15 ++++++++++++---
 1 file changed, 12 insertions(+), 3 deletions(-)