-
Notifications
You must be signed in to change notification settings - Fork 3.1k
PEP 668 support breaks --user/--editable #11776
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
Comments
FWIW, I can use e.g. But that's more work, and not compatible with what's already installed in I don't see how that is any better than continuing to allow I'm still using the system site packages like before, so I don't think it "breaks the system" any less than |
Which is only an option for admins, not regular users on e.g. a shared university server. |
Disallowing |
According to the PEP, so is having an override mechanism. Which there isn't.
Why? |
Since the override mechanism is backed by the PEP, contribution is always welcomed. |
|
@actualben Quick answer is no. Marking PEP 370 as Superceded would be mean the mechanism no longer works, but what PEP 668 specifies is a way to disable user-site by default. Note that per-user site-packages can already be disabled via various ways, the new PEP only adds one additional way and encourages distros to set it by default. |
No, it is not. |
Deleting /usr/lib/pypy3.9/EXTERNALLY-MANAGED |
Note that while "practicality beats purity" and all that, and we don't yet have the override flag released, I feel it's important to note that deleting If you want to install into the system site-packages (and understand the risks1), I would recommend that once the next version of pip is released with the override flag, you either use the Footnotes
|
I do not want to install into system site-packages, but I do want to continue to keep using [global]
break-system-packages = true |
No, both of those invocations work. This flag was added in a newer version of pip than what the user was trying with. |
Only the second option works for me |
If losing all installed Python (pip) packages on every .x upgrade was not enough (on macOS/Homebrew at least), now it became impossible to use `pip install --user` (e.g. on Debian). The suggested solution is to create a venv. The planned pip "escape hatch" mechanisn is not yet available: `no such option: --break-system-packages` Our workaround is to limit the pip install method to macOS and install pefile as system package on Debian, and also MSYS2 where it became available in late 2021. On Debian testing (and MSYS2) the pefile version is the same as we installed via pip. Also stop tracking pefile version and revert to the always latest on macOS. This isn't ideal for cross-platform reproducibility but the actual impact is likely minor. Will have to re-evaluate if we still need pefile at all and/or implement the venv method for macOS. Ref: https://salsa.debian.org/cpython-team/python3/-/blob/master/debian/README.venv Ref: pypa/pip#11776 Ref: pypa/pip#11780 Ref: https://peps.python.org/pep-0668/ Ref: https://bugs.gentoo.org/895410 Ref: https://packages.debian.org/unstable/python/python3-pefile Ref: https://github.com/msys2/MINGW-packages/tree/master/mingw-w64-python-pefile
@obfusk For what it's worth, I've decided to get around this by just setting up a venv in IMHO, the perfect way to take advantage of a venv in set-and-forget mode where you don't have to use the activator script everytime you want to run a Python program. (Which reminds me, I should ask the virtualenv people about maybe adding an |
This comment was marked as abuse.
This comment was marked as abuse.
FWIW there is a discussion thread for this PEP: https://discuss.python.org/t/pep-668-marking-python-base-environments-as-externally-managed/10302 -- it contains a lot of information about the history of this change and discussion of the options. There is also good engagement from the PEP authors / core python devs. |
Thanks @actualben for that link. Locking this since there isn’t much more worth discussing on this issue tracker, and vitriol directed at the volunteers (who maintain the foundational pieces of software you rely on!) isn’t welcome. |
Description
@obfusk filed Debian bug #1030335 about the implementation of PEP 668 support.
I think it's best if this is discussed here, with upstream involvement.
cc @geofft @doko42 @FFY00 @dstufft @uranusjr @ehashman @pradyunsg @kitterma who were involved in the PEP or pip in Debian.
This bug is about a Debian-user-specific issue (not wanting to depend on PyPI), but I don't think this is something Debian should try to solve, alone.
When the PEP was drafted, we were assuming there'd be some sort of mechanism to override it (allow the user to break their system and keep both pieces), I quote:
That didn't make it into the implementation, so I suggested deleting the
EXTERNALLY-MANAGED
file in the documentation Debian is providing about this. It's not great, but it's about the only suggestion I can make:https://salsa.debian.org/cpython-team/python3/-/blob/master/debian/README.venv
Does pip have any thoughts on providing an override mechanism?
There is some value in not having an override (we don't need to keep testing that all these schemes work, for one). But as we transition, we're going to be breaking use-cases...
Expected behavior
No response
pip version
23.0
Python version
3.11.1
OS
Debian GNU/Linux
How to Reproduce
apt install python3-pip
pip install -e .
Output
No response
Code of Conduct
The text was updated successfully, but these errors were encountered: