diff options
author | Nicolas Graves <ngraves@ngraves.fr> | 2025-07-07 13:11:51 +0200 |
---|---|---|
committer | Sharlatan Hellseher <sharlatanus@gmail.com> | 2025-07-08 12:09:34 +0100 |
commit | 4557e8f58174e9d21bbeeafca615fb9e23618274 (patch) | |
tree | a41f051e1aca81ba93359feb1ef1a38b94bcd73b /guix | |
parent | 6ab6ba14f8522794342fcd34779cf8a2fadb11cb (diff) |
build-system/pyproject: Export default-sanity-check.py.
There is currently no convenient way to inject our sanity-check.py
script in the inputs of a project that extends another build-system
with pyproject components. Thus we usually don't run sanity-check for
such cases (it's only python build and install).
This patch improves a bit this issue by exposing our script. Since it
doesn't change derivations, this doesn't lead to rebuilds and can be
merged in master.
* guix/build-system/pyproject.scm
(sanity-check.py): Replace variable by...
(default-sanity-check.py): Add exported procedure replacing and
extending former sanity-check.py.
(lower)[sanity-check.py]: Add and use argument.
Change-Id: I422d3d2d53b59548099d381feae9b956f5e2e07a
Signed-off-by: Sharlatan Hellseher <sharlatanus@gmail.com>
Diffstat (limited to 'guix')
-rw-r--r-- | guix/build-system/pyproject.scm | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/guix/build-system/pyproject.scm b/guix/build-system/pyproject.scm index bdf8f440ac..4ad4dc79a1 100644 --- a/guix/build-system/pyproject.scm +++ b/guix/build-system/pyproject.scm @@ -32,6 +32,7 @@ #:use-module (srfi srfi-1) #:export (%pyproject-build-system-modules default-python + default-sanity-check.py pyproject-build pyproject-build-system)) @@ -60,17 +61,20 @@ ;; Using python-toolchain here might cause dependency cycles. (module-ref python 'python-sans-pip-wrapper))) -(define sanity-check.py - (search-auxiliary-file "python/sanity-check.py")) +;; TODO: On the next iteration of python-team, migrate the sanity-check to +;; importlib_metadata instead of setuptools. +(define (default-sanity-check.py) + (local-file (search-auxiliary-file "python/sanity-check.py"))) (define* (lower name #:key source inputs native-inputs outputs system target (python (default-python)) + (sanity-check.py (default-sanity-check.py)) #:allow-other-keys #:rest arguments) "Return a bag for NAME." (define private-keywords - '(#:target #:python #:inputs #:native-inputs)) + '(#:target #:python #:inputs #:native-inputs #:sanity-check.py)) (and (not target) ;XXX: no cross-compilation (bag @@ -84,7 +88,7 @@ ;; Keep the standard inputs of 'gnu-build-system'. ,@(standard-packages))) (build-inputs `(("python" ,python) - ("sanity-check.py" ,(local-file sanity-check.py)) + ("sanity-check.py" ,sanity-check.py) ,@native-inputs)) (outputs (append outputs '(wheel))) (build pyproject-build) |