From mboxrd@z Thu Jan 1 00:00:00 1970 From: Ben Woodcroft Subject: [PATCH 03/10] gnu: Add python-pytest-pep8. Date: Thu, 21 Apr 2016 23:21:54 +1000 Message-ID: <1461244921-7412-4-git-send-email-donttrustben@gmail.com> References: <1461244921-7412-1-git-send-email-donttrustben@gmail.com> Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:40110) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1atEZ7-0001yR-F7 for Guix-devel@gnu.org; Thu, 21 Apr 2016 09:22:42 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1atEZ6-0004Ca-C9 for Guix-devel@gnu.org; Thu, 21 Apr 2016 09:22:41 -0400 Received: from mail-pa0-x242.google.com ([2607:f8b0:400e:c03::242]:32892) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1atEZ6-0004CG-53 for Guix-devel@gnu.org; Thu, 21 Apr 2016 09:22:40 -0400 Received: by mail-pa0-x242.google.com with SMTP id vv3so7223771pab.0 for ; Thu, 21 Apr 2016 06:22:39 -0700 (PDT) Received: from localhost.localdomain ([103.25.181.216]) by smtp.googlemail.com with ESMTPSA id m12sm1325947pfi.5.2016.04.21.06.22.36 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Thu, 21 Apr 2016 06:22:38 -0700 (PDT) In-Reply-To: <1461244921-7412-1-git-send-email-donttrustben@gmail.com> 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: Guix-devel@gnu.org * gnu/packages/python.scm (python-pytest-pep8, python2-pytest-pep8): New variables. --- gnu/packages/python.scm | 63 +++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 63 insertions(+) diff --git a/gnu/packages/python.scm b/gnu/packages/python.scm index 9c3a9fd..b5d1005 100644 --- a/gnu/packages/python.scm +++ b/gnu/packages/python.scm @@ -8717,6 +8717,69 @@ version of CPython that are not available in older releases.") (native-inputs `(("python2-setuptools" ,python2-setuptools)))))) +(define-public python-pytest-pep8 + (package + (name "python-pytest-pep8") + (version "1.0.6") + (source + (origin + (method url-fetch) + (uri (string-append + "https://pypi.python.org/packages/source/p/pytest-pep8/pytest-pep8-" + version + ".tar.gz")) + (sha256 + (base32 + "06032agzhw1i9d9qlhfblnl3dw5hcyxhagn7b120zhrszbjzfbh3")))) + (build-system python-build-system) + (arguments + `(#:phases + (modify-phases %standard-phases + (add-before 'build 'remove-failing-test + ;; Ignore the known test failure. + ;; https://bitbucket.org/pytest-dev/pytest-pep8/issues/8/test-failure + (lambda _ + (substitute* "test_pep8.py" + (("^def test_ok_verbose") "def dont_run")) + #t)) + (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")))))))) + (propagated-inputs + `(("python-pytest-cache", python-pytest-cache) + ("python-pytest" ,python-pytest) + ("python-pep8" ,python-pep8))) + (home-page "https://bitbucket.org/pytest-dev/pytest-pep8") + (synopsis "Pytest plugin to check PEP8 requirements") + (description + "Pytest-pep8 is a py.test plugin for efficiently checking compliance to +the PEP8 style guide. If you type @code{py.test --pep8} every file ending in +@code{.py} will be discovered and PEP8-checked, starting from the command line +arguments.") + (license license:expat) + (properties `((python2-variant . ,(delay python2-pytest-pep8)))))) + +(define-public python2-pytest-pep8 + (let ((base (package-with-python2 + (strip-python2-variant python-pytest-pep8)))) + (package + (inherit base) + (native-inputs + `(("python2-setuptools" ,python2-setuptools)))))) + (define-public python-cysignals (package (name "python-cysignals") -- 2.5.0