guix-commits
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

06/07: gnu: Add python-pylint.


From: Marius Bakke
Subject: 06/07: gnu: Add python-pylint.
Date: Sun, 19 Mar 2017 19:42:32 -0400 (EDT)

mbakke pushed a commit to branch master
in repository guix.

commit 315944a39334069e0c3cefdb131721ecbc6baa7d
Author: Arun Isaac <address@hidden>
Date:   Sun Mar 19 00:22:55 2017 +0530

    gnu: Add python-pylint.
    
    * gnu/packages/python.scm (python-pylint, python2-pylint): New variables.
    
    Signed-off-by: Marius Bakke <address@hidden>
---
 gnu/packages/python.scm | 59 +++++++++++++++++++++++++++++++++++++++++++++++++
 1 file changed, 59 insertions(+)

diff --git a/gnu/packages/python.scm b/gnu/packages/python.scm
index 2250061..e3a8242 100644
--- a/gnu/packages/python.scm
+++ b/gnu/packages/python.scm
@@ -13830,3 +13830,62 @@ in other versions.")
 unit tests and failing them if the unit test module does not excercise all
 statements in the module it tests.")
     (license license:gpl3+)))
+
+(define-public python-pylint
+  (package
+    (name "python-pylint")
+    (version "1.6.5")
+    (source
+     (origin
+       (method url-fetch)
+       (uri (string-append
+             "https://github.com/PyCQA/pylint/archive/pylint-";
+             version ".tar.gz"))
+       (sha256
+        (base32
+         "08pmgflmq2zrzrn9nkfadzwa5vybz46wvwxhrsd2mjlcgsh4rzbm"))))
+    (build-system python-build-system)
+    (native-inputs
+     `(("python-tox" ,python-tox)))
+    (propagated-inputs
+     `(("python-astroid" ,python-astroid)
+       ("python-isort" ,python-isort)
+       ("python-mccabe" ,python-mccabe)
+       ("python-six" ,python-six)))
+    (arguments
+     `(#:phases
+       (modify-phases %standard-phases
+         (replace 'check
+                  (lambda _
+                    ;; Somehow, tests for python2-pylint
+                    ;; fail if run from the build directory
+                    (let ((work "/tmp/work"))
+                      (mkdir-p work)
+                      (setenv "PYTHONPATH"
+                              (string-append (getenv "PYTHONPATH") ":" work))
+                      (copy-recursively "." work)
+                      (with-directory-excursion "/tmp"
+                        (zero? (system* "python" "-m" "unittest" "discover"
+                                        "-s" (string-append work 
"/pylint/test")
+                                        "-p" "*test_*.py")))))))))
+    (home-page "https://github.com/PyCQA/pylint";)
+    (synopsis "Python source code analyzer which looks for coding standard
+errors")
+    (description "Pylint is a Python source code analyzer which looks
+for programming errors, helps enforcing a coding standard and sniffs
+for some code smells (as defined in Martin Fowler's Refactoring book).
+
+Pylint has many rules enabled by default, way too much to silence them
+all on a minimally sized program.  It's highly configurable and handle
+pragmas to control it from within your code.  Additionally, it is
+possible to write plugins to add your own checks.")
+    (license license:gpl2+)))
+
+(define-public python2-pylint
+  (let ((pylint (package-with-python2 python-pylint)))
+    (package (inherit pylint)
+             (propagated-inputs
+              `(("python2-backports-functools-lru-cache"
+                 ,python2-backports-functools-lru-cache)
+                ("python2-configparser" ,python2-configparser)
+                ,@(package-propagated-inputs pylint))))))



reply via email to

[Prev in Thread] Current Thread [Next in Thread]