-
Notifications
You must be signed in to change notification settings - Fork 2.2k
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
[RFC] mark python3 site-packages as externally managed #43703
Comments
I think I'm OK with this. Having to configure pip for user installs is a little annoying but worth the protections for system packages. Still, I'm heavily dependent on pip per-user installation for my regular work and would want to do a bit of testing to see how painful this is in practice. As for containers... when I deploy custom Python in containers, I think it's better to wrap things in a venv anyway (sometimes with |
yes, it does starting with 23.04. see below: https://git.launchpad.net/ubuntu/+source/python3.11/tree/debian/rules?h=ubuntu/lunar#n1241 |
The relevant Debian NEWS file |
this prevents users from breaking xbps-installed python3 packages by using pip outside of a virtual environment. Error message adapted from gentoo's, debian's, and the example from PEP 668 see https://peps.python.org/pep-0668/ for more details closes void-linux#43703
As a heavy Python user I'll add my two cents. I think this is generally a great idea as long as I do find EDIT: Perhaps if this was implemented it would be a good idea to add a new section to the handbook for Python that mentions the workarounds above for various use cases. |
|
Indeed but it's relatively easy to fix by removing the appropriate |
I have had tools like that in my workflow in the past, but never would it have been impossible to simply pass
While easy to fix, this kind of bug has the potential to be very difficult to diagnose properly and take much valuable time, including in the distro's support places (bug tracker, IRC, etc). |
I think we are actually in complete agreement here. I think this change is good. I think advanced users who know what they are doing can use the escape hatch / workarounds listed above to continue using |
if you look at the PR I made for this, the error message pip gives mentions everything already |
Adopted with Python 3.12. |
https://peps.python.org/pep-0668/
By adding a file
/usr/lib/python3.X/EXTERNALLY_MANAGED
, pip will not let users install python modules withpip
outside of virtual environmentsPros
Cons
pip install --user
too (can be solved)pip --break-system-packages
doas pip config set install.break-system-packages True
noextract
on the EXTERNALLY-MANAGED file (could be done by default in void's official containers)Prior Art
cc @void-linux/pkg-committers
The text was updated successfully, but these errors were encountered: