guix-commits
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

04/163: build/python: Replace PYTHONPATH by GUIX_PYTHONPATH_X_Y in add-i


From: guix-commits
Subject: 04/163: build/python: Replace PYTHONPATH by GUIX_PYTHONPATH_X_Y in add-installed-pythonpath.
Date: Mon, 25 Jan 2021 02:01:14 -0500 (EST)

apteryx pushed a commit to branch cu/farewell-to-pythonpath
in repository guix.

commit 6dc9e00b1c66e52d023333bfadd8e3b36aaf4c47
Author: Maxim Cournoyer <maxim.cournoyer@gmail.com>
AuthorDate: Fri Jan 22 09:39:01 2021 -0500

    build/python: Replace PYTHONPATH by GUIX_PYTHONPATH_X_Y in 
add-installed-pythonpath.
    
    * guix/build/python-build-system.scm (add-installed-pythonpath): Use the
    guix-pythonpath procedure to compute the new GUIX_PYTHONPATH_X_Y string and
    use that in place of PYTHONPATH.
---
 guix/build/python-build-system.scm | 14 +++++++-------
 1 file changed, 7 insertions(+), 7 deletions(-)

diff --git a/guix/build/python-build-system.scm 
b/guix/build/python-build-system.scm
index 77bd621..566000f 100644
--- a/guix/build/python-build-system.scm
+++ b/guix/build/python-build-system.scm
@@ -181,14 +181,14 @@ numbers substituted for X and Y, respectively."
                    "/site-packages/")))
 
 (define (add-installed-pythonpath inputs outputs)
-  "Prepend the Python site-package of OUTPUT to PYTHONPATH.  This is useful
-when running checks after installing the package."
-  (let ((old-path (getenv "PYTHONPATH"))
-        (add-path (site-packages inputs outputs)))
-    (setenv "PYTHONPATH"
+  "Add the Python site-package of OUTPUT to GUIX_PYTHONPATH_X_Y.  This is
+useful when running checks after installing the package."
+  (let* ((GUIX_PYTHONPATH_X_Y (guix-pythonpath inputs))
+         (old-path (getenv GUIX_PYTHONPATH_X_Y))
+         (add-path (site-packages inputs outputs)))
+    (setenv GUIX_PYTHONPATH_X_Y
             (string-append add-path
-                           (if old-path (string-append ":" old-path) "")))
-    #t))
+                           (if old-path (string-append ":" old-path) "")))))
 
 (define* (install #:key inputs outputs (configure-flags '()) use-setuptools?
                   #:allow-other-keys)



reply via email to

[Prev in Thread] Current Thread [Next in Thread]