1 ;;; GNU Guix --- Functional package management for GNU
2 ;;; Copyright © 2019 Ricardo Wurmus <rekado@elephly.net>
3 ;;; Copyright © 2019, 2020 Tobias Geerinckx-Rice <me@tobias.gr>
4 ;;; Copyright © 2019, 2020 Efraim Flashner <efraim@flashner.co.il>
5 ;;; Copyright © 2019, 2020, 2021 Maxim Cournoyer <maxim.cournoyer@gmail.com>
6 ;;; Copyright © 2019 Hartmut Goebel <h.goebel@crazy-compilers.com>
7 ;;; Copyright © 2020 Julien Lepiller <julien@lepiller.eu>
8 ;;; Copyright © 2020 Marius Bakke <mbakke@fastmail.com>
9 ;;; Copyright © 2020 Edouard Klein <edk@beaver-labs.com>
10 ;;; Copyright © 2020 Vinicius Monego <monego@posteo.net>
11 ;;; Copyright © 2020 Tanguy Le Carrour <tanguy@bioneland.org>
12 ;;; Copyright © 2021 Sharlatan Hellseher <sharlatanus@gmail.com>
14 ;;; This file is part of GNU Guix.
16 ;;; GNU Guix is free software; you can redistribute it and/or modify it
17 ;;; under the terms of the GNU General Public License as published by
18 ;;; the Free Software Foundation; either version 3 of the License, or (at
19 ;;; your option) any later version.
21 ;;; GNU Guix is distributed in the hope that it will be useful, but
22 ;;; WITHOUT ANY WARRANTY; without even the implied warranty of
23 ;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
24 ;;; GNU General Public License for more details.
26 ;;; You should have received a copy of the GNU General Public License
27 ;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>.
29 (define-module (gnu packages python-check)
30 #:use-module (gnu packages)
31 #:use-module (gnu packages check)
32 #:use-module (gnu packages openstack)
33 #:use-module (gnu packages python-web)
34 #:use-module (gnu packages python-xyz)
35 #:use-module (gnu packages web)
36 #:use-module (gnu packages xml)
37 #:use-module (guix utils)
38 #:use-module ((guix licenses) #:prefix license:)
39 #:use-module (guix packages)
40 #:use-module (guix git-download)
41 #:use-module (guix download)
42 #:use-module (guix build-system python))
44 (define-public python-coveralls
46 (name "python-coveralls")
48 (home-page "https://github.com/coveralls-clients/coveralls-python")
51 ;; The PyPI release lacks tests, so we pull from git instead.
53 (uri (git-reference (url home-page) (commit version)))
54 (file-name (git-file-name name version))
57 "1zr1lqdjcfwj6wcx2449mzzjq8bbhwnqcm5vdif5s8hlz35bjxkp"))))
58 (build-system python-build-system)
60 '(#:phases (modify-phases %standard-phases
61 (add-before 'check 'disable-git-test
63 ;; Remove test that requires 'git' and the full checkout.
64 (delete-file "tests/git_test.py")
67 (lambda* (#:key tests? #:allow-other-keys)
69 (invoke "pytest" "-vv")
70 (format #t "test suite not run~%"))
73 `(("python-coverage" ,python-coverage)
74 ("python-docopt" ,python-docopt)
75 ("python-pyyaml" ,python-pyyaml)
76 ("python-requests" ,python-requests)))
78 `(("python-mock" ,python-mock)
79 ("python-pytest" ,python-pytest)))
80 (synopsis "Show coverage stats online via coveralls.io")
82 "Coveralls.io is a service for publishing code coverage statistics online.
83 This package provides seamless integration with coverage.py (and thus pytest,
84 nosetests, etc...) in Python projects.")
85 (license license:expat)))
87 (define-public python-junit-xml
88 ;; XXX: There are no tags or PyPI releases, so take the latest commit
89 ;; and use the version defined in setup.py.
91 (commit "4bd08a272f059998cedf9b7779f944d49eba13a6")
94 (name "python-junit-xml")
95 (version (git-version version revision commit))
96 (home-page "https://github.com/kyrus/python-junit-xml")
99 (uri (git-reference (url home-page) (commit commit)))
100 (file-name (git-file-name name version))
103 "0b8kbjhk3j10rk0vcniy695m3h43yip6y93h1bd6jjh0cp7s09c7"))))
104 (build-system python-build-system)
106 `(#:phases (modify-phases %standard-phases
109 (invoke "pytest" "-vv"))))))
111 `(("python-pytest" ,python-pytest)))
113 `(("python-six" ,python-six)))
114 (synopsis "Create JUnit XML test results")
116 "This package provides a Python module for creating JUnit XML test
117 result documents that can be read by tools such as Jenkins or Bamboo.")
118 (license license:expat))))
120 (define-public python-vcrpy
122 (name "python-vcrpy")
127 (uri (pypi-uri "vcrpy" version))
130 "0kws7l3hci1dvjv01nxw3805q9v2mwldw58bgl8s90wqism69gjp"))))
131 (build-system python-build-system)
132 (arguments `(#:tests? #f)) ; tests require more packages for python-pytest-httpbin
134 `(("python-pyyaml" ,python-pyyaml)
135 ("python-six" ,python-six)
136 ("python-wrapt" ,python-wrapt)
137 ("python-yarl" ,python-yarl)))
139 `(("python-mock" ,python-mock)
140 ("python-pytest" ,python-pytest)
141 ("python-pytest-httpbin" ,python-pytest-httpbin)))
142 (home-page "https://github.com/kevin1024/vcrpy")
143 (synopsis "Automatically mock your HTTP interactions")
145 "VCR.py simplifies and speeds up tests that make HTTP requests. The first
146 time you run code that is inside a VCR.py context manager or decorated function,
147 VCR.py records all HTTP interactions that take place through the libraries it
148 supports and serializes and writes them to a flat file (in yaml format by
149 default). This flat file is called a cassette. When the relevant piece of code
150 is executed again, VCR.py will read the serialized requests and responses from
151 the aforementioned cassette file, and intercept any HTTP requests that it
152 recognizes from the original test run and return the responses that corresponded
153 to those requests. This means that the requests will not actually result in
154 HTTP traffic, which confers several benefits including:
156 @item The ability to work offline
157 @item Completely deterministic tests
158 @item Increased test execution speed
160 If the server you are testing against ever changes its API, all you need to do
161 is delete your existing cassette files, and run your tests again. VCR.py will
162 detect the absence of a cassette file and once again record all HTTP
163 interactions, which will update them to correspond to the new API.")
164 (license license:expat)))
166 (define-public python-pytest-ordering
168 (name "python-pytest-ordering")
172 ;; No tests in the PyPI tarball.
175 (url "https://github.com/ftobia/pytest-ordering")
177 (file-name (git-file-name name version))
179 (base32 "14msj5gyqza0gk3x7h1ivmjrwza82v84cj7jx3ks0fw9lpin7pjq"))))
180 (build-system python-build-system)
183 (modify-phases %standard-phases
185 (lambda* (#:key inputs outputs #:allow-other-keys)
186 (add-installed-pythonpath inputs outputs)
187 (invoke "pytest" "-vv" "-k"
188 ;; This test fails because of a type mismatch of an
189 ;; argument passed to @code{pytest.main}.
190 "not test_run_marker_registered"))))))
192 `(("python-pytest" ,python-pytest)))
193 (home-page "https://github.com/ftobia/pytest-ordering")
194 (synopsis "Pytest plugin to run your tests in a specific order")
196 "This plugin defines Pytest markers to ensure that some tests, or groups
197 of tests run in a specific order.")
198 (license license:expat)))
200 (define-public python-pytest-astropy-header
202 (name "python-pytest-astropy-header")
207 (uri (pypi-uri "pytest-astropy-header" version))
209 (base32 "1y87agr324p6x5gvhziymxjlw54pyn4gqnd49papbl941djpkp5g"))))
210 (build-system python-build-system)
212 `(("pytest" ,python-pytest)
213 ("setuptools-scm" ,python-setuptools-scm)))
214 (home-page "https://www.astropy.org/")
216 "Pytest plugin adding diagnostic data to the header of the test output")
218 "This plugin package provides a way to include information about the system,
219 Python installation, and select dependencies in the header of the output when
220 running pytest. It can be used with packages that are not affiliated with the
221 Astropy project, but is optimized for use with astropy-related projects.")
222 (license license:bsd-3)))
224 (define-public python-pytest-arraydiff
226 (name "python-pytest-arraydiff")
231 (uri (pypi-uri "pytest-arraydiff" version))
233 (base32 "05bcvhh2ycxa35znl8b3l9vkcmx7vwm5c3fpakbpw46c7vsn4bfy"))))
234 (build-system python-build-system)
236 ;; Tests require python-astropy, which itself requires this package.
237 ;; Disable tests to avoid the circular dependency problem.
240 `(("python-numpy" ,python-numpy)
241 ("python-six" ,python-six)))
242 (home-page "https://github.com/astropy/pytest-arraydiff")
243 (synopsis "Pytest plugin to help with comparing array output from tests")
245 "This is a py.test plugin to facilitate the generation and comparison of
246 data arrays produced during tests, in particular in cases where the arrays
247 are too large to conveniently hard-code them in the tests.")
248 (license license:bsd-3)))
250 (define-public python-pytest-doctestplus
252 (name "python-pytest-doctestplus")
257 (uri (pypi-uri "pytest-doctestplus" version))
259 (base32 "1ai9kvd7xbq2jg2h8gmkb8lqzyrxvdh4zg3vxndg149iwd1hyi7d"))))
260 (build-system python-build-system)
263 (modify-phases %standard-phases
265 (lambda* (#:key inputs outputs #:allow-other-keys)
266 ;; Make the installed plugin discoverable by Pytest.
267 (add-installed-pythonpath inputs outputs)
268 (invoke "pytest" "-vv"))))))
270 `(("python-pytest" ,python-pytest)))
271 (home-page "https://github.com/astropy/pytest-doctestplus")
272 (synopsis "Pytest plugin with advanced doctest features")
274 "This package contains a plugin for the Pytest framework that provides
275 advanced doctest support and enables the testing of reStructuredText files.")
276 (license license:bsd-3)))
278 (define-public python-pytest-filter-subpackage
280 (name "python-pytest-filter-subpackage")
285 (uri (pypi-uri "pytest-filter-subpackage" version))
287 (base32 "1s4s2kd31yc65rfvl4xhy8xx806xhy59kc7668h6b6wq88xgrn5p"))))
288 (build-system python-build-system)
290 '(;; One test is failing. There's an issue reported upstream. See
291 ;; https://github.com/astropy/pytest-filter-subpackage/issues/3.
292 ;; Disable it for now.
294 (modify-phases %standard-phases
296 (lambda* (#:key inputs outputs #:allow-other-keys)
297 ;; Make the installed plugin discoverable by Pytest.
298 (add-installed-pythonpath inputs outputs)
299 (invoke "pytest" "-vv" "-k" "not test_with_rst"))))))
301 `(("python-pytest" ,python-pytest)
302 ("python-pytest-cov" ,python-pytest-cov)
303 ("python-pytest-doctestplus"
304 ,python-pytest-doctestplus)))
305 (home-page "https://github.com/astropy/pytest-filter-subpackage")
306 (synopsis "Pytest plugin for filtering based on sub-packages")
308 "This package contains a simple plugin for the pytest framework that
309 provides a shortcut to testing all code and documentation for a given
311 (license license:bsd-3)))
313 (define-public python-pytest-openfiles
315 (name "python-pytest-openfiles")
320 (uri (pypi-uri "pytest-openfiles" version))
322 (base32 "0n0a7fdc9m86360y96l23fvdmd6rw04bl6h5xqgl9qxfv08jk70p"))))
323 (build-system python-build-system)
326 (modify-phases %standard-phases
328 (lambda* (#:key inputs outputs #:allow-other-keys)
329 ;; Make the installed plugin discoverable by Pytest.
330 (add-installed-pythonpath inputs outputs)
331 (invoke "pytest" "-vv"))))))
333 `(("python-setuptools-scm" ,python-setuptools-scm)
334 ("python-pytest" ,python-pytest)))
336 `(("python-psutil" ,python-psutil)))
337 (home-page "https://github.com/astropy/pytest-openfiles")
338 (synopsis "Pytest plugin for detecting inadvertent open file handles")
340 "This package provides a plugin for the pytest framework that allows
341 developers to detect whether any file handles or other file-like objects
342 were inadvertently left open at the end of a unit test.")
343 (license license:bsd-3)))
345 (define-public python-pytest-remotedata
347 (name "python-pytest-remotedata")
352 (uri (pypi-uri "pytest-remotedata" version))
354 (base32 "1h6g6shib6z07azf12rnsa053470ggbd7hy3bnbw8nf3nza5h372"))))
355 (build-system python-build-system)
358 (modify-phases %standard-phases
360 (lambda* (#:key inputs outputs #:allow-other-keys)
361 ;; Make the installed plugin discoverable by Pytest.
362 (add-installed-pythonpath inputs outputs)
363 (invoke "pytest" "-vv" "-k"
365 ;; These tests require internet access. Disable them.
366 "not test_default_behavior"
367 " and not test_strict_with_decorator")))))))
369 `(("python-pytest" ,python-pytest)))
371 `(("python-six" ,python-six)))
372 (home-page "https://github.com/astropy/pytest-remotedata")
373 (synopsis "Pytest plugin for controlling remote data access")
375 "This package provides a plugin for the Pytest framework that allows
376 developers to control unit tests that require access to data from the
378 (license license:bsd-3)))
380 (define-public python-pytest-mpl
382 (name "python-pytest-mpl")
387 (uri (pypi-uri "pytest-mpl" version))
389 (base32 "1km202c1s5kcn52fx0266p06qb34va3warcby594dh6vixxa9i96"))))
390 (build-system python-build-system)
393 (modify-phases %standard-phases
396 (invoke "pytest" "-vv"))))))
398 `(("python-pytest" ,python-pytest)))
400 `(("python-matplotlib" ,python-matplotlib)
401 ("python-pillow" ,python-pillow)))
402 (home-page "https://github.com/matplotlib/pytest-mpl")
403 (synopsis "Pytest plugin to help with testing figures output from Matplotlib")
405 "This is a plugin to facilitate image comparison for Matplotlib figures
407 (license license:bsd-3)))
409 (define-public python-covdefaults
411 (name "python-covdefaults")
415 ;; The PyPI tarball does not include tests.
418 (url "https://github.com/asottile/covdefaults")
419 (commit (string-append "v" version))))
420 (file-name (git-file-name name version))
422 (base32 "11a24c0wzv01n55fy4kdpnyqna4m9k0mp58kmhiaks34xw4k37hq"))))
423 (build-system python-build-system)
426 (modify-phases %standard-phases
429 (invoke "pytest" "-vv"))))))
431 `(("python-coverage" ,python-coverage)
432 ("python-pytest" ,python-pytest)))
433 (home-page "https://github.com/asottile/covdefaults")
434 (synopsis "Coverage plugin to provide opinionated default settings")
436 "Covdefaults is a coverage plugin to provide opinionated default
438 (license license:expat)))
440 (define-public python-pytest-vcr
441 ;; This commit fixes integration with pytest-5
442 (let ((commit "4d6c7b3e379a6a7cba0b8f9d20b704dc976e9f05")
445 (name "python-pytest-vcr")
446 (version (git-version "1.0.2" revision commit))
451 (url "https://github.com/ktosiek/pytest-vcr")
453 (file-name (git-file-name name version))
456 "1yk988zi0la6zpcm3fff0mxf942di2jiymrfqas19nyngj5ygaqs"))))
457 (build-system python-build-system)
460 (modify-phases %standard-phases
462 (lambda* (#:key inputs outputs #:allow-other-keys)
463 (add-installed-pythonpath inputs outputs)
464 (invoke "pytest" "tests/"))))))
466 `(("python-pytest" ,python-pytest)
467 ("python-vcrpy" ,python-vcrpy)))
468 (home-page "https://github.com/ktosiek/pytest-vcr")
469 (synopsis "Plugin for managing VCR.py cassettes")
471 "Plugin for managing VCR.py cassettes.")
472 (license license:expat))))
474 (define-public python-pytest-checkdocs
476 (name "python-pytest-checkdocs")
481 (uri (pypi-uri "pytest-checkdocs" version))
483 (base32 "0j6j1gvj6x451y3qsx4xbaq9p1w9gg3mwk7n0w80cy8vdyjkngb0"))))
484 (build-system python-build-system)
486 `(("python-docutils" ,python-docutils)
487 ("python-importlib-metadata" ,python-importlib-metadata)
488 ("python-more-itertools" ,python-more-itertools)))
490 `(("python-setuptools-scm" ,python-setuptools-scm)))
491 (home-page "https://github.com/jaraco/pytest-checkdocs")
492 (synopsis "Check the README when running tests")
494 "This package provides a pytest plugin that checks the long description
495 of the project to ensure it renders properly.")
496 (license license:expat)))
498 (define-public python-re-assert
500 (name "python-re-assert")
504 ;; There are no tests in the PyPI tarball.
507 (url "https://github.com/asottile/re-assert")
508 (commit (string-append "v" version))))
509 (file-name (git-file-name name version))
511 (base32 "1rssq4wpqmx1c17hjfx5l3sn3zmnlz9jffddiqrs4f6h7m6cadai"))))
512 (build-system python-build-system)
515 (modify-phases %standard-phases
518 (invoke "pytest" "-vv"))))))
520 `(("python-covdefaults" ,python-covdefaults)
521 ("python-coverage" ,python-coverage)
522 ("python-pytest" ,python-pytest)))
524 `(("python-regex" ,python-regex)))
525 (home-page "https://github.com/asottile/re-assert")
526 (synopsis "Show where your regex match assertion failed")
528 "@code{re-assert} provides a helper class to make assertions of regexes
530 (license license:expat)))
532 (define-public python-pytest-trio
534 (name "python-pytest-trio")
539 (uri (pypi-uri "pytest-trio" version))
541 (base32 "1zm8didm9h5jkqhghl9bvqs7kr7sjci282c7grhk6yhpzn8a9w4v"))))
542 (build-system python-build-system)
545 (modify-phases %standard-phases
547 (lambda* (#:key inputs outputs #:allow-other-keys)
548 (add-installed-pythonpath inputs outputs)
549 (invoke "pytest" "-W" "error" "-ra" "-v" "--pyargs"
550 "pytest_trio" "--verbose" "--cov"))))))
552 `(("python-hypothesis" ,python-hypothesis)
553 ("python-pytest" ,python-pytest)
554 ("python-pytest-cov" ,python-pytest-cov)))
556 `(("python-trio" ,python-trio)))
557 (home-page "https://github.com/python-trio/pytest-trio")
558 (synopsis "Pytest plugin for trio")
560 "This is a pytest plugin to help you test projects that use Trio, a
561 friendly library for concurrency and async I/O in Python.")
562 ;; Either license applies.
563 (license (list license:expat license:asl2.0))))
565 (define-public python-pytest-flake8
567 (name "python-pytest-flake8")
572 (uri (pypi-uri "pytest-flake8" version))
575 "09vhn7r77s1yiqnlwfvh5585f904zpyd6620a90dpccfr1cbp0hv"))))
576 (build-system python-build-system)
578 `(("python-flake8" ,python-flake8)))
580 `(("python-pytest" ,python-pytest)))
581 (home-page "https://github.com/tholo/pytest-flake8")
582 (synopsis "Pytest plugin to check FLAKE8 requirements")
584 "This package provides a pytest plugin for efficiently checking PEP8
586 (license license:bsd-3)))
588 (define-public python-pytest-isort
590 (name "python-pytest-isort")
595 (uri (pypi-uri "pytest-isort" version))
597 (base32 "06myn5hhxs5yp8dqr1yjsgcnnxnsrvsqannm00bvaw0qml6ydzjb"))))
598 (build-system python-build-system)
601 (modify-phases %standard-phases
605 (string-append (getcwd) ":"
606 (getenv "PYTHONPATH")))
607 (invoke "pytest"))))))
609 `(("python-isort" ,python-isort)
610 ("python-pytest" ,python-pytest)))
611 (home-page "https://github.com/moccu/pytest-isort/")
612 (synopsis "Pytest plugin to check import ordering using isort")
614 "This package provides a pytest plugin to check import ordering using
616 (license license:bsd-3)))
618 (define-public python-pytest-shutil
620 (name "python-pytest-shutil")
625 (uri (pypi-uri "pytest-shutil" version))
628 "0q8j0ayzmnvlraml6i977ybdq4xi096djhf30n2m1rvnvrhm45nq"))))
629 (build-system python-build-system)
632 (modify-phases %standard-phases
633 (add-after 'unpack 'patch-tests
636 (substitute* "tests/integration/test_cmdline_integration.py"
637 (("dirname = '/bin'")
638 "dirname = '/tmp/bin'")
639 (("bindir = os.path.realpath\\('/bin'\\)")
640 "bindir = os.path.realpath('/tmp/bin')"))
643 `(("python-contextlib2" ,python-contextlib2)
644 ("python-execnet" ,python-execnet)
645 ("python-pathpy" ,python-pathpy)
646 ("python-termcolor" ,python-termcolor)))
648 `(("python-mock" ,python-mock)
649 ("python-pytest" ,python-pytest)
650 ("python-setuptools-git" ,python-setuptools-git)))
651 (home-page "https://github.com/manahl/pytest-plugins")
652 (synopsis "Assorted shell and environment tools for py.test")
654 "This package provides assorted shell and environment tools for the
655 py.test testing framework.")
656 (license license:expat)))
658 (define-public python-pytest-fixture-config
660 (name "python-pytest-fixture-config")
665 (uri (pypi-uri "pytest-fixture-config" version))
668 "13i1qpz22w3x4dmw8vih5jdnbqfqvl7jiqs0dg764s0zf8bp98a1"))))
669 (build-system python-build-system)
671 `(("python-pytest" ,python-pytest)
672 ("python-setuptools-git" ,python-setuptools-git)))
673 (home-page "https://github.com/manahl/pytest-plugins")
674 (synopsis "Fixture configuration utils for py.test")
676 "This package provides fixture configuration utilities for the py.test
678 (license license:expat)))
680 (define-public python-pytest-virtualenv
682 (name "python-pytest-virtualenv")
687 (uri (pypi-uri "pytest-virtualenv" version))
690 "03w2zz3crblj1p6i8nq17946hbn3zqp9z7cfnifw47hi4a4fww12"))))
691 (build-system python-build-system)
694 (modify-phases %standard-phases
695 ;; Reference the virtualenv executable directly, to avoid the need
696 ;; for PYTHONPATH, which gets cleared when instantiating a new
697 ;; virtualenv with pytest-virtualenv.
698 (add-after 'unpack 'patch-virtualenv-executable
699 (lambda* (#:key inputs #:allow-other-keys)
700 (let* ((virtualenv (assoc-ref inputs "python-virtualenv"))
701 (virtualenv-bin (string-append virtualenv
703 (substitute* "pytest_virtualenv.py"
704 (("^DEFAULT_VIRTUALENV_FIXTURE_EXECUTABLE.*$")
705 (format #f "DEFAULT_VIRTUALENV_FIXTURE_EXECUTABLE = '~a'"
709 `(("python-pytest-shutil" ,python-pytest-shutil)
710 ("python-pytest-fixture-config" ,python-pytest-fixture-config)))
712 `(("python-virtualenv" ,python-virtualenv)))
714 `(("python-mock" ,python-mock)
715 ("python-pytest" ,python-pytest)
716 ("python-setuptools-git" ,python-setuptools-git)))
717 (home-page "https://github.com/manahl/pytest-plugins")
718 (synopsis "Virtualenv fixture for py.test")
719 (description "This package provides a virtualenv fixture for the py.test
721 (license license:expat)))
723 (define-public python-pytest-pycodestyle
725 (name "python-pytest-pycodestyle")
726 (version "2.0.0") ;later versions require python-pytest~=5.4
730 (uri (pypi-uri "pytest-pycodestyle" version))
733 "02i5gl7pm9cwxk15sn29inz3n8flpj1r3p1l110h43f2na5w8h7z"))))
734 (build-system python-build-system)
736 `(("python-pycodestyle" ,python-pycodestyle)))
738 `(("python-pytest" ,python-pytest)))
739 (home-page "https://github.com/henry0312/pytest-pycodestyle")
740 (synopsis "Pytest plugin to run pycodestyle")
741 (description "This package provides a plugin to run @code{pycodestyle}
742 for the @code{pytest} framework.")
743 (license license:expat)))
745 (define-public python-pytest-benchmark
747 (name "python-pytest-benchmark")
752 (uri (pypi-uri "pytest-benchmark" version))
755 "0a4mpb4j73dsyk47hd1prrjpfk4r458s102cn80rf253jg818hxd"))))
756 (build-system python-build-system)
758 `(("python-py-cpuinfo" ,python-py-cpuinfo)))
760 `(("python-pathlib2" ,python-pathlib2)
761 ("python-pytest" ,python-pytest)))
762 (home-page "https://github.com/ionelmc/pytest-benchmark")
763 (synopsis "Pytest fixture for benchmarking code")
765 "This package provides a pytest fixture that will group the tests into
766 rounds that are calibrated to the chosen timer.")
767 (license license:bsd-2)))
769 (define-public python-pytest-services
771 (name "python-pytest-services")
776 (uri (pypi-uri "pytest-services" version))
779 "0b2zfv04w6m3gp2v44ifdhx22vcji069qnn95ry3zcyxib7cjnq3"))))
780 (build-system python-build-system)
781 (arguments '(#:tests? #f)) ; Tests not included in release tarball.
783 `(("python-psutil" ,python-psutil)
784 ("python-requests" ,python-requests)))
786 `(("python-pytest" ,python-pytest)))
787 (home-page "https://github.com/pytest-dev/pytest-services")
788 (synopsis "Services plugin for pytest testing framework")
790 "This plugin provides a set of fixtures and utility functions to start
791 service processes for your tests with pytest.")
792 (license license:expat)))
794 (define-public python-pytest-toolbox
796 (name "python-pytest-toolbox")
800 ;; No tests in the PyPI tarball.
803 (url "https://github.com/samuelcolvin/pytest-toolbox")
804 (commit (string-append "v" version))))
805 (file-name (git-file-name name version))
807 (base32 "1wqkr3g5gmqdxmhzfsxbwy8pm3cadaj6a8cxq58w9bacly4hqbh0"))))
808 (build-system python-build-system)
811 (modify-phases %standard-phases
813 (lambda* (#:key inputs outputs #:allow-other-keys)
814 ;; Make the installed plugin discoverable by Pytest.
815 (add-installed-pythonpath inputs outputs)
816 (invoke "pytest" "-vv"))))))
818 `(("python-coverage" ,python-coverage)
819 ("python-docutils" ,python-docutils)
820 ("python-flake8" ,python-flake8)
821 ("python-isort" ,python-isort)
822 ("python-pydantic" ,python-pydantic)
823 ("python-pyflakes" ,python-pyflakes)
824 ("python-pygments" ,python-pygments)
825 ("python-pytest" ,python-pytest)
826 ("python-pytest-cov" ,python-pytest-cov)
827 ("python-pytest-isort" ,python-pytest-isort)
828 ("python-pytest-mock" ,python-pytest-mock)
829 ("python-pytest-sugar" ,python-pytest-sugar)))
830 (home-page "https://github.com/samuelcolvin/pytest-toolbox")
831 (synopsis "Numerous useful plugins for Pytest")
833 "Pytest Toolbox contains many useful plugins for Pytest. Among them are
834 new fixtures, new methods and new comparison objects.")
835 (license license:expat)))
837 (define-public python-pytest-aiohttp
839 (name "python-pytest-aiohttp")
844 (uri (pypi-uri "pytest-aiohttp" version))
847 "0kx4mbs9bflycd8x9af0idcjhdgnzri3nw1qb0vpfyb3751qaaf9"))))
848 (build-system python-build-system)
850 `(("python-pytest" ,python-pytest)))
852 `(("python-aiohttp" ,python-aiohttp)))
853 (home-page "https://github.com/aio-libs/pytest-aiohttp/")
854 (synopsis "Pytest plugin for aiohttp support")
855 (description "This package provides a pytest plugin for aiohttp support.")
856 (license license:asl2.0)))
858 (define-public python-nbval
860 (name "python-nbval")
865 (uri (pypi-uri "nbval" version))
867 (base32 "0h3xrnw0mj1srigrx2rfnd73h8s0xjycclmjs0vx7qkfyqpcvvyg"))))
868 (build-system python-build-system)
871 (modify-phases %standard-phases
872 (add-before 'check 'fix-test
874 ;; This test fails because of a mismatch in the output of LaTeX
875 ;; equation environments. Seems OK to skip.
876 (delete-file "tests/ipynb-test-samples/test-latex-pass-correctouput.ipynb")
879 (lambda* (#:key inputs outputs #:allow-other-keys)
880 (add-installed-pythonpath inputs outputs)
881 (invoke "pytest" "-vv" "-k"
883 ;; This only works with Pytest < 5.
884 "not nbdime_reporter"
885 ;; https://github.com/computationalmodelling/nbval/pull/148.
886 " and not test_timeouts")))))))
888 `(("python-pytest" ,python-pytest)
889 ("python-pytest-cov" ,python-pytest-cov)
890 ("python-sympy" ,python-sympy)))
892 `(("python-ipykernel" ,python-ipykernel)
893 ("python-jupyter-client" ,python-jupyter-client)
894 ("python-nbformat" ,python-nbformat)
895 ("python-six" ,python-six)))
896 (home-page "https://github.com/computationalmodelling/nbval")
897 (synopsis "Pytest plugin to validate Jupyter notebooks")
899 "This plugin adds functionality to Pytest to recognise and collect Jupyter
900 notebooks. The intended purpose of the tests is to determine whether execution
901 of the stored inputs match the stored outputs of the @file{.ipynb} file. Whilst
902 also ensuring that the notebooks are running without errors.")
903 (license license:bsd-3)))
905 (define-public python-pytest-flask
907 (name "python-pytest-flask")
912 (uri (pypi-uri "pytest-flask" version))
915 "1hln7mwgdzfi5ma0kqfsi768l7p24jhkw8l0imhifwy08nh7hmjd"))))
916 (build-system python-build-system)
918 `(("python-flask" ,python-flask)
919 ("python-pytest" ,python-pytest)
920 ("python-setuptools-scm" ,python-setuptools-scm)
921 ("python-werkzeug" ,python-werkzeug)))
922 (home-page "https://github.com/pytest-dev/pytest-flask")
923 (synopsis "Pytest fixtures to test Flask applications")
925 "This pytest plugin provides fixtures to simplify Flask app testing.")
926 (license license:expat)))
928 (define-public python-pytest-env
930 (name "python-pytest-env")
935 (uri (pypi-uri "pytest-env" version))
937 (base32 "1hl0ln0cicdid4qjk7mv90lw9xkb0v71dlj7q7rn89vzxxm9b53y"))))
938 (build-system python-build-system)
940 `(("python-pytest" ,python-pytest)))
941 (home-page "https://github.com/MobileDynasty/pytest-env")
942 (synopsis "Pytest plugin that allows you to add environment variables")
944 "This is a @code{py.test} plugin that enables you to set environment
945 variables in the @file{pytest.ini} file.")
946 (license license:expat)))
948 (define-public python-pyux
955 (uri (pypi-uri "pyux" version))
958 "1i17xh4dy238ibrjdgh8vn78fk5q6dj37mcznpvdfzidj57js7ca"))))
959 (build-system python-build-system)
961 `(#:tests? #f)) ;the mini test suite fails
962 (home-page "https://github.com/farizrahman4u/pyux")
963 (synopsis "Utility to check API integrity in Python libraries")
964 (description "The pyux utility detects API changes in Python
966 (license license:expat)))
968 (define-public python-codacy-coverage
970 (name "python-codacy-coverage")
975 (uri (pypi-uri "codacy-coverage" version))
978 "1g0c0w56xdkmqb8slacyw5qhzrkp814ng3ddh2lkiij58y9m2imr"))))
979 (build-system python-build-system)
981 `(#:tests? #f)); no tests
983 `(("python-check-manifest" ,python-check-manifest)))
984 (home-page "https://github.com/codacy/python-codacy-coverage")
985 (synopsis "Codacy coverage reporter for Python")
986 (description "This package analyses Python test suites and reports how much
987 of the code is covered by them. This tool is part of the Codacy suite for
988 analysing code quality.")
989 (license license:expat)))
991 (define-public python-httmock
993 (name "python-httmock")
998 (uri (pypi-uri "httmock" version))
1001 "1zj1fcm0n6f0wr9mr0hmlqz9430fnr5cdwd5jkcvq9j44bnsrfz0"))))
1002 (build-system python-build-system)
1004 `(#:tests? #f)); no tests
1006 `(("python-requests" ,python-requests)))
1007 (home-page "https://github.com/patrys/httmock")
1008 (synopsis "Mocking library for requests.")
1009 (description "This package provides a library for replying fake data to
1010 Python software under test, when they make an HTTP query.")
1011 (license license:asl2.0)))
1013 (define-public python-atpublic
1015 (name "python-atpublic")
1020 (uri (pypi-uri "atpublic" version))
1023 "0i3sbxkdlbb4560rrlmwwd5y4ps7k73lp4d8wnmd7ag9k426gjkx"))))
1024 (build-system python-build-system)
1027 (modify-phases %standard-phases
1028 (add-before 'build 'enable-c-implementation
1030 (setenv "ATPUBLIC_BUILD_EXTENSION" "yes")
1034 (invoke "python" "-m" "nose2" "-v"))))))
1036 `(("python-nose2" ,python-nose2)))
1037 (home-page "https://public.readthedocs.io/")
1038 (synopsis "@code{@@public} decorator for populating @code{__all__}")
1040 "This Python module adds a @code{@@public} decorator and function which
1041 populates a module's @code{__all__} and optionally the module globals. With
1042 it, the declaration of a name's public export semantics are not separated from
1043 the implementation of that name.")
1044 (license (list license:asl2.0
1045 license:lgpl3)))) ; only for setup_helpers.py
1047 (define-public python-mypy-extensions
1049 (name "python-mypy-extensions")
1054 (uri (pypi-uri "mypy_extensions" version))
1057 "1a04qsk8hd1lqns8w1j7cr0vmvbhg450di5k1i16kqxkbf7q30id"))))
1058 (build-system python-build-system)
1059 (arguments `(#:tests? #f)); no tests
1060 (home-page "https://github.com/python/mypy_extensions")
1061 (synopsis "Experimental extensions for MyPy")
1062 (description "The @code{python-mypy-extensions} module defines
1063 experimental extensions to the standard @code{typing} module that are
1064 supported by the MyPy typechecker.")
1065 (license license:expat)))
1067 (define-public python-mypy
1069 (name "python-mypy")
1073 ;; Because of https://github.com/python/mypy/issues/9584, the
1074 ;; mypyc/analysis directory is missing in the PyPI archive, leading to
1078 (url "https://github.com/python/mypy")
1079 (commit (string-append "v" version))
1080 ;; Fetch git submodules otherwise typeshed is not fetched.
1081 ;; Typeshed is a collection of Python sources type annotation
1084 (file-name (git-file-name name version))
1087 "0zq3lpdf9hphcklk40wz444h8w3dkhwa12mqba5j9lmg11klnhz7"))))
1088 (build-system python-build-system)
1091 (modify-phases %standard-phases
1094 (invoke "pytest" "mypyc"))))))
1096 `(("python-attrs" ,python-attrs)
1097 ("python-flake8" ,python-flake8)
1098 ("python-flake8-bugbear" ,python-flake8-bugbear)
1099 ("python-flake8-pyi" ,python-flake8-pyi)
1100 ("python-importlib-metadata" ,python-importlib-metadata)
1101 ("python-lxml" ,python-lxml)
1102 ("python-psutil" ,python-psutil)
1103 ("python-pytest" ,python-pytest-6)
1104 ("python-pytest-cov" ,python-pytest-cov)
1105 ("python-pytest-forked" ,python-pytest-forked)
1106 ("python-pytest-xdist" ,python-pytest-xdist)
1107 ("python-virtualenv" ,python-virtualenv)))
1109 `(("python-mypy-extensions" ,python-mypy-extensions)
1110 ("python-typing-extensions" ,python-typing-extensions)
1111 ("python-typed-ast" ,python-typed-ast)))
1112 (home-page "http://www.mypy-lang.org/")
1113 (synopsis "Static type checker for Python")
1114 (description "Mypy is an optional static type checker for Python that aims
1115 to combine the benefits of dynamic (or 'duck') typing and static typing. Mypy combines
1116 the expressive power and convenience of Python with a powerful type system and
1117 compile-time type checking. Mypy type checks standard Python programs; run them using
1118 any Python VM with basically no runtime overhead.")
1119 ;; Most of the code is under MIT license; Some files are under Python Software
1120 ;; Foundation License version 2: stdlib-samples/*, mypyc/lib-rt/pythonsupport.h and
1121 ;; mypyc/lib-rt/getargs.c
1122 (license (list license:expat license:psfl))))
1124 (define-public python-eradicate
1126 (name "python-eradicate")
1131 (uri (pypi-uri "eradicate" version))
1134 "1j30g9jfmbfki383qxwrfds8b23yiwywj40lng4lqcf5yab4ahr7"))))
1135 (build-system python-build-system)
1136 (home-page "https://github.com/myint/eradicate")
1137 (synopsis "Remove commented-out code from Python sources")
1138 (description "The @command{eradicate} command removes commented-out code
1139 from Python files. It does this by detecting block comments that contain
1140 valid Python syntax that are likely to be commented out code.")
1141 (license license:expat)))
1143 (define-public python-robber
1145 (name "python-robber")
1149 (uri (pypi-uri "robber" version))
1152 "0xp5csgv2g9q38hscml6bc5i1nm4xy5lzqqiimm2drxsf0hw2nq5"))))
1153 (build-system python-build-system)
1154 ;; There are no tests in the tarball downloaded from PyPI.
1155 ;; The last version tagged in Github (0.1.0) is older than the one on PyPI.
1156 ;; Reported upstream: <https://github.com/vesln/robber.py/issues/20>.
1157 (arguments '(#:tests? #f))
1159 `(("python-mock" ,python-mock)
1160 ("python-termcolor" ,python-termcolor)))
1161 ;; URL of the fork used to generate the package available on PyPI.
1162 (home-page "https://github.com/EastAgile/robber.py")
1163 (synopsis "Test-driven development (TDD) assertion library for Python")
1164 (description "Robber is a Python assertion library for test-driven and
1165 behavior-driven development (TDD and BDD).")
1166 (license license:expat)))
1168 (define-public python-stestr
1170 (name "python-stestr")
1175 (uri (pypi-uri "stestr" version))
1178 "0adhqp9c9338wlvlq776k57k04lyxp38bv591afdm9gjsn2qn1zm"))))
1179 (build-system python-build-system)
1181 `(#:tests? #f)) ;to avoid circular dependencies
1183 `(("python-pbr" ,python-pbr)))
1185 `(("python-cliff" ,python-cliff)
1186 ("python-fixtures" ,python-fixtures)
1187 ("python-future" ,python-future)
1188 ("python-pyyaml" ,python-pyyaml)
1189 ("python-subunit" ,python-subunit)
1190 ("python-testtools" ,python-testtools)
1191 ("python-voluptuous" ,python-voluptuous)))
1192 (home-page "https://stestr.readthedocs.io/en/latest/")
1193 (synopsis "Parallel Python test runner")
1194 (description "This package provides the @command{stestr} command, a
1195 parallel Python test runner built around @code{subunit}. It is designed to
1196 execute @code{unittest} test suites using multiple processes to split up
1197 execution of a test suite. It will also store a history of all test runs to
1198 help in debugging failures and optimizing the scheduler to improve speed.")
1199 (license license:asl2.0)))
1201 ;; This is only used by python-sanic
1202 (define-public python-pytest-sanic
1204 (name "python-pytest-sanic")
1208 (uri (pypi-uri "pytest-sanic" version))
1211 "02ajd8z77ahi69kzkz200qgxrb4s2j4qb6k8j9ds1kz6qa6fsa34"))))
1212 (build-system python-build-system)
1214 ;; Tests depend on python-sanic.
1217 `(("python-aiohttp" ,python-aiohttp)
1218 ("python-async-generator"
1219 ,python-async-generator)
1220 ("python-pytest" ,python-pytest)))
1222 "https://github.com/yunstanford/pytest-sanic")
1223 (synopsis "Pytest plugin for Sanic")
1224 (description "A pytest plugin for Sanic. It helps you to test your
1225 code asynchronously.")
1226 (license license:expat)))