From mboxrd@z Thu Jan 1 00:00:00 1970 From: Cyril Roelandt Subject: [PATCH 1/3] python-build-system: add a check phase. Date: Thu, 23 May 2013 04:08:27 +0200 Message-ID: <1369274909-7297-2-git-send-email-tipecaml@gmail.com> References: <1369274909-7297-1-git-send-email-tipecaml@gmail.com> Return-path: Received: from eggs.gnu.org ([208.118.235.92]:39264) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UfL5E-00046C-B3 for bug-guix@gnu.org; Wed, 22 May 2013 22:16:53 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1UfL59-0004Al-ND for bug-guix@gnu.org; Wed, 22 May 2013 22:16:48 -0400 Received: from mail-wi0-x231.google.com ([2a00:1450:400c:c05::231]:38896) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UfL59-0004Ac-H1 for bug-guix@gnu.org; Wed, 22 May 2013 22:16:43 -0400 Received: by mail-wi0-f177.google.com with SMTP id hr14so1756714wib.16 for ; Wed, 22 May 2013 19:16:42 -0700 (PDT) In-Reply-To: <1369274909-7297-1-git-send-email-tipecaml@gmail.com> List-Id: Bug reports for GNU Guix List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-guix-bounces+gcggb-bug-guix=m.gmane.org@gnu.org Sender: bug-guix-bounces+gcggb-bug-guix=m.gmane.org@gnu.org To: bug-guix@gnu.org * 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