[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
04/131: build/python: Add the installation bin directory to PATH.
From: |
guix-commits |
Subject: |
04/131: build/python: Add the installation bin directory to PATH. |
Date: |
Mon, 1 Feb 2021 11:56:30 -0500 (EST) |
apteryx pushed a commit to branch core-updates
in repository guix.
commit 15dcffecf2293c86d81186a6e3a29e25b00420aa
Author: Maxim Cournoyer <maxim.cournoyer@gmail.com>
AuthorDate: Fri Jan 22 11:48:42 2021 -0500
build/python: Add the installation bin directory to PATH.
This also to reduce the need for boilerplate code found in check phase
overrides.
* guix/build/python-build-system.scm (add-install-to-path): New phase.
(%standard-phases): Order it before the check phase.
---
guix/build/python-build-system.scm | 7 +++++++
1 file changed, 7 insertions(+)
diff --git a/guix/build/python-build-system.scm
b/guix/build/python-build-system.scm
index 9f5fad7..c73f6b0 100644
--- a/guix/build/python-build-system.scm
+++ b/guix/build/python-build-system.scm
@@ -179,6 +179,12 @@ running checks after installing the package."
"A phase that just wraps the 'add-installed-pythonpath' procedure."
(add-installed-pythonpath inputs outputs))
+(define* (add-install-to-path #:key outputs #:allow-other-keys)
+ "Adding Python scripts to PATH is also often useful in tests."
+ (setenv "PATH" (string-append (assoc-ref outputs "out")
+ "/bin:"
+ (getenv "PATH"))))
+
(define* (install #:key inputs outputs (configure-flags '()) use-setuptools?
#:allow-other-keys)
"Install a given Python package."
@@ -296,6 +302,7 @@ by Cython."
(add-after 'install 'check check)
(add-after 'install 'wrap wrap)
(add-before 'check 'add-install-to-pythonpath add-install-to-pythonpath)
+ (add-before 'check 'add-install-to-path add-install-to-path)
(add-before 'strip 'rename-pth-file rename-pth-file)))
(define* (python-build #:key inputs (phases %standard-phases)
- branch core-updates updated (6a4b336 -> 1b91868), guix-commits, 2021/02/01
- 01/131: gnu: python: Replace PYTHONPATH by GUIX_PYTHONPATH., guix-commits, 2021/02/01
- 05/131: build/python: Adjust wrap phase to use the new GUIX_PYTHONPATH., guix-commits, 2021/02/01
- 09/131: gnu: python-pytest-pep8: Fix package., guix-commits, 2021/02/01
- 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 <=
- 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, 2021/02/01
- 02/131: build/python: Replace PYTHONPATH by GUIX_PYTHONPATH., guix-commits, 2021/02/01