[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH 1/3] python-build-system: add a check phase.
From: |
Cyril Roelandt |
Subject: |
[PATCH 1/3] python-build-system: add a check phase. |
Date: |
Thu, 23 May 2013 04:08:27 +0200 |
* guix/build/python-build-system.scm: new function.
---
guix/build/python-build-system.scm | 16 +++++++++++++---
1 file changed, 13 insertions(+), 3 deletions(-)
diff --git a/guix/build/python-build-system.scm
b/guix/build/python-build-system.scm
index b892c87..8429979 100644
--- a/guix/build/python-build-system.scm
+++ b/guix/build/python-build-system.scm
@@ -45,6 +45,14 @@
(zero? (apply system* "python" args)))
(error "no setup.py found"))))
+(define* (check #:key outputs #:allow-other-keys)
+ "Run the test suite of a given Python package."
+ (if (file-exists? "setup.py")
+ (let ((args `("setup.py" "check")))
+ (format #t "running 'python' with arguments ~s~%" args)
+ (zero? (apply system* "python" args)))
+ (error "no setup.py found")))
+
(define* (wrap #:key outputs python-version #:allow-other-keys)
(define (list-of-files dir)
(map (cut string-append dir "/" <>)
@@ -78,10 +86,12 @@
(alist-cons-after
'install 'wrap
wrap
- (alist-replace 'install install
- (alist-delete 'configure
+ (alist-replace
+ 'check check
+ (alist-replace 'install install
+ (alist-delete 'configure
(alist-delete 'build
- gnu:%standard-phases)))))
+ gnu:%standard-phases))))))
(define* (python-build #:key inputs (phases %standard-phases)
#:allow-other-keys #:rest args)
--
1.7.10.4