From 315944a39334069e0c3cefdb131721ecbc6baa7d Mon Sep 17 00:00:00 2001 From: Arun Isaac Date: Sun, 19 Mar 2017 00:22:55 +0530 Subject: gnu: Add python-pylint. * gnu/packages/python.scm (python-pylint, python2-pylint): New variables. Signed-off-by: Marius Bakke --- gnu/packages/python.scm | 59 +++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 59 insertions(+) (limited to 'gnu') diff --git a/gnu/packages/python.scm b/gnu/packages/python.scm index 2250061de3..e3a82422de 100644 --- a/gnu/packages/python.scm +++ b/gnu/packages/python.scm @@ -13830,3 +13830,62 @@ (define-public python2-coverage-test-runner 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)))))) -- cgit v1.2.3