From 782e3b1f71befb60022d8be0f3424ecb0d905ed2 Mon Sep 17 00:00:00 2001 From: Ryan Sundberg Date: Sat, 8 May 2021 22:37:25 -0700 Subject: [PATCH 34/55] python-pylama: new package --- .../patches/python-pylama-eradicate.patch | 32 ++++++++++++++++++ gnu/packages/python-xyz.scm | 33 +++++++++++++++++++ 2 files changed, 65 insertions(+) create mode 100644 gnu/packages/patches/python-pylama-eradicate.patch diff --git a/gnu/packages/patches/python-pylama-eradicate.patch b/gnu/packages/patches/python-pylama-eradicate.patch new file mode 100644 index 0000000000..33bfcee324 --- /dev/null +++ b/gnu/packages/patches/python-pylama-eradicate.patch @@ -0,0 +1,32 @@ +diff --git a/pylama/lint/pylama_eradicate.py b/pylama/lint/pylama_eradicate.py +index 3a00425..645eaaf 100644 +--- a/pylama/lint/pylama_eradicate.py ++++ b/pylama/lint/pylama_eradicate.py +@@ -1,5 +1,5 @@ + """Commented-out code checking.""" +-from eradicate import commented_out_code_line_numbers ++from eradicate import Eradicator + from pylama.lint import Linter as Abstract + + try: +@@ -19,7 +19,7 @@ class Linter(Abstract): + :return list: List of errors. + """ + code = converter(code) +- line_numbers = commented_out_code_line_numbers(code) ++ line_numbers = Eradicator().commented_out_code_line_numbers(code) + lines = code.split('\n') + + result = [] +diff --git a/requirements-test.txt b/requirements-test.txt +index f9ce65b..c84248e 100644 +--- a/requirements-test.txt ++++ b/requirements-test.txt +@@ -2,6 +2,6 @@ + + ipdb + pytest +-eradicate >= 1.0 ++eradicate >= 2.0 + radon >= 1.4.2 + mypy ; python_version >= '3.5' diff --git a/gnu/packages/python-xyz.scm b/gnu/packages/python-xyz.scm index d0d67a0184..f27c6170f5 100644 --- a/gnu/packages/python-xyz.scm +++ b/gnu/packages/python-xyz.scm @@ -505,6 +505,39 @@ threads.") task of adding retry behavior to just about anything.") (license license:asl2.0))) +(define-public python-pylama + (package + (name "python-pylama") + (version "7.7.1") + (source + (origin + (method git-fetch) + (uri (git-reference + (url "https://github.com/klen/pylama.git") + (commit version))) + (sha256 + (base32 + "1hza43s8b3znq2vcihyvsyw6j19lm42rjn87i056j8kgrmkfil8w")) + (patches (search-patches "python-pylama-eradicate.patch")))) + (build-system python-build-system) + (native-inputs + `(("python-pytest" ,python-pytest))) + (propagated-inputs + `(("python-astroid" ,python-astroid) + ("python-eradicate" ,python-eradicate) + ("python-mccabe" ,python-mccabe) + ("python-mypy" ,python-mypy) + ("python-pycodestyle" ,python-pycodestyle) + ("python-pydocstyle" ,python-pydocstyle) + ("python-pylint", python-pylint) + ("python-pyflakes" ,python-pyflakes) + ("python-radon" ,python-radon))) + (home-page "https://pylama.readthedocs.io/") + (synopsis "pylama -- Code audit tool for python") + (description + "pylama -- Code audit tool for python") + (license license:lgpl3))) + (define-public python-pytelegrambotapi (package (name "python-pytelegrambotapi") -- 2.31.1