unofficial mirror of bug-guix@gnu.org 
 help / color / mirror / code / Atom feed
From: Lars-Dominik Braun <lars@6xq.net>
To: Maxim Cournoyer <maxim.cournoyer@gmail.com>
Cc: 52269@debbugs.gnu.org
Subject: bug#52269: [PATCH] sitecustomize.py: Honor .pth files.
Date: Mon, 6 Dec 2021 09:42:56 +0100	[thread overview]
Message-ID: <Ya3NEAZXT5U0bPSH@noor.fritz.box> (raw)
In-Reply-To: <871r2taxcm.fsf@gmail.com>

Hi Maxim,

> +if not matching_sites:
> +    exit(0)
are you sure about using `exit()` here? sitecustomize.py is imported
during startup and this would simply quit the Python interpreter if
GUIX_PYTHONPATH is not set, wouldn’t it? (Can’t test the change
unfortunately, because it’s a massive rebuild.)

> +# Move the entries that were appended to sys.path in front of Python's own
> +# site-packages directory.  This enables Guix packages to override Python's
> +# bundled packages, such as 'pip'.
> +python_site_index = sys.path.index(python_site)
> +new_site_start_index = sys.path.index(matching_sites[0])
> +if python_site_index < new_site_start_index:
> +    sys.path = (sys.path[:python_site_index]
> +                + sys.path[new_site_start_index:]
> +                + sys.path[python_site_index:new_site_start_index])
This is unrelated to the pdb issue, right? I see that it’s necessary
right now, but as suggested in #46848 I’d prefer unbundling
setuptools/pip from python. (I’ll send a v3 of the patchset at some
point.)

Cheers,
Lars





  parent reply	other threads:[~2021-12-06  8:44 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-12-04  2:59 bug#52269: [core-updates-frozen] Some Python packages relying on .pth are broken Maxim Cournoyer
2021-12-04  5:36 ` bug#52269: [PATCH core-updates-frozen] sitecustomize does not honor .pth files Maxim Cournoyer
2021-12-13 10:12   ` bug#52269: [core-updates-frozen] sitecustomize.py " Ludovic Courtès
2021-12-13 14:10     ` Maxim Cournoyer
2021-12-06  8:42 ` Lars-Dominik Braun [this message]
2021-12-13 19:04   ` Maxim Cournoyer
2021-12-16  9:48     ` Lars-Dominik Braun
2021-12-17 14:41       ` Maxim Cournoyer
2021-12-17 15:02         ` Maxim Cournoyer

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

  List information: https://guix.gnu.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=Ya3NEAZXT5U0bPSH@noor.fritz.box \
    --to=lars@6xq.net \
    --cc=52269@debbugs.gnu.org \
    --cc=maxim.cournoyer@gmail.com \
    /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 public inbox

	https://git.savannah.gnu.org/cgit/guix.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).