summaryrefslogtreecommitdiff
path: root/guix
diff options
context:
space:
mode:
authorCyril Roelandt <tipecaml@gmail.com>2013-05-23 03:38:43 +0200
committerCyril Roelandt <tipecaml@gmail.com>2013-05-28 22:53:35 +0200
commit842ded334fdf4019e04d08d2bd5a272327d256bf (patch)
tree4467a46a7e90d4ac8201bcd068695a74a224dbac /guix
parent9b222abe0349701280d48e4830f98aa07c947517 (diff)
downloadguix-patches-842ded334fdf4019e04d08d2bd5a272327d256bf.tar
guix-patches-842ded334fdf4019e04d08d2bd5a272327d256bf.tar.gz
python-build-system: add a check phase.
* guix/build/python-build-system.scm (check): New procedure. (%standard-phases): Use it.
Diffstat (limited to 'guix')
-rw-r--r--guix/build/python-build-system.scm16
1 files changed, 13 insertions, 3 deletions
diff --git a/guix/build/python-build-system.scm b/guix/build/python-build-system.scm
index b892c87fe9..84299798b0 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)