From: Wojtek Kosior via Guix-patches via <guix-patches@gnu.org>
To: 宋文武 <iyzsong@envs.net>
Cc: jgart <jgart@dismail.de>, Lars-Dominik Braun <lars@6xq.net>,
64573-close@debbugs.gnu.org
Subject: bug#64573: [PATCH 0/3] guix: build: python-build-system: Have applications by default ignore non-Guix libraries in user site dir
Date: Wed, 26 Jul 2023 11:14:51 +0200 [thread overview]
Message-ID: <20230726111451.4700f17f.koszko@koszko.org> (raw)
In-Reply-To: <875y6cokj7.fsf@envs.net>
[-- Attachment #1: Type: text/plain, Size: 2870 bytes --]
> Hello, I think we can let pip just break as other distros (eg: ArchLinux
> and Debian) with PEP-668.
>
> https://gitlab.archlinux.org/archlinux/packaging/packages/python/-/blob/main/EXTERNALLY-MANAGED
> https://pythonspeed.com/articles/externally-managed-environment-pep-668/
> https://peps.python.org/pep-0668/#recommendations-for-distros
>
> With usage guide towards virtual environments, guix shell, or pipx
> (not packaged yet).
>
> Consider other distros does the same thing, this should be safer.
>
> What do you think? 🤔
You're right, making pip break and recommend pipx seems like the right
thing to do.
I opened a new issue with patches that add python-pipx (haven't done
anything related to the 'EXTERNALLY-MANAGED' file yet, tho).
Thanks,
Wojtek
-- (sig_start)
website: https://koszko.org/koszko.html
fingerprint: E972 7060 E3C5 637C 8A4F 4B42 4BC5 221C 5A79 FD1A
follow me on Fediverse: https://friendica.me/profile/koszko/profile
♥ R29kIGlzIHRoZXJlIGFuZCBsb3ZlcyBtZQ== | ÷ c2luIHNlcGFyYXRlZCBtZSBmcm9tIEhpbQ==
✝ YnV0IEplc3VzIGRpZWQgdG8gc2F2ZSBtZQ== | ? U2hhbGwgSSBiZWNvbWUgSGlzIGZyaWVuZD8=
-- (sig_end)
On Sat, 22 Jul 2023 08:30:04 +0800 宋文武 <iyzsong@envs.net> wrote:
> Wojtek Kosior <koszko@koszko.org> writes:
>
> > Python applications used to prioritize loading their libraries from so-called
> > "user site dir" (usually in ~/.local/lib/python<VERSION>/site-packages). The
> > libraries would only be loaded from /gnu/store when not found in the user site
> > dir. This used to cause hard-to-diagnose bugs like [1] when a user happened to
> > have a similar but incompatible version of a library installed via pip.
> >
> > These patches modify the python-build-system's procedure responsible for
> > wrapping executables. The modified proc defines a PYTHONNOUSERSITE variable
> > which makes Python applications disregard the user site dir when loading
> > libraries.
> >
> > While this solution does harden most Python applications, it can also break a
> > few ones like pip that operate on the user site dir itself. To work around
> > that, the second patch introduces a change to pip to allow installing to the
> > user site directory even when PYTHONNOUSERSITE is set by the Guix-created
> > wrapper script.
>
> Hello, I think we can let pip just break as other distros (eg: ArchLinux
> and Debian) with PEP-668.
>
> https://gitlab.archlinux.org/archlinux/packaging/packages/python/-/blob/main/EXTERNALLY-MANAGED
> https://pythonspeed.com/articles/externally-managed-environment-pep-668/
> https://peps.python.org/pep-0668/#recommendations-for-distros
>
> With usage guide towards virtual environments, guix shell, or pipx
> (not packaged yet).
>
> Consider other distros does the same thing, this should be safer.
>
> What do you think? 🤔
[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 228 bytes --]
prev parent reply other threads:[~2023-07-26 9:15 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-07-11 18:12 [bug#64573] [PATCH 0/3] guix: build: python-build-system: Have applications by default ignore non-Guix libraries in user site dir Wojtek Kosior via Guix-patches via
2023-07-11 18:14 ` [bug#64573] [PATCH 1/3] guix: build: python-build-system: Don't process " Wojtek Kosior via Guix-patches via
2023-07-11 18:14 ` [bug#64573] [PATCH 2/3] gnu: python-pip: Enable user site even with PYTHONNOUSERSITE Wojtek Kosior via Guix-patches via
2023-07-11 18:14 ` [bug#64573] [PATCH 3/3] guix: build: python-build-system: Honor disable-user-site? argument Wojtek Kosior via Guix-patches via
2023-07-16 8:55 ` [bug#64573] [PATCH 0/3] guix: build: python-build-system: Have applications by default ignore non-Guix libraries in user site dir Lars-Dominik Braun
2023-07-17 14:23 ` Wojtek Kosior via Guix-patches via
2023-07-18 9:41 ` Lars-Dominik Braun
2023-07-18 12:55 ` Wojtek Kosior via Guix-patches via
2023-07-22 0:30 ` 宋文武 via Guix-patches via
2023-07-26 9:14 ` Wojtek Kosior via Guix-patches via [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20230726111451.4700f17f.koszko@koszko.org \
--to=guix-patches@gnu.org \
--cc=64573-close@debbugs.gnu.org \
--cc=iyzsong@envs.net \
--cc=jgart@dismail.de \
--cc=koszko@koszko.org \
--cc=lars@6xq.net \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this external index
https://git.savannah.gnu.org/cgit/guix.git
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.