[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
03/131: build/python: Always add the install prefix to the Guix PYTHONPA
From: |
guix-commits |
Subject: |
03/131: build/python: Always add the install prefix to the Guix PYTHONPATH. |
Date: |
Mon, 1 Feb 2021 11:56:30 -0500 (EST) |
apteryx pushed a commit to branch core-updates
in repository guix.
commit 91cf9d17f02fdf82424c7f2dda2c3651f992bf13
Author: Maxim Cournoyer <maxim.cournoyer@gmail.com>
AuthorDate: Fri Jan 22 09:15:46 2021 -0500
build/python: Always add the install prefix to the Guix PYTHONPATH.
This is to remove the need for common boilerplate code in check phase
overrides.
* guix/build/python-build-system.scm
(add-installed-pythonpath): Streamline. This phase depends on the presence
of
a "python" input; thus GUIX_PYTHONPATH is guaranteed to be defined. Update
doc.
(add-install-to-pythonpath): New phase.
(%standard-phases): Order it before the check phase.
---
guix/build/python-build-system.scm | 18 ++++++++++--------
1 file changed, 10 insertions(+), 8 deletions(-)
diff --git a/guix/build/python-build-system.scm
b/guix/build/python-build-system.scm
index 8e35939..9f5fad7 100644
--- a/guix/build/python-build-system.scm
+++ b/guix/build/python-build-system.scm
@@ -6,7 +6,7 @@
;;; Copyright © 2016 Hartmut Goebel <h.goebel@crazy-compilers.com>
;;; Copyright © 2018 Ricardo Wurmus <rekado@elephly.net>
;;; Copyright © 2018 Arun Isaac <arunisaac@systemreboot.net>
-;;; Copyright © 2019, 2020 Maxim Cournoyer <maxim.cournoyer@gmail.com>
+;;; Copyright © 2019, 2020, 2021 Maxim Cournoyer <maxim.cournoyer@gmail.com>
;;; Copyright © 2020 Jakub Kądziołka <kuba@kadziolka.net>
;;; Copyright © 2020 Efraim Flashner <efraim@flashner.co.il>
;;;
@@ -170,13 +170,14 @@
(string-append out "/lib/python" (python-version python)
"/site-packages")))
(define (add-installed-pythonpath inputs outputs)
- "Add the Python site-package of OUTPUT to GUIX_PYTHONPATH. This is useful
-when running checks after installing the package."
- (let ((old-path (getenv "GUIX_PYTHONPATH"))
- (new-path (site-packages inputs outputs)))
- (setenv "GUIX_PYTHONPATH"
- (string-append new-path
- (if old-path (string-append ":" old-path) "")))))
+ "Prepend the site-package of OUTPUT to GUIX_PYTHONPATH. This is useful when
+running checks after installing the package."
+ (setenv "GUIX_PYTHONPATH" (string-append (site-packages inputs outputs) ":"
+ (getenv "GUIX_PYTHONPATH"))))
+
+(define* (add-install-to-pythonpath #:key inputs outputs #:allow-other-keys)
+ "A phase that just wraps the 'add-installed-pythonpath' procedure."
+ (add-installed-pythonpath inputs outputs))
(define* (install #:key inputs outputs (configure-flags '()) use-setuptools?
#:allow-other-keys)
@@ -294,6 +295,7 @@ by Cython."
(replace 'install install)
(add-after 'install 'check check)
(add-after 'install 'wrap wrap)
+ (add-before 'check 'add-install-to-pythonpath add-install-to-pythonpath)
(add-before 'strip 'rename-pth-file rename-pth-file)))
(define* (python-build #:key inputs (phases %standard-phases)
- 16/131: gnu: python-twisted: Remove broken console scripts., (continued)
- 16/131: gnu: python-twisted: Remove broken console scripts., guix-commits, 2021/02/01
- 04/131: build/python: Add the installation bin directory to PATH., guix-commits, 2021/02/01
- 11/131: gnu: python-slugify: Add missing input., guix-commits, 2021/02/01
- 12/131: gnu: python-websockets: Fix Python package name., guix-commits, 2021/02/01
- 07/131: gnu: python-pytest-xdist: Add missing input, relax pytest requirement., guix-commits, 2021/02/01
- 06/131: build/python: Add a sanity check phase., guix-commits, 2021/02/01
- 19/131: gnu: python-traceback2: Add missing dependency., guix-commits, 2021/02/01
- 23/131: gnu: intel-xed: Adjust build phase., guix-commits, 2021/02/01
- 26/131: gnu: bamm: Update following changes to the Python build system., guix-commits, 2021/02/01
- 25/131: gnu: python-pysam: Adjust following Python build system changes., guix-commits, 2021/02/01
- 03/131: build/python: Always add the install prefix to the Guix PYTHONPATH.,
guix-commits <=
- 02/131: build/python: Replace PYTHONPATH by GUIX_PYTHONPATH., guix-commits, 2021/02/01
- 08/131: gnu: python-fixtures-bootstrap: Do not sanity check., guix-commits, 2021/02/01
- 10/131: gnu: python-pyfakefs: Disable unreliable test, guix-commits, 2021/02/01
- 17/131: gnu: python-automat: Remove broken console script., guix-commits, 2021/02/01
- 14/131: gnu: python-traitlets: Add missing input., guix-commits, 2021/02/01
- 20/131: gnu: python2-packaging-bootstrap: Add missing dependency, guix-commits, 2021/02/01
- 27/131: gnu: python-screed: Adjust following Python build system changes., guix-commits, 2021/02/01
- 28/131: gnu: python-scanpy: Do not set PYTHONPATH., guix-commits, 2021/02/01
- 18/131: gnu: python-packaging-bootstrap: Remove dependency., guix-commits, 2021/02/01
- 22/131: gnu: solaar: Do not read PYTHONPATH from environment., guix-commits, 2021/02/01