Patchwork [2/3] gnu: Add python-pytest-flakes.

login
register
mail settings
Submitter Marius Bakke
Date Sept. 11, 2016, 2:07 p.m.
Message ID <20160911140737.24248-2-mbakke@fastmail.com>
Download mbox | patch
Permalink /patch/15505/
State New
Headers show

Comments

Marius Bakke - Sept. 11, 2016, 2:07 p.m.
* gnu/packages/python.scm (python-pytest-flakes, python2-pytest-flakes):
  New variables.
---
 gnu/packages/python.scm | 42 ++++++++++++++++++++++++++++++++++++++++++
 1 file changed, 42 insertions(+)
Leo Famulari - Sept. 14, 2016, 9:42 p.m.
On Sun, Sep 11, 2016 at 03:07:36PM +0100, Marius Bakke wrote:
> * gnu/packages/python.scm (python-pytest-flakes, python2-pytest-flakes):
>   New variables.

> +    (description "Pytest plugin for efficiently checking python source
> +with pyflakes.")

I have the same question about removing "efficiently" as about
python-pytest-pep8.

Patch

diff --git a/gnu/packages/python.scm b/gnu/packages/python.scm
index 21eda38..bd70cb6 100644
--- a/gnu/packages/python.scm
+++ b/gnu/packages/python.scm
@@ -10360,3 +10360,45 @@  Python to manipulate OpenDocument 1.2 files.")
              (native-inputs
               `(("python2-setuptools" ,python2-setuptools)
                 ,@(package-native-inputs base))))))
+
+(define-public python-pytest-flakes
+  (package
+    (name "python-pytest-flakes")
+    (version "1.0.1")
+    (source (origin
+              (method url-fetch)
+              (uri (pypi-uri "pytest-flakes" version))
+              (sha256
+               (base32
+                "0flag3n33kbhyjrhzmq990rvg4yb8hhhl0i48q9hw0ll89jp28lw"))))
+    (build-system python-build-system)
+    (arguments
+     `(;; Prevent creation of the egg. This works around
+       ;; https://debbugs.gnu.org/cgi/bugreport.cgi?bug=20765 .
+       #:configure-flags '("--single-version-externally-managed" "--root=/")
+       #:phases
+       (modify-phases %standard-phases
+         (delete 'check)
+         (add-after 'install 'check
+           (lambda _ ; It's easier to run tests after install.
+             (zero? (system* "py.test" "-vv")))))))
+    (native-inputs
+     `(("python-coverage" ,python-coverage)
+       ("python-pytest" ,python-pytest)
+       ("python-pytest-cache" ,python-pytest-cache)
+       ("python-pytest-pep8" ,python-pytest-pep8)))
+    (propagated-inputs
+     `(("python-pyflakes" ,python-pyflakes)))
+    (home-page "https://github.com/fschulze/pytest-flakes")
+    (synopsis "Py.test plugin to check source code with pyflakes")
+    (description "Pytest plugin for efficiently checking python source
+with pyflakes.")
+    (license license:expat)
+    (properties `((python2-variant . ,(delay python2-pytest-flakes))))))
+
+(define-public python2-pytest-flakes
+  (let ((base (package-with-python2 (strip-python2-variant python-pytest-flakes))))
+    (package (inherit base)
+             (native-inputs
+              `(("python2-setuptools" ,python2-setuptools)
+                ,@(package-native-inputs base))))))