diff options
author | Nicolas Graves <ngraves@ngraves.fr> | 2024-04-20 16:11:00 +0200 |
---|---|---|
committer | Guix Patches Tester <> | 2024-04-20 17:15:49 +0200 |
commit | 36d90122a615495773dc357e0e71adb21c151c32 (patch) | |
tree | d5ec712cac63657add0169e76626b1b520716594 | |
parent | 8600726d388da2c1e20820c8835953d6844a0d87 (diff) | |
download | guix-patches-issue-70482.tar guix-patches-issue-70482.tar.gz |
guix: pyproject-build-system: Add python test-backend.issue-70482
* guix/build/pyproject-build-system(check): Add python test-backend.
This will help in cases where a simple `python -m module args` call has
to be made instead of fully replacing the 'check phase, e.g. unittest
or django. This is never enabled unless #:test-backend 'python is set,
so it doesn't break anything.
As an example, the following snippet...
(arguments
(list #:phases #~(modify-phases %standard-phases
(replace 'check
(lambda* (#:key tests? #:allow-other-keys)
(when tests?
(invoke "python" "-m" "unittest"
"diff_match_patch.tests")))))))
...can be transformed like this:
(arguments
'(#:test-backend 'python
#:test-flags (list "-m" "unittest" "diff_match_patch.tests")))
Change-Id: I4919a3e01d64864e3c328609fbcce7df5b3dfe51
-rw-r--r-- | guix/build/pyproject-build-system.scm | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/guix/build/pyproject-build-system.scm b/guix/build/pyproject-build-system.scm index c69ccc9d64..295542f317 100644 --- a/guix/build/pyproject-build-system.scm +++ b/guix/build/pyproject-build-system.scm @@ -168,6 +168,8 @@ builder.build_wheel(sys.argv[2], config_settings=config_settings)" (if (null? test-flags) '("test" "-v") test-flags))) + ('python + (apply invoke "python" test-flags)) ;; The developer should explicitly disable tests in this case. (else (raise (condition (&test-system-not-found)))))) (format #t "test suite not run~%"))) |