[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
06/163: build/python: Add the installation bin directory to PATH.
From: |
guix-commits |
Subject: |
06/163: build/python: Add the installation bin directory to PATH. |
Date: |
Mon, 25 Jan 2021 02:01:14 -0500 (EST) |
apteryx pushed a commit to branch cu/farewell-to-pythonpath
in repository guix.
commit 119e30a4620940be3dfba49d3e84123786f16228
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 ca2e08f..19bd3c9 100644
--- a/guix/build/python-build-system.scm
+++ b/guix/build/python-build-system.scm
@@ -195,6 +195,12 @@ useful when running checks after installing the package."
"This adds the installed site-packages directory to the Guix PYTHONPATH."
(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."
@@ -312,6 +318,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)
- 73/163: gnu: itstool: Wrap with the new Guix PYTHONPATH., (continued)
- 73/163: gnu: itstool: Wrap with the new Guix PYTHONPATH., guix-commits, 2021/01/25
- 86/163: gnu: mpdris2: Wrap with the new Guix PYTHONPATH., guix-commits, 2021/01/25
- 94/163: gnu: python-pure-protobuf: Do not alter PYTHONPATH., guix-commits, 2021/01/25
- 113/163: gnu: authenticator: Wrap with the new Guix PYTHONPATH., guix-commits, 2021/01/25
- 108/163: gnu: eolie: Wrap with the new Guix PYTHONPATH., guix-commits, 2021/01/25
- 92/163: gnu: fenics: Do not alter PYTHONPATH., guix-commits, 2021/01/25
- 100/163: gnu: patchwork: Wrap with the new Guix PYTHONPATH., guix-commits, 2021/01/25
- 125/163: gnu: python-pymediainfo: Do not set PYTHONPATH., guix-commits, 2021/01/25
- 120/163: gnu: python-attrs: Do not set PYTHONPATH., guix-commits, 2021/01/25
- 132/163: gnu: python-jinja2: Do not set PYTHONPATH., guix-commits, 2021/01/25
- 06/163: build/python: Add the installation bin directory to PATH.,
guix-commits <=
- 13/163: gnu: carla: Adjust wrap phase., guix-commits, 2021/01/25
- 16/163: gnu: python-pysam: Adjust following Python build system changes., guix-commits, 2021/01/25
- 38/163: gnu: git-imerge: Wrap with the new Guix PYTHONPATH., guix-commits, 2021/01/25
- 36/163: gnu: cgit: Wrap with the new Guix PYTHONPATH., guix-commits, 2021/01/25
- 50/163: gnu: econnman: Wrap with the new Guix PYTHONPATH., guix-commits, 2021/01/25
- 32/163: gnu: behave: Do not set PYTHONPATH., guix-commits, 2021/01/25
- 53/163: gnu: ibus-libpinyin: Wrap with the new Guix PYTHONPATH., guix-commits, 2021/01/25
- 02/163: gnu: python: Replace PYTHONPATH by GUIX_PYTHONPATH_X_Y., guix-commits, 2021/01/25
- 122/163: gnu: python-stone: Do not set PYTHONPATH., guix-commits, 2021/01/25
- 143/163: gnu: python-binwalk: Do not set PYTHONPATH., guix-commits, 2021/01/25