From mboxrd@z Thu Jan 1 00:00:00 1970 From: Ben Woodcroft Subject: Re: [PATCH 03/10] gnu: Add python-pytest-pep8. Date: Sun, 24 Apr 2016 23:21:23 +1000 Message-ID: <571CC853.30305@gmail.com> References: <1461244921-7412-1-git-send-email-donttrustben@gmail.com> <1461244921-7412-4-git-send-email-donttrustben@gmail.com> <57191B48.1060401@goebel-consult.de> Mime-Version: 1.0 Content-Type: multipart/alternative; boundary="------------040507040809010201080907" Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:37742) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1auJyg-0000KW-Es for guix-devel@gnu.org; Sun, 24 Apr 2016 09:21:35 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1auJyb-0002YQ-EO for guix-devel@gnu.org; Sun, 24 Apr 2016 09:21:34 -0400 Received: from mail-pa0-x243.google.com ([2607:f8b0:400e:c03::243]:36741) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1auJyb-0002YE-3l for guix-devel@gnu.org; Sun, 24 Apr 2016 09:21:29 -0400 Received: by mail-pa0-x243.google.com with SMTP id i5so12973508pag.3 for ; Sun, 24 Apr 2016 06:21:28 -0700 (PDT) In-Reply-To: <57191B48.1060401@goebel-consult.de> List-Id: "Development of GNU Guix and the GNU System distribution." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-devel-bounces+gcggd-guix-devel=m.gmane.org@gnu.org Sender: "Guix-devel" To: Hartmut Goebel , guix-devel@gnu.org This is a multi-part message in MIME format. --------------040507040809010201080907 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit On 22/04/16 04:26, Hartmut Goebel wrote: > Am 21.04.2016 um 15:21 schrieb Ben Woodcroft: >> + (add-after 'install 'post-install-check >> + ;; 'setup.py test' does not run tests >> + (lambda* (#:key inputs outputs #:allow-other-keys) >> + (let ((out (assoc-ref outputs "out"))) >> + (setenv "PYTHONPATH" >> + (string-append >> + (getenv "PYTHONPATH") >> + ":" >> + out >> + "/lib/python" >> + (string-take (string-take-right >> + (assoc-ref inputs "python") 5) 3) >> + "/site-packages")) >> + (zero? >> + (system* >> + (string-append out "/bin/py.test") "test_pep8.py")))))))) > > Have you tried if the tests are run when moving the test-file into a > new subdirectory "tests/"? This would result in much less code. I'm afraid not. I'm no pythonista, but these tests are written for pytest, not in the more vanilla unittest which setup.py expects, I think. I tested moving it to tests out as you suggest, to no avail. Thanks, ben --------------040507040809010201080907 Content-Type: text/html; charset=utf-8 Content-Transfer-Encoding: 7bit

On 22/04/16 04:26, Hartmut Goebel wrote:
Am 21.04.2016 um 15:21 schrieb Ben Woodcroft:
+         (add-after 'install 'post-install-check
+           ;; 'setup.py test' does not run tests
+           (lambda* (#:key inputs outputs #:allow-other-keys)
+             (let ((out (assoc-ref outputs "out")))
+               (setenv "PYTHONPATH"
+                       (string-append
+                        (getenv "PYTHONPATH")
+                        ":"
+                        out
+                        "/lib/python"
+                        (string-take (string-take-right
+                                      (assoc-ref inputs "python") 5) 3)
+                        "/site-packages"))
+               (zero?
+                (system*
+                 (string-append out "/bin/py.test") "test_pep8.py"))))))))

Have you tried if the tests are run when moving the test-file into a new subdirectory "tests/"? This would result in much less code.

I'm afraid not. I'm no pythonista, but these tests are written for pytest, not in the more vanilla unittest which setup.py expects, I think. I tested moving it to tests out as you suggest, to no avail.

Thanks,
ben
--------------040507040809010201080907--