From mboxrd@z Thu Jan 1 00:00:00 1970 From: Ricardo Wurmus Subject: Re: Down with PYTHONPATH! Date: Thu, 18 Jul 2019 10:20:18 +0200 Message-ID: <87wogfg3el.fsf@elephly.net> References: <87muikr3bq.fsf@mdc-berlin.de> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Return-path: Received: from eggs.gnu.org ([2001:470:142:3::10]:49260) by lists.gnu.org with esmtp (Exim 4.86_2) (envelope-from ) id 1ho1eM-0006Jd-E7 for guix-devel@gnu.org; Thu, 18 Jul 2019 04:20:27 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ho1eL-00020z-B1 for guix-devel@gnu.org; Thu, 18 Jul 2019 04:20:26 -0400 Received: from sender-of-o51.zoho.com ([135.84.80.216]:21279) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1ho1eL-0001zo-1F for guix-devel@gnu.org; Thu, 18 Jul 2019 04:20:25 -0400 In-reply-to: List-Id: "Development of GNU Guix and the GNU System distribution." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-devel-bounces+gcggd-guix-devel=m.gmane.org@gnu.org Sender: "Guix-devel" To: Hartmut Goebel Cc: guix-devel@gnu.org Hi Hartmut, > F=C3=BCr welche F=C3=A4lle wird PYTHONPATH eigentlich gesetzt - sprich f= =C3=BCr welche > F=C3=A4lle brauchen wir eine L=C3=B6sung? > > 1. guix environment --ad-hoc python: NEIN, da das environment > "komplett" ist We set PYTHONPATH here, because the search path is attached to the =E2=80=9Cpython=E2=80=9D package. It is not needed here, but that=E2=80=99= s how the search path mechanism works in Guix. > 2. guix package -i python: JA, python ein symlink in den store ist, > aber "site-packages" aus dem profile kommen sollen (PYTHONPATH wird > in "$GUIX_PROFILE/etc/profile" gesetzt This is the same case as above. In both cases a profile is generated and PYTHONPATH is set since the =E2=80=9Cpython=E2=80=9D package contains a= search path definition for PYTHONPATH. It is not set if only a Python module is installed without =E2=80=9Cpython= =E2=80=9D itself. Installing, for example, only =E2=80=9Cpython-numpy=E2=80=9D witho= ut also installing =E2=80=9Cpython=E2=80=9D won=E2=80=99t lead to a definition of P= YTHONPATH. > 3. python Anwendungen (z.B. pdfposter): JA, im Wrapper Here we set PYTHONPATH in a wrapper script during a standard build phase of the python-build-system. (We can use wrap-script once core-updates is merged to use a Guile wrapper in the very same file.) So, there really are only two cases where we set PYTHONPATH: in profiles due to the search-path property on =E2=80=9Cpython=E2=80=9D itself, and in = wrapper scripts. It is conceivable to have both cases happen at the same time: installing a Python application (or a library that also includes an executable) together with =E2=80=9Cpython=E2=80=9D into a profile would lead to having = the application wrapped in PYTHONPATH at build time and it would set PYTHONPATH (e.g. by adding it to the profile=E2=80=99s etc/profile) because =E2=80=9Cpython=E2=80=9D is installed. -- Ricardo