aboutsummaryrefslogtreecommitdiff
path: root/gnu/packages/python-check.scm
diff options
context:
space:
mode:
Diffstat (limited to 'gnu/packages/python-check.scm')
-rw-r--r--gnu/packages/python-check.scm128
1 files changed, 93 insertions, 35 deletions
diff --git a/gnu/packages/python-check.scm b/gnu/packages/python-check.scm
index a13bd0baa4..cb812762c9 100644
--- a/gnu/packages/python-check.scm
+++ b/gnu/packages/python-check.scm
@@ -1,7 +1,7 @@
;;; GNU Guix --- Functional package management for GNU
;;; Copyright © 2019 Ricardo Wurmus <rekado@elephly.net>
;;; Copyright © 2019, 2020 Tobias Geerinckx-Rice <me@tobias.gr>
-;;; Copyright © 2019, 2020 Efraim Flashner <efraim@flashner.co.il>
+;;; Copyright © 2019, 2020, 2021 Efraim Flashner <efraim@flashner.co.il>
;;; Copyright © 2019, 2020, 2021 Maxim Cournoyer <maxim.cournoyer@gmail.com>
;;; Copyright © 2019, 2021 Hartmut Goebel <h.goebel@crazy-compilers.com>
;;; Copyright © 2020 Julien Lepiller <julien@lepiller.eu>
@@ -503,7 +503,7 @@ sub-package.")
(add-installed-pythonpath inputs outputs)
(invoke "pytest" "-vv"))))))
(native-inputs
- `(("python-pytest" ,python-pytest-6)
+ `(("python-pytest" ,python-pytest)
("python-setuptools" ,python-setuptools) ; needs setuptools >= 50.3.2
("python-setuptools-scm" ,python-setuptools-scm)
("python-setuptools-declarative-requirements"
@@ -672,6 +672,7 @@ framework and makes it easy to undo any monkey patching. The fixtures are:
`(("python-pytest" ,python-pytest)))
(propagated-inputs
`(("python-matplotlib" ,python-matplotlib)
+ ("python-nose" ,python-nose)
("python-pillow" ,python-pillow)))
(home-page "https://github.com/matplotlib/pytest-mpl")
(synopsis "Pytest plugin to help with testing figures output from Matplotlib")
@@ -748,20 +749,21 @@ in Pytest.")
(define-public python-pytest-checkdocs
(package
(name "python-pytest-checkdocs")
- (version "1.2.2")
+ (version "1.2.5")
(source
(origin
(method url-fetch)
(uri (pypi-uri "pytest-checkdocs" version))
(sha256
- (base32 "0j6j1gvj6x451y3qsx4xbaq9p1w9gg3mwk7n0w80cy8vdyjkngb0"))))
+ (base32 "0m4kn7141i6k8qr8ak3lbmk9vim11xsrlnrggcfwczfrglc6jmia"))))
(build-system python-build-system)
(propagated-inputs
`(("python-docutils" ,python-docutils)
("python-importlib-metadata" ,python-importlib-metadata)
("python-more-itertools" ,python-more-itertools)))
(native-inputs
- `(("python-setuptools-scm" ,python-setuptools-scm)))
+ `(("python-setuptools-scm" ,python-setuptools-scm)
+ ("python-pytest" ,python-pytest)))
(home-page "https://github.com/jaraco/pytest-checkdocs")
(synopsis "Check the README when running tests")
(description
@@ -806,28 +808,35 @@ simpler.")
(define-public python-pytest-trio
(package
(name "python-pytest-trio")
- (version "0.6.0")
+ (version "0.7.0")
(source
(origin
(method url-fetch)
(uri (pypi-uri "pytest-trio" version))
(sha256
- (base32 "1zm8didm9h5jkqhghl9bvqs7kr7sjci282c7grhk6yhpzn8a9w4v"))))
+ (base32 "0c8cqf9by2884riksrqymqfp2g1d2d798a2zalcw9hmf34c786y0"))))
(build-system python-build-system)
(arguments
`(#:phases
(modify-phases %standard-phases
(replace 'check
- (lambda* (#:key inputs outputs #:allow-other-keys)
- (add-installed-pythonpath inputs outputs)
- (invoke "pytest" "-W" "error" "-ra" "-v" "--pyargs"
- "pytest_trio" "--verbose" "--cov"))))))
+ (lambda* (#:key tests? inputs outputs #:allow-other-keys)
+ (when tests?
+ (add-installed-pythonpath inputs outputs)
+ (invoke "pytest" "-W" "error" "-ra" "-v" "--pyargs"
+ "pytest_trio" "--verbose" "--cov" "-k"
+ (string-append
+ ;; Needs network
+ "not test_async_yield_fixture_with_nursery"
+ " and not test_try"
+ ;; No keyboard interrupt in our build environment.
+ " and not test_actual_test"))))))))
(native-inputs
`(("python-hypothesis" ,python-hypothesis)
("python-pytest" ,python-pytest)
("python-pytest-cov" ,python-pytest-cov)))
(propagated-inputs
- `(("python-trio" ,python-trio)))
+ (list python-async-generator python-outcome python-pytest python-trio))
(home-page "https://github.com/python-trio/pytest-trio")
(synopsis "Pytest plugin for trio")
(description
@@ -862,26 +871,26 @@ compliance.")
(define-public python-pytest-isort
(package
(name "python-pytest-isort")
- (version "0.3.1")
+ (version "2.0.0")
(source
(origin
(method url-fetch)
(uri (pypi-uri "pytest-isort" version))
(sha256
- (base32 "06myn5hhxs5yp8dqr1yjsgcnnxnsrvsqannm00bvaw0qml6ydzjb"))))
+ (base32 "05wi28zlqk3jafpjal8j523y5jcsx3xl3id9rx93qfjgkif8q6l2"))))
(build-system python-build-system)
(arguments
`(#:phases
(modify-phases %standard-phases
(replace 'check
- (lambda _
- (setenv "PYTHONPATH"
- (string-append (getcwd) ":"
- (getenv "PYTHONPATH")))
- (invoke "pytest"))))))
+ (lambda* (#:key tests? #:allow-other-keys)
+ (when tests?
+ (invoke "pytest")))))))
(propagated-inputs
`(("python-isort" ,python-isort)
("python-pytest" ,python-pytest)))
+ (native-inputs
+ `(("python-mock" ,python-mock)))
(home-page "https://github.com/moccu/pytest-isort/")
(synopsis "Pytest plugin to check import ordering using isort")
(description
@@ -1120,23 +1129,17 @@ service processes for your tests with pytest.")
'(#:phases
(modify-phases %standard-phases
(replace 'check
- (lambda* (#:key inputs outputs #:allow-other-keys)
- ;; Make the installed plugin discoverable by Pytest.
- (add-installed-pythonpath inputs outputs)
- (invoke "pytest" "-vv"))))))
+ (lambda* (#:key tests? inputs outputs #:allow-other-keys)
+ (when tests?
+ (substitute* "setup.cfg"
+ ((".*timeout.*") ""))
+ ;; Make the installed plugin discoverable by Pytest.
+ (add-installed-pythonpath inputs outputs)
+ (invoke "pytest" "-vv")))))))
(native-inputs
- `(("python-coverage" ,python-coverage)
- ("python-docutils" ,python-docutils)
- ("python-flake8" ,python-flake8)
- ("python-isort" ,python-isort)
- ("python-pydantic" ,python-pydantic)
- ("python-pyflakes" ,python-pyflakes)
- ("python-pygments" ,python-pygments)
+ `(("python-pydantic" ,python-pydantic)
("python-pytest" ,python-pytest)
- ("python-pytest-cov" ,python-pytest-cov)
- ("python-pytest-isort" ,python-pytest-isort)
- ("python-pytest-mock" ,python-pytest-mock)
- ("python-pytest-sugar" ,python-pytest-sugar)))
+ ("python-pytest-isort" ,python-pytest-isort)))
(home-page "https://github.com/samuelcolvin/pytest-toolbox")
(synopsis "Numerous useful plugins for Pytest")
(description
@@ -1544,7 +1547,7 @@ supported by the MyPy typechecker.")
("python-importlib-metadata" ,python-importlib-metadata)
("python-lxml" ,python-lxml)
("python-psutil" ,python-psutil)
- ("python-pytest" ,python-pytest-6)
+ ("python-pytest" ,python-pytest)
("python-pytest-cov" ,python-pytest-cov)
("python-pytest-forked" ,python-pytest-forked)
("python-pytest-xdist" ,python-pytest-xdist)
@@ -1566,6 +1569,61 @@ any Python VM with basically no runtime overhead.")
;; mypyc/lib-rt/getargs.c
(license (list license:expat license:psfl))))
+;;; This variant exists to break a cycle between python-pylama and python-isort.
+(define-public python-mypy-minimal
+ (hidden-package
+ (package
+ (inherit python-mypy)
+ (name "python-mypy-minimal")
+ (arguments
+ `(#:tests? #f
+ #:phases (modify-phases %standard-phases
+ ;; XXX: Fails with: "In procedure utime: No such file or
+ ;; directory".
+ (delete 'ensure-no-mtimes-pre-1980))))
+ (native-inputs '()))))
+
+(define-public python-pylama
+ (package
+ (name "python-pylama")
+ (version "7.7.1")
+ (source
+ (origin
+ (method url-fetch)
+ (uri (pypi-uri "pylama" version))
+ (sha256
+ (base32
+ "13vx7daqz2918y9s8q3v2i3xaq3ah43a9p58srqi6hqskkpm7blv"))))
+ (build-system python-build-system)
+ (arguments
+ `(#:phases (modify-phases %standard-phases
+ (add-after 'unpack 'disable-failing-tests
+ (lambda _
+ ;; Fails with: "ImportError: cannot import name
+ ;; 'commented_out_code_line_numbers' from 'eradicate'".
+ (delete-file "pylama/lint/pylama_eradicate.py")
+ ;; Requires python-astroid, which fails to build on
+ ;; Python 3.9+ (see:
+ ;; https://github.com/PyCQA/astroid/issues/881).
+ (delete-file "pylama/lint/pylama_pylint.py"))))))
+ (native-inputs
+ `(("python-py" ,python-py)
+ ("python-pytest" ,python-pytest)
+ ("python-radon" ,python-radon)))
+ (propagated-inputs
+ `(("python-mccabe" ,python-mccabe)
+ ("python-mypy", python-mypy-minimal)
+ ("python-pycodestyle" ,python-pycodestyle)
+ ("python-pydocstyle" ,python-pydocstyle)
+ ("python-pyflakes" ,python-pyflakes)))
+ (home-page "https://github.com/klen/pylama")
+ (synopsis "Code audit tool for python")
+ (description "Pylama is a code audit tool for Python and JavaScript to check
+for style, syntax and other code health metrics. It is essentially a
+convenient wrapper above tools such as Pyflakes, pydocstyle, pycodestyle and
+McCabe, among others.")
+ (license license:lgpl3+)))
+
(define-public python-pyannotate
(package
(name "python-pyannotate")