diff options
Diffstat (limited to 'gnu/packages/python-check.scm')
-rw-r--r-- | gnu/packages/python-check.scm | 1124 |
1 files changed, 789 insertions, 335 deletions
diff --git a/gnu/packages/python-check.scm b/gnu/packages/python-check.scm index b39709d960..a276452a69 100644 --- a/gnu/packages/python-check.scm +++ b/gnu/packages/python-check.scm @@ -9,16 +9,19 @@ ;;; Copyright © 2020 Edouard Klein <edk@beaver-labs.com> ;;; Copyright © 2020, 2021 Vinicius Monego <monego@posteo.net> ;;; Copyright © 2020 Tanguy Le Carrour <tanguy@bioneland.org> -;;; Copyright © 2021-2023 Sharlatan Hellseher <sharlatanus@gmail.com> +;;; Copyright © 2021-2024 Sharlatan Hellseher <sharlatanus@gmail.com> ;;; Copyright © 2021 Brendan Tildesley <mail@brendan.scot> ;;; Copyright © 2021, 2022 Guillaume Le Vaillant <glv@posteo.net> ;;; Copyright © 2021 Bonface Munyoki Kilyungi <me@bonfacemunyoki.com> +;;; Copyright © 2021 Sebastian Gibb <mail@sebastiangibb.de> ;;; Copyright © 2022 Malte Frank Gerdes <malte.f.gerdes@gmail.com> ;;; Copyright © 2022 Felix Gruber <felgru@posteo.net> ;;; Copyright © 2022 Tomasz Jeneralczyk <tj@schwi.pl> ;;; Copyright © 2022 jgart <jgart@dismail.de> ;;; Copyright © 2024 Troy Figiel <troy@troyfigiel.com> ;;; Copyright © 2024 Navid Afkhami <navid.afkhami@mdc-berlin.de> +;;; Copyright © 2024 David Elsing <david.elsing@posteo.net> +;;; Copyright © 2024 Eric Bavier <bavier@posteo.net> ;;; ;;; This file is part of GNU Guix. ;;; @@ -40,15 +43,18 @@ #:use-module (gnu packages admin) #:use-module (gnu packages base) #:use-module (gnu packages bash) + #:use-module (gnu packages certs) #:use-module (gnu packages check) #:use-module (gnu packages django) #:use-module (gnu packages docker) + #:use-module (gnu packages jupyter) #:use-module (gnu packages openstack) #:use-module (gnu packages perl) #:use-module (gnu packages python-build) #:use-module (gnu packages python-web) #:use-module (gnu packages python-xyz) #:use-module (gnu packages qt) + #:use-module (gnu packages version-control) #:use-module (gnu packages web) #:use-module (gnu packages xml) #:use-module (gnu packages xorg) @@ -61,6 +67,40 @@ #:use-module (guix packages) #:use-module (guix utils)) +(define-public python-assay + ;; No release yet. + (let ((commit "74617d70e77afa09f58b3169cf496679ac5d5621") + (revision "0")) + (package + (name "python-assay") + (version (git-version "0.0.0" revision commit)) + (source + (origin + (method git-fetch) + (uri (git-reference + (url "https://github.com/brandon-rhodes/assay") + (commit commit))) + (file-name (git-file-name name version)) + (sha256 + (base32 "1klxmamj88mn0q348r08zksccgsbch8sp0m4b04s3myrqnslp2nd")))) + (build-system pyproject-build-system) + (arguments + (list + #:test-flags #~(list "-m" "assay.tests") + #:phases + #~(modify-phases %standard-phases + (replace 'check + (lambda* (#:key tests? test-flags #:allow-other-keys) + (when tests? + (apply invoke "python" test-flags))))))) + (native-inputs + (list python-setuptools python-wheel)) + (home-page "https://github.com/brandon-rhodes/assay") + (synopsis "Python testing framework") + (description + "This package provides opiniotated Python test framework prototype.") + (license license:expat)))) + (define-public python-assertpy (package (name "python-assertpy") @@ -72,6 +112,7 @@ (sha256 (base32 "0cs8xya465wvb9dw0kdl7cvkxwrslhbma66y44r1mmsajcll7imc")))) (build-system pyproject-build-system) + (native-inputs (list python-setuptools python-wheel)) (home-page "https://github.com/assertpy/assertpy") (synopsis "Simple assertion library for unit testing") (description @@ -118,8 +159,7 @@ data in a standard way.") "-k" (string-append "not test_doc_readme " "and not test_sphinx " "and not test_pep561_mypy")))) - (native-inputs - (list python-pytest)) + (native-inputs (list python-pytest python-setuptools python-wheel)) (home-page "https://github.com/beartype/beartype") (synopsis "Fast runtime type checking for Python") (description "Beartype aims to be a very fast runtime type checking tool @@ -182,7 +222,11 @@ tests in cram.") "17518f2fn5l98lyk9p8r7215c1whi61imzrh6ahrmcksr8w0zz04")))) (build-system pyproject-build-system) (native-inputs - (list python-pytest-flake8 python-pytest-xdist python-tabulate)) + (list python-pytest-flake8 + python-pytest-xdist + python-setuptools + python-tabulate + python-wheel)) (propagated-inputs (list python-pytest python-six)) (home-page "https://github.com/nicoulaj/pytest-csv") @@ -192,6 +236,50 @@ CSV output mode for Pytest. It can be enabled via the @option{--csv} option it adds to the Pytest command line interface (CLI).") (license license:gpl3+))) +(define-public python-pytest-flakefinder + (package + (name "python-pytest-flakefinder") + (version "1.1.0") + (source + (origin + (method url-fetch) + (uri (pypi-uri "pytest-flakefinder" version)) + (sha256 + (base32 "03iy80xlkpgzjs2kxa9rrj8dbnp9awyhpcl3hy8fgf5x40cjlhg2")))) + (build-system pyproject-build-system) + (native-inputs (list python-wheel python-setuptools)) + (propagated-inputs (list python-pytest)) + (home-page "https://github.com/dropbox/pytest-flakefinder") + (synopsis "Pytest plugin for finding flaky tests") + (description "This package provides a Pytest plugin to run tests multiple +times and detect flakyness.") + (license license:asl2.0))) + +(define-public python-pytest-shard + (let ((commit "64610a08dac6b0511b6d51cf895d0e1040d162ad") + (revision "0")) + (package + (name "python-pytest-shard") + (version (git-version "0.1.2" revision commit)) + (source + (origin + (method git-fetch) + (uri (git-reference + (url "https://github.com/AdamGleave/pytest-shard") + (commit commit))) + (file-name (git-file-name name version)) + (sha256 + (base32 "1h31m68igz670bzl307hazjrfbr8pk14mxflllar18ydmlrnl677")))) + (build-system pyproject-build-system) + (native-inputs (list python-setuptools python-wheel)) + (propagated-inputs (list python-pytest)) + (home-page "https://github.com/AdamGleave/pytest-shard") + (synopsis "Pytest plugin for sharding tests") + (description "This package provides a Pytest extension for sharding +tests at the granularity of individual test cases, which can be run in +parallel and on multiple machines.") + (license license:expat)))) + (define-public python-testfixtures (package (name "python-testfixtures") @@ -218,26 +306,36 @@ are useful when writing automated tests in Python.") (define-public python-cucumber-tag-expressions (package (name "python-cucumber-tag-expressions") - (version "4.1.0") + (version "6.1.1") (source (origin - (method url-fetch) - (uri (pypi-uri "cucumber-tag-expressions" version)) + (method git-fetch) ;no tests in PyPI archive + (uri (git-reference + (url "https://github.com/cucumber/tag-expressions") + (commit (string-append "v" version)))) + (file-name (git-file-name name version)) (sha256 - (base32 "0q7rn4l4ppjd1zsglr37ccc5xccg4iigaw827282zfzfsvzda573")))) - (build-system python-build-system) + (base32 + "1hanh7hzxmx0f6fp2ykabsg32snmp8y9pd7s5xix15r1gnn7lvp9")))) + (build-system pyproject-build-system) (arguments - (list #:phases - #~(modify-phases %standard-phases - (replace 'check - (lambda* (#:key tests? #:allow-other-keys) - (when tests? - ;; Ignore the configuration file since we don't - ;; need HTML reports, etc. - (invoke "pytest" "-c" "/dev/null" "-vv"))))))) + (list + #:phases + #~(modify-phases %standard-phases + ;; Project's repository contains go, java, javascript, perl, python + ;; and ruby implementations. + (add-after 'unpack 'chdir-python + (lambda _ + (chdir "python")))))) (native-inputs - (list python-invoke python-pathpy python-pytest)) - (home-page "https://github.com/cucumber/tag-expressions-python") + (list python-pathpy + python-pytest + python-pytest-html + python-pyyaml + python-setuptools + python-setuptools-scm + python-wheel)) + (home-page "https://github.com/cucumber/tag-expressions") (synopsis "Tag-expression parser for cucumber/behave") (description "This package provides a tag-expression parser for Cucumber and @@ -247,7 +345,7 @@ are useful when writing automated tests in Python.") (define-public python-coveralls (package (name "python-coveralls") - (version "3.2.0") + (version "4.0.1") (home-page "https://github.com/coveralls-clients/coveralls-python") (source (origin @@ -256,28 +354,19 @@ are useful when writing automated tests in Python.") (uri (git-reference (url home-page) (commit version))) (file-name (git-file-name name version)) (sha256 - (base32 - "1915ab77nfb1rfw4i2ps0zy19wpf20lwxn81qxxbwyd2gy7m0fn8")) - (modules '((guix build utils))) - (snippet '(substitute* "setup.py" - (("'coverage>=4.1,<6.0',") "'coverage',"))))) - (build-system python-build-system) + (base32 "1411h7rwxgp9ag26bmlpy7g7sdh39f56dc1mrd1n74bjsgvwzj6l")))) + (build-system pyproject-build-system) (arguments - '(#:phases (modify-phases %standard-phases - (add-before 'check 'disable-git-test - (lambda _ - ;; Remove test that requires 'git' and the full checkout. - (delete-file "tests/git_test.py"))) - (replace 'check - (lambda* (#:key tests? #:allow-other-keys) - (if tests? - ;; Test fails for unknown reasons. No fix available. - (invoke "pytest" "-vv" "-k" "not test_reporter_with_branches") - (format #t "test suite not run~%"))))))) + (list #:test-flags '(list + ;; XXX: Avoid git dependency. + "--ignore=tests/git_test.py" + ;; XXX: Unable to find coverage package. + "--ignore=tests/api/reporter_test.py" + "--ignore=tests/integration_test.py"))) (propagated-inputs (list python-coverage python-docopt python-pyyaml python-requests)) (native-inputs - (list python-mock python-pytest python-responses)) + (list poetry python-mock python-pytest python-responses)) (synopsis "Show coverage stats online via coveralls.io") (description "Coveralls.io is a service for publishing code coverage statistics online. @@ -285,6 +374,51 @@ This package provides seamless integration with coverage.py (and thus pytest, nosetests, etc...) in Python projects.") (license license:expat))) +(define-public python-icontract + (package + (name "python-icontract") + (version "2.7.1") + (source + (origin + ;; There are no tests in the PyPI tarball. + (method git-fetch) + (uri (git-reference + (url "https://github.com/Parquery/icontract") + (commit (string-append "v" version)))) + (file-name (git-file-name name version)) + (sha256 + (base32 "1fix7wx899kn8vp9aa5m6q71la48gx3qqx4qd74535m61pb50r7f")))) + (arguments + (list + #:phases + #~(modify-phases %standard-phases + (add-before 'check 'set-icontract-slow + (lambda _ + ;; Setting ICONTRACT_SLOW, does not enable a slow test suite. + ;; It only causes a single test to run, that checks the value of + ;; icontract.SLOW is set correctly. + (setenv "ICONTRACT_SLOW" "1")))))) + (build-system pyproject-build-system) + (native-inputs + (list python-astor + python-asyncstdlib + python-mypy + python-numpy + python-setuptools + python-typeguard)) + (propagated-inputs + (list python-asttokens + python-typing-extensions)) + (home-page "https://icontract.readthedocs.io") + (synopsis "Design-by-contract programming for Python") + (description + "@code{icontract} brings design-by-contract to Python with informative +violation messages and inheritance. @code{icontract} provides two function, +@code{require} and @code{ensure} for preconditions and postconditions +respectively. Additionally, it provides a class decorator, @code{invariant}, +to establish class invariants.") + (license license:expat))) + (define-public python-junit-xml ;; XXX: There are no tags or PyPI releases, so take the latest commit ;; and use the version defined in setup.py. @@ -349,7 +483,9 @@ result documents that can be read by tools such as Jenkins or Bamboo.") python-greenlet python-pytest python-pytest-asyncio - python-pytest-trio)) + python-pytest-trio + python-setuptools + python-wheel)) (home-page "https://github.com/joerick/pyinstrument") (synopsis "Call stack profiler for Python") (description @@ -359,31 +495,26 @@ result documents that can be read by tools such as Jenkins or Bamboo.") (define-public python-vcrpy (package (name "python-vcrpy") - (version "4.1.1") + (version "6.0.2") (source (origin (method url-fetch) (uri (pypi-uri "vcrpy" version)) (sha256 - (base32 "16gmzxs3lzbgf1828n0q61vbmwyhpvzdlk37x6gdk8n05zr5n2ap")))) - (build-system python-build-system) + (base32 "02fwmmc33qqybzbj1lvdz458g1fffm5cgnqihj4larw4268kvqc8")))) + (build-system pyproject-build-system) (arguments - `(#:phases - (modify-phases %standard-phases - (replace 'check - (lambda* (#:key tests? outputs #:allow-other-keys) - (when tests? - (substitute* "tox.ini" - (("AWS_ACCESS_KEY_ID") "PYTHONPATH")) - ;; These tests require network access. - (delete-file "tests/unit/test_stubs.py") - (invoke "pytest" "tests/unit"))))))) - (propagated-inputs - (list python-pyyaml python-six python-wrapt python-yarl)) + (list + #:test-flags + #~(list "--ignore=tests/integration" + "-k" (string-join + ;; These tests require network access. + (list "not testing_connect" + "test_get_vcr_with_matcher" + "test_testcase_playback") + " and not ")))) (native-inputs - (list python-black - python-coverage - python-flake8 + (list nss-certs-for-test python-flask python-httplib2 python-ipaddress @@ -391,8 +522,14 @@ result documents that can be read by tools such as Jenkins or Bamboo.") python-pytest python-pytest-cov python-pytest-httpbin - python-tox - python-urllib3)) + python-setuptools + python-urllib3 + python-wheel)) + (propagated-inputs + (list python-pyyaml + python-six + python-wrapt + python-yarl)) (home-page "https://github.com/kevin1024/vcrpy") (synopsis "Automatically mock your HTTP interactions") (description @@ -420,13 +557,17 @@ interactions, which will update them to correspond to the new API.") (define-public python-pytest-socket (package (name "python-pytest-socket") - (version "0.5.1") - (source (origin - (method url-fetch) - (uri (pypi-uri "pytest-socket" version)) - (sha256 - (base32 - "1dkr86nxkxc0ka3rdnpmk335m8gl1zh1sy8i7w4w1jsidbf82jvw")))) + (version "0.7.0") + (source + (origin + ;; There are no tests in the PyPI tarball. + (method git-fetch) + (uri (git-reference + (url "https://github.com/miketheman/pytest-socket") + (commit version))) + (file-name (git-file-name name version)) + (sha256 + (base32 "1m6s07gvljq82hiajzy1v123kpkciziiqdjqfnas169rmzg0bmnp")))) (build-system pyproject-build-system) (arguments (list @@ -440,7 +581,18 @@ interactions, which will update them to correspond to the new API.") " and not test_httpx_fails" " and not test_disabled_urllib_fails" " and not test_urllib_succeeds_by_default" - " and not test_enabled_urllib_succeeds")))) + " and not test_enabled_urllib_succeeds" + " and not test_single_cli_arg_connect_disabled_hostname_resolved")) + #:phases + #~(modify-phases %standard-phases + ;; See <https://github.com/miketheman/pytest-socket/issues/308> + (add-after 'unpack 'fix-tests + (lambda _ + (substitute* (list "tests/test_async.py" + "tests/test_socket.py" + "tests/test_precedence.py") + (("from tests.common import assert_socket_blocked") + "from common import assert_socket_blocked"))))))) (native-inputs (list python-httpx python-poetry-core python-pypa-build @@ -564,7 +716,8 @@ astropy related packages.") " and not test_generate" " and not test_default_format")))) (native-inputs - (list python-pytest python-setuptools-scm)) + (list python-pytest python-setuptools-scm + python-setuptools python-wheel)) (propagated-inputs (list python-numpy)) (home-page "https://github.com/astropy/pytest-arraydiff") @@ -607,32 +760,69 @@ your template is working as expected and takes care of cleaning up after running the tests.") (license license:expat))) +(define-public python-pytest-datafiles + (package + (name "python-pytest-datafiles") + (version "3.0.0") + (source + (origin + (method git-fetch) ; no tests in the PyPI tarball + (uri (git-reference + (url "https://github.com/omarkohl/pytest-datafiles") + (commit version))) + (file-name (git-file-name name version)) + (sha256 + (base32 "1wbgfsn4pcdm0bw61pwaaq707mlfnixlff3x8m5mpsf6jhrzql30")))) + (build-system pyproject-build-system) + (native-inputs + (list python-pytest)) + (home-page "https://github.com/omarkohl/pytest-datafiles") + (synopsis "Pytest plugin to create a tmpdir") + (description + "A pytest plugin to create a tmpdir containing a preconfigured set of +files and/or directories.") + (license license:expat))) + (define-public python-pytest-doctestplus (package (name "python-pytest-doctestplus") - (version "1.2.0") + (version "1.2.1") (source (origin (method url-fetch) (uri (pypi-uri "pytest-doctestplus" version)) (sha256 - (base32 "0cmrkgpib869kpy8h8hfkg20w16lakkmbkw8cxdywpmf5wx7dbf5")))) + (base32 "0ybn613rp0wqzm97hncwnpn8wx7bz91rajgnclplv8yfr2iahwi4")))) (build-system pyproject-build-system) (arguments - (list #:test-flags - #~(list "-k" (string-append - ;; Tests requiring network access. - "not test_remote_data_url" - " and not test_remote_data_float_cmp" - " and not test_remote_data_ignore_whitespace" - " and not test_remote_data_ellipsis" - " and not test_remote_data_requires" - " and not test_remote_data_ignore_warnings" - ;; Requiring git available. - " and not test_generate_diff_basic")))) + (list + #:test-flags + #~(list "-k" (string-join + ;; Tests requiring network access. + (list "not test_remote_data_url" + "test_remote_data_float_cmp" + "test_remote_data_ignore_whitespace" + "test_remote_data_ellipsis" + "test_remote_data_requires" + "test_remote_data_ignore_warnings") + " and not ")) + #:phases + #~(modify-phases %standard-phases + (add-after 'unpack 'patch-git-path + (lambda _ + (substitute* "pytest_doctestplus/plugin.py" + (("\"git\"") + (format #f "'~a/bin/git'" + #$(this-package-native-input "git-minimal"))))))))) (native-inputs - (list python-numpy python-pytest python-setuptools-scm)) - (home-page "https://github.com/scientific-python/pytest-doctestplus") + (list git-minimal/pinned + python-numpy + python-pytest + python-setuptools-scm + python-wheel)) + (propagated-inputs + (list python-setuptools)) ;for pkg_resources + (home-page "https://github.com/astropy/pytest-doctestplus") (synopsis "Pytest plugin with advanced doctest features") (description "This package contains a plugin for the Pytest framework that provides @@ -681,7 +871,9 @@ for interactively selecting and running Pytest tests.") (list python-pytest python-pytest-cov python-pytest-doctestplus - python-setuptools-scm)) + python-setuptools-scm + python-setuptools + python-wheel)) (home-page "https://github.com/astropy/pytest-filter-subpackage") (synopsis "Pytest plugin for filtering based on sub-packages") (description @@ -720,25 +912,54 @@ namespace which can be used to register helper functions without requiring someone to import them in their actual tests to use them.") (license license:asl2.0))) +(define-public python-pytest-html + (package + (name "python-pytest-html") + (version "4.1.1") + (source + (origin + (method url-fetch) + (uri (pypi-uri "pytest_html" version)) + (sha256 + (base32 "01vgd2bbk3n9wcqzx9dv72qgkx684l8cp92n9c3ll3w0wn51x83h")))) + (build-system pyproject-build-system) + (arguments + (list + #:test-flags + ;; It requires running browser for selenium. + #~(list "--ignore=testing/test_integration.py" + "--ignore=testing/test_e2e.py"))) + (native-inputs + (list python-hatchling + python-hatch-vcs + python-assertpy + python-beautifulsoup4 + python-pytest)) + (propagated-inputs + (list python-jinja2 + python-pytest-metadata)) + (home-page "https://github.com/pytest-dev/pytest-html") + (synopsis "Pytest plugin for generating HTML reports") + (description + "This packages provides a pytest plugin for generating HTML reports.") + (license license:mpl2.0))) + (define-public python-pytest-metadata (package (name "python-pytest-metadata") - (version "1.11.0") + (version "3.1.1") (source (origin (method url-fetch) - (uri (pypi-uri "pytest-metadata" version)) + (uri (pypi-uri "pytest_metadata" version)) (sha256 - (base32 "1wgcz0w053lnjln0081kjmfflaq7bwncxdzx7k63kr9lkpa0ddbi")))) - (build-system python-build-system) - (arguments - (list #:phases - #~(modify-phases %standard-phases - (replace 'check - (lambda* (#:key tests? #:allow-other-keys) - (when tests? - (invoke "pytest" "-vv"))))))) - (native-inputs (list python-pytest python-setuptools-scm)) + (base32 "1j0ph028mj81314vxb027d5b98xii3zl2vd9i8b3zh7val1rp8nj")))) + (build-system pyproject-build-system) + (native-inputs + (list python-hatchling + python-hatch-vcs + python-pytest + python-setuptools-scm)) (home-page "https://github.com/pytest-dev/pytest-metadata") (synopsis "Access test session metadata with Pytest") (description @@ -749,24 +970,19 @@ access to test session metadata.") (define-public python-pytest-openfiles (package (name "python-pytest-openfiles") - (version "0.5.0") + (version "0.6.0") (source (origin (method url-fetch) - (uri (pypi-uri "pytest-openfiles" version)) + (uri (pypi-uri "pytest_openfiles" version)) (sha256 - (base32 "0n0a7fdc9m86360y96l23fvdmd6rw04bl6h5xqgl9qxfv08jk70p")))) - (build-system python-build-system) - (arguments - '(#: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")))))) + (base32 "14x9f1l9a5ghf527i5qfcfa003mkrky1dhx2hfwq5nma9v1n0lgz")))) + (build-system pyproject-build-system) (native-inputs - (list python-setuptools-scm python-pytest)) + (list python-pytest + python-setuptools + python-setuptools-scm + python-wheel)) (propagated-inputs (list python-psutil)) (home-page "https://github.com/astropy/pytest-openfiles") @@ -790,11 +1006,21 @@ were inadvertently left open at the end of a unit test.") (build-system pyproject-build-system) (arguments (list - #:test-flags #~(list "-k" (string-append - "not test_default_behavior" - " and not test_strict_with_decorator")))) + #:test-flags + #~(list "--numprocesses" (number->string (parallel-job-count)) + "-k" (string-join + ;; Network access is required. + (list "not test_internet_access" + ;; Failed with assertion error. + "test_default_behavior" + "test_strict_with_decorator") + " and not ")))) (native-inputs - (list python-pytest python-setuptools-scm)) + (list python-pytest + python-pytest-xdist + python-setuptools + python-setuptools-scm + python-wheel)) (propagated-inputs (list python-packaging)) (home-page "https://github.com/astropy/pytest-remotedata") @@ -876,23 +1102,25 @@ framework and makes it easy to undo any monkey patching. The fixtures are: (define-public python-pytest-mpl (package (name "python-pytest-mpl") - (version "0.16.1") + (version "0.17.0") (source (origin (method url-fetch) (uri (pypi-uri "pytest-mpl" version)) (sha256 - (base32 "0sa4229xkkah3fdg9wnqnvb9j13xsd3x1h5rwbsgb3sf2a0icmrd")))) + (base32 "1inaaafzxgbxldz4xqvx68gpj8p5i30qlsgva8sb7d34wvbhbvzv")))) (build-system pyproject-build-system) (arguments (list #:test-flags #~(list "-m" "mpl_image_compare"))) (native-inputs - (list python-pytest)) + (list python-pytest + python-setuptools + python-setuptools-scm + python-wheel)) (propagated-inputs (list python-jinja2 python-matplotlib - python-nose python-packaging python-pillow)) (home-page "https://github.com/matplotlib/pytest-mpl") @@ -1045,6 +1273,25 @@ representations of doctest results. It can change the display hook used by doctest to render the object representations.") (license license:expat))) +(define-public python-pytest-check + (package + (name "python-pytest-check") + (version "2.4.1") + (source + (origin + (method url-fetch) + (uri (pypi-uri "pytest_check" version)) + (sha256 + (base32 "0l7n2jhadbkmqr8kzja8zwclhjvhc87qsgr5v867zgsry37fy92j")))) + (build-system pyproject-build-system) + (native-inputs (list python-flit-core)) + (propagated-inputs (list python-pytest)) + (home-page "https://github.com/okken/pytest-check") + (synopsis "Pytest plugin to allow multiple failures") + (description "This package provides a pytest plugin that allows multiple +failures per test.") + (license license:expat))) + (define-public python-pytest-checkdocs (package (name "python-pytest-checkdocs") @@ -1117,7 +1364,11 @@ simpler.") (base32 "01qhbkb3n8c5c4id94w6b06q9wb7b6a33mqwyrkdfzk5pzv1gcyd")))) (build-system pyproject-build-system) (arguments (list #:tests? #false)) ;there are none - (native-inputs (list python-coverage python-pytest)) + (native-inputs + (list python-coverage + python-pytest + python-setuptools + python-wheel)) (home-page "https://github.com/tarpas/pytest-testmon") (synopsis "Selects tests affected by changed files and methods") (description @@ -1127,33 +1378,29 @@ simpler.") (define-public python-pytest-trio (package (name "python-pytest-trio") - (version "0.7.0") + (version "0.8.0") (source (origin (method url-fetch) (uri (pypi-uri "pytest-trio" version)) (sha256 - (base32 "0c8cqf9by2884riksrqymqfp2g1d2d798a2zalcw9hmf34c786y0")))) - (build-system python-build-system) + (base32 "0bmmdyjqj5v4a637i4rzm55crv6v3nj268as6x9nr7m76rixnqw3")))) + (build-system pyproject-build-system) (arguments - `(#:phases - (modify-phases %standard-phases - (replace 'check - (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")))))))) + (list + ;; Tests are broken, see + ;; <https://github.com/python-trio/pytest-trio/issues/84>. + #:tests? #f)) (native-inputs - (list python-hypothesis python-pytest python-pytest-cov)) + (list python-hypothesis + python-pytest + python-setuptools + python-wheel)) (propagated-inputs - (list python-async-generator python-outcome python-pytest 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 @@ -1165,19 +1412,21 @@ friendly library for concurrency and async I/O in Python.") (define-public python-pytest-flake8 (package (name "python-pytest-flake8") - (version "1.0.7") + (version "1.3.0") (source (origin (method url-fetch) - (uri (pypi-uri "pytest-flake8" version)) + (uri (pypi-uri "pytest_flake8" version)) (sha256 (base32 - "0syx68xk5ss3hgp3nr2y122w0fgkzr5936ghsqrkymh3m5hrf9gh")))) - (build-system python-build-system) + "1rhz7mxcg7x9dbabfcjai3zxikfgw7az07m4ddf92bg35ib3byw8")))) + (build-system pyproject-build-system) + (native-inputs + (list python-pytest + python-setuptools + python-wheel)) (propagated-inputs (list python-flake8)) - (native-inputs - (list python-pytest)) (home-page "https://github.com/tholo/pytest-flake8") (synopsis "Pytest plugin to check FLAKE8 requirements") (description @@ -1210,36 +1459,38 @@ isort.") (define-public python-pytest-shutil (package (name "python-pytest-shutil") - (version "1.7.0") + (version "1.8.0") (source (origin (method url-fetch) (uri (pypi-uri "pytest-shutil" version)) (sha256 (base32 - "0q8j0ayzmnvlraml6i977ybdq4xi096djhf30n2m1rvnvrhm45nq")))) - (build-system python-build-system) + "18283zgs3z61paymzf0pp5x3di3hg3m91pvb3v7bmz3fggphdl5a")))) + (build-system pyproject-build-system) (arguments - `(#:phases - (modify-phases %standard-phases - (add-after 'unpack 'use-path-instead-of-path.py - ;; path.py is obsolete. - (lambda _ - (substitute* "setup.py" - (("'path.py'") - "'path'")))) - (add-after 'unpack 'patch-tests - (lambda _ - (mkdir "/tmp/bin") - (substitute* "tests/integration/test_cmdline_integration.py" - (("dirname = '/bin'") - "dirname = '/tmp/bin'") - (("bindir = os.path.realpath\\('/bin'\\)") - "bindir = os.path.realpath('/tmp/bin')"))))))) - (propagated-inputs - (list python-contextlib2 python-execnet python-path python-termcolor)) + (list + #:phases + #~(modify-phases %standard-phases + (add-after 'unpack 'patch-tests + (lambda _ + (mkdir "/tmp/bin") + (substitute* "tests/integration/test_cmdline_integration.py" + (("dirname = '/bin'") + "dirname = '/tmp/bin'") + (("bindir = os.path.realpath\\('/bin'\\)") + "bindir = os.path.realpath('/tmp/bin')"))))))) (native-inputs - (list python-mock python-pytest python-setuptools-git)) + (list python-pytest + python-setuptools + python-setuptools-git + python-wheel)) + (propagated-inputs + (list python-execnet + python-mock + python-path + python-six + python-termcolor)) (home-page "https://github.com/manahl/pytest-plugins") (synopsis "Assorted shell and environment tools for py.test") (description @@ -1271,38 +1522,43 @@ testing framework.") (define-public python-pytest-virtualenv (package (name "python-pytest-virtualenv") - (version "1.7.0") + (version "1.8.0") (source (origin (method url-fetch) (uri (pypi-uri "pytest-virtualenv" version)) (sha256 (base32 - "03w2zz3crblj1p6i8nq17946hbn3zqp9z7cfnifw47hi4a4fww12")))) - (build-system python-build-system) + "1ig1jwgs89r9vxdr12fgxvv9r05bnf5d18lxyn13xciivwwi16al")))) + (build-system pyproject-build-system) (arguments - `(#:phases - (modify-phases %standard-phases - ;; Reference the virtualenv executable directly, to avoid the need - ;; for PYTHONPATH, which gets cleared when instantiating a new - ;; virtualenv with pytest-virtualenv. - (add-after 'unpack 'patch-virtualenv-executable - (lambda* (#:key inputs #:allow-other-keys) - (let* ((virtualenv (assoc-ref inputs "python-virtualenv")) - (virtualenv-bin (string-append virtualenv - "/bin/virtualenv"))) - (substitute* "pytest_virtualenv.py" - (("^DEFAULT_VIRTUALENV_FIXTURE_EXECUTABLE.*$") - (format #f "DEFAULT_VIRTUALENV_FIXTURE_EXECUTABLE = '~a'" - virtualenv-bin))) - #t)))))) - (propagated-inputs - (list python-pytest-shutil python-pytest-fixture-config)) - (inputs - (list python-virtualenv)) + (list + #:test-flags #~(list "--ignore=tests/integration/") + #:phases + #~(modify-phases %standard-phases + ;; Reference the virtualenv executable directly, to avoid the need + ;; for PYTHONPATH, which gets cleared when instantiating a new + ;; virtualenv with pytest-virtualenv. + (add-after 'unpack 'patch-virtualenv-executable + (lambda* (#:key inputs #:allow-other-keys) + (let* ((virtualenv #$(this-package-input "python-virtualenv")) + (virtualenv-bin (string-append virtualenv + "/bin/virtualenv"))) + (substitute* "pytest_virtualenv.py" + (("^DEFAULT_VIRTUALENV_FIXTURE_EXECUTABLE.*$") + (format #f "DEFAULT_VIRTUALENV_FIXTURE_EXECUTABLE = '~a'" + virtualenv-bin))))))))) (native-inputs - (list python-mock python-pytest python-setuptools-git)) - (home-page "https://github.com/manahl/pytest-plugins") + (list python-pytest + python-setuptools + python-setuptools-git + python-wheel)) + (propagated-inputs + (list python-importlib-metadata + python-pytest-shutil + python-pytest-fixture-config + python-virtualenv)) + (home-page "https://github.com/man-group/pytest-plugins") (synopsis "Virtualenv fixture for py.test") (description "This package provides a virtualenv fixture for the py.test framework.") @@ -1426,20 +1682,22 @@ service processes for your tests with pytest.") (file-name (git-file-name name version)) (sha256 (base32 "1wqkr3g5gmqdxmhzfsxbwy8pm3cadaj6a8cxq58w9bacly4hqbh0")))) - (build-system python-build-system) + (build-system pyproject-build-system) (arguments - '(#:phases - (modify-phases %standard-phases - (replace 'check - (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"))))))) + (list + #:phases + #~(modify-phases %standard-phases + (add-before 'check 'pre-check + (lambda* (#:key tests? #:allow-other-keys) + (when tests? + (substitute* "setup.cfg" + ((".*timeout.*") "")))))))) (native-inputs - (list python-pydantic python-pytest python-pytest-isort)) + (list python-pydantic + python-pytest + python-pytest-isort + python-setuptools + python-wheel)) (home-page "https://github.com/samuelcolvin/pytest-toolbox") (synopsis "Numerous useful plugins for Pytest") (description @@ -1468,43 +1726,76 @@ new fixtures, new methods and new comparison objects.") (description "This package provides a pytest plugin for aiohttp support.") (license license:asl2.0))) +(define-public python-nbmake + (package + (name "python-nbmake") + (version "1.5.3") + (source + (origin + (method git-fetch) + (uri (git-reference + (url "https://github.com/treebeardtech/nbmake") + (commit (string-append "v" version)))) + (file-name (git-file-name name version)) + (sha256 + (base32 "06syl819kwqhmjwp34lri31f0pypwnxs9j03s5lbk12w42mihzdi")))) + (build-system pyproject-build-system) + (arguments + (list + #:phases + '(modify-phases %standard-phases + (add-before 'check 'set-HOME + (lambda _ (setenv "HOME" "/tmp")))))) + (propagated-inputs + (list python-ipykernel python-nbclient python-nbformat python-pygments)) + (native-inputs + (list python-poetry-core + python-pytest + python-pytest-xdist + python-pyyaml)) + (home-page "https://github.com/treebeardtech/nbmake") + (synopsis "Pytest plugin for testing notebooks") + (description "This package provides a Pytest plugin for testing Jupyter +notebooks.") + (license license:asl2.0))) + (define-public python-nbval (package (name "python-nbval") - (version "0.9.6") + (version "0.11.0") (source (origin (method url-fetch) (uri (pypi-uri "nbval" version)) (sha256 - (base32 "0h3xrnw0mj1srigrx2rfnd73h8s0xjycclmjs0vx7qkfyqpcvvyg")))) - (build-system python-build-system) + (base32 "154h6xpf9h6spgg3ax6k79fd40j197ipwnfjmf5rc2kvc2bmgjbp")))) + (build-system pyproject-build-system) (arguments - `(#:phases - (modify-phases %standard-phases - (add-before 'check 'fix-test - (lambda _ - ;; This test fails because of a mismatch in the output of LaTeX - ;; equation environments. Seems OK to skip. - (delete-file - "tests/ipynb-test-samples/test-latex-pass-correctouput.ipynb"))) - (replace 'check - (lambda* (#:key tests? #:allow-other-keys) - (when tests? - (invoke "pytest" "-vv" "-k" - (string-append - ;; This only works with Pytest < 5. - "not nbdime_reporter" - ;; https://github.com/computationalmodelling/nbval/pull/148. - " and not test_timeouts" - ;; It seems the output format has changed; the following - ;; test fails with "Unexpected output fields from - ;; running code: {'text/plain'}". - " and not test_conf_ignore_stderr ")))))))) + (list + #:test-flags + '(list + ;; This test fails because of a mismatch in the output of LaTeX + ;; equation environments. Seems OK to skip. + "--ignore=tests/test_nbdime_reporter.py") + #:phases + #~(modify-phases %standard-phases + (add-before 'check 'fix-test + (lambda _ + ;; This test fails because of a mismatch in the output of LaTeX + ;; equation environments. Seems OK to skip. + (delete-file + "tests/ipynb-test-samples/test-latex-pass-correctouput.ipynb")))))) (native-inputs - (list python-pytest python-pytest-cov python-sympy)) + (list python-pytest + python-pytest-cov + python-setuptools + python-sympy + python-wheel)) (propagated-inputs - (list python-ipykernel python-jupyter-client python-nbformat + (list python-coverage + python-ipykernel + python-jupyter-client + python-nbformat python-six)) (home-page "https://github.com/computationalmodelling/nbval") (synopsis "Pytest plugin to validate Jupyter notebooks") @@ -1518,18 +1809,21 @@ also ensuring that the notebooks are running without errors.") (define-public python-pytest-flask (package (name "python-pytest-flask") - (version "1.0.0") + (version "1.3.0") (source (origin (method url-fetch) (uri (pypi-uri "pytest-flask" version)) (sha256 - (base32 - "1hln7mwgdzfi5ma0kqfsi768l7p24jhkw8l0imhifwy08nh7hmjd")))) - (build-system python-build-system) + (base32 "0pm93xli1pvq9w053grndi84hxq087mr2xhagvac98qvnabirgjq")))) + (build-system pyproject-build-system) (native-inputs - (list python-flask python-pytest python-setuptools-scm - python-werkzeug)) + (list python-pytest + python-setuptools + python-setuptools-scm + python-wheel)) + (propagated-inputs + (list python-flask)) (home-page "https://github.com/pytest-dev/pytest-flask") (synopsis "Pytest fixtures to test Flask applications") (description @@ -1620,7 +1914,7 @@ simplify testing of asynchronous tornado applications.") (add-installed-pythonpath inputs outputs) (invoke "pytest" "--verbose"))))))) (propagated-inputs - (list python-pytest python-tornado)) + (list python-pytest python-tornado-6)) (home-page "https://github.com/eukaryote/pytest-tornasync") (synopsis "Pytest plugin for testing Tornado code") (description @@ -1651,6 +1945,44 @@ plain (undecoratored) native coroutine tests.") "This package provides a shim Pytest plugin to enable a Celery marker.") (license license:bsd-3))) +(define-public python-pytest-cython + (package + (name "python-pytest-cython") + (version "0.3.1") + (source + (origin + (method url-fetch) + (uri (pypi-uri "pytest-cython" version)) + (sha256 + (base32 "0ma496dgmmrpgqd3zk6vin29dgajcplh63yqd8jh2a3ai954fr22")))) + (build-system pyproject-build-system) + (arguments + (list + #:test-flags + #~(list "tests" + ;; FIXME: Failed: nomatch: '*sqr*PASSED* + "-k" (string-append + "not test_wrap_cpp_ext_module[importlib]" + " and not test_wrap_c_ext_module[importlib]" + " and not test_cython_ext_module[importlib]")) + #:phases + #~(modify-phases %standard-phases + (add-before 'check 'build-extensions + (lambda _ + (with-directory-excursion "tests/example-project" + (invoke "python" "setup.py" "build_ext" "--inplace"))))))) + (native-inputs + (list python-nox + python-cython-3 + python-setuptools)) + (propagated-inputs + (list python-pytest)) + (home-page "https://github.com/lgpage/pytest-cython") + (synopsis "Cython extension modules testing plugin") + (description + "This package provides a plugin for testing Cython extension modules.") + (license license:expat))) + (define-public python-pytest-env (package (name "python-pytest-env") @@ -1837,7 +2169,11 @@ the implementation of that name.") (("def test_memory_profiler") "def __off_test_memory_profiler"))))))) (native-inputs - (list python-pytest python-pytest-fixture-config python-safety)) + (list python-pytest + python-pytest-fixture-config + python-safety + python-setuptools + python-wheel)) (propagated-inputs (list python-psutil)) (home-page "https://github.com/pythonprofilers/memory_profiler") (synopsis "Memory profiler for Python") @@ -1901,32 +2237,43 @@ supported by the MyPy typechecker.") (define-public python-mypy (package (name "python-mypy") - (version "1.4.1") + (version "1.13.0") (source (origin (method url-fetch) (uri (pypi-uri "mypy" version)) (sha256 (base32 - "06svfmqbnb45pydy8lcrr12wqhhla5dl888w0g4f3wm1ismxkg4v")))) - (build-system python-build-system) + "0pl3plw815824z5gsncnjg3yn2v5wz0gqp20wdrncgmzdwdsd482")))) + (build-system pyproject-build-system) (arguments - `(#:phases - (modify-phases %standard-phases - (replace 'check - (lambda* (#:key tests? #:allow-other-keys) - (when tests? - (invoke "pytest" "mypyc"))))))) + (list + ;; It tries to download hatchling and install aditional test + ;; dependencies. + #:test-flags #~(list "--ignore=mypy/test/testpep561.py") + #:phases + #~(modify-phases %standard-phases + (add-before 'check 'set-home + (lambda _ + ;; The directory '/homeless-shelter/.cache/pip' or its parent + ;; directory is not owned or is not writable by the current + ;; user. + (setenv "HOME" "/tmp")))))) (native-inputs - (list python-attrs + (list nss-certs-for-test + python-attrs python-lxml python-psutil python-pytest python-pytest-forked python-pytest-xdist - python-virtualenv)) + python-setuptools + python-virtualenv + python-wheel)) (propagated-inputs - (list python-mypy-extensions python-tomli python-typing-extensions)) + (list python-mypy-extensions + python-tomli + python-typing-extensions)) (home-page "https://www.mypy-lang.org/") (synopsis "Static type checker for Python") (description "Mypy is an optional static type checker for Python that aims @@ -1946,12 +2293,10 @@ them using any Python VM with basically no runtime overhead.") (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 '())))) + `(#:tests? #f)) + (native-inputs + (list python-setuptools + python-wheel))))) (define-public python-nptyping (package @@ -1978,6 +2323,7 @@ them using any Python VM with basically no runtime overhead.") (native-inputs (list python-beartype python-mypy + python-setuptools python-typeguard python-wheel)) (propagated-inputs (list python-numpy python-typing-extensions)) @@ -1990,40 +2336,38 @@ dtypes and shapes of arrays for NumPy, extending @code{numpy.typing}.") (define-public python-pylama (package (name "python-pylama") - (version "7.7.1") + (version "8.4.1") (source (origin - (method url-fetch) - (uri (pypi-uri "pylama" version)) + (method git-fetch) ;no tests in PyPI archive + (uri (git-reference + (url "https://github.com/klen/pylama") + (commit version))) + (file-name (git-file-name name version)) (sha256 - (base32 - "13vx7daqz2918y9s8q3v2i3xaq3ah43a9p58srqi6hqskkpm7blv")))) - (build-system python-build-system) + (base32 "1x9cnyfnd574mj8ckd5hbfg2wy128zg0k2cd3zc7vdbnimksvqaq")))) + (build-system pyproject-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")))))) + (list + ;; Cycles with pylint: python-pylama -> python-isort -> python-pylint -> + ;; python-pylama + #:tests? #f)) (native-inputs - (list python-py python-pytest python-radon)) + (list python-setuptools + python-wheel)) (propagated-inputs - `(("python-mccabe" ,python-mccabe) - ("python-mypy", python-mypy-minimal) - ("python-pycodestyle" ,python-pycodestyle) - ("python-pydocstyle" ,python-pydocstyle) - ("python-pyflakes" ,python-pyflakes))) + (list python-mypy-minimal + python-mccabe + python-pycodestyle + python-pydocstyle + 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.") + (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 @@ -2066,6 +2410,41 @@ from Python files. It does this by detecting block comments that contain valid Python syntax that are likely to be commented out code.") (license license:expat))) +(define-public python-expecttest + (let ((commit "683b09a352cc426851adc2e3a9f46e0ab25e4dee") + (revision "0")) + (package + (name "python-expecttest") + (version (git-version "0.2.1" revision commit)) + (source + (origin + (method git-fetch) + (uri (git-reference + (url "https://github.com/ezyang/expecttest") + (commit commit))) + (file-name (git-file-name name version)) + (sha256 + (base32 + "1djwxp9x1hczzxbimv1b1bmd083am88v27l82nmlkhvzyg2cmpvv")))) + (build-system pyproject-build-system) + (arguments + (list + #:phases + #~(modify-phases %standard-phases + (replace 'check + (lambda* (#:key tests? #:allow-other-keys) + (when tests? + ;; The test runs tests expected to fail, so the output is + ;; confusing + (invoke "python3" "test_expecttest.py"))))))) + (native-inputs (list python-hypothesis poetry)) + (home-page "https://github.com/ezyang/expecttest") + (synopsis "Python module for expect tests") + (description "@code{expecttest} is a Python module for expect tests, where +the initial expected value of a test can be automatically set by running the +test itself.") + (license license:expat)))) + (define-public python-robber (package (name "python-robber") @@ -2093,23 +2472,30 @@ behavior-driven development (TDD and BDD).") (define-public python-slotscheck (package (name "python-slotscheck") - (version "0.17.0") - (home-page "https://github.com/ariebovenberg/slotscheck") - (source (origin - (method git-fetch) - (uri (git-reference (url home-page) - (commit (string-append "v" version)))) - (file-name (git-file-name name version)) - (sha256 - (base32 - "0k5jjabd219ndlssfqcdb5sn891ffrxzw84l5r8pirzy74i7znr4")))) + (version "0.19.0") + (source + (origin + (method git-fetch) + (uri (git-reference + (url "https://github.com/ariebovenberg/slotscheck") + (commit (string-append "v" version)))) + (file-name (git-file-name name version)) + (sha256 + (base32 "1lakwgk20aq92sqdwsswnll2w3y6p42x8abb9q8fc2qvw3xhw2vh")))) (build-system pyproject-build-system) + (arguments + (list + ;; Optional: ModuleNotFoundError: No module named 'mypyc' + #:test-flags #~(list "-k" "not test_extension_package"))) (native-inputs (list python-poetry-core - python-pydantic python-pytest - python-pytest-mock)) - (propagated-inputs (list python-click python-tomli)) + python-pytest-mock + python-ujson)) + (propagated-inputs + (list python-click + python-tomli)) + (home-page "https://github.com/ariebovenberg/slotscheck") (synopsis "Ensure @code{__slots__} are working properly") (description "@code{slotscheck} is a tool to validate Python class @code{__slots__}.") @@ -2148,6 +2534,35 @@ execution of a test suite. It will also store a history of all test runs to help in debugging failures and optimizing the scheduler to improve speed.") (license license:asl2.0))) +(define-public python-pytest-subprocess + (package + (name "python-pytest-subprocess") + (version "1.5.0") + (source + (origin + (method git-fetch) ;no tests in PyPI archive + (uri (git-reference + (url "https://github.com/aklajnert/pytest-subprocess") + (commit version))) + (file-name (git-file-name name version)) + (sha256 + (base32 + "103nxv37sjvxlwmw87hxsrphkxkryv4dgb65kjjfr4722r37vmxv")))) + (build-system pyproject-build-system) + (native-inputs (list python-anyio + python-coverage + python-docutils + python-nox + python-pygments + python-pytest + python-pytest-asyncio + python-pytest-rerunfailures)) + (home-page "https://github.com/aklajnert/pytest-subprocess") + (synopsis "Fake subprocess for Pytest") + (description + "This package provides a plugin to fake subprocess for Pytest.") + (license license:expat))) + ;; This is only used by python-sanic (define-public python-pytest-sanic (package @@ -2172,7 +2587,7 @@ help in debugging failures and optimizing the scheduler to improve speed.") (lambda _ (substitute* "setup.py" (("websockets.*<11.0") - "websockets<12.0"))))))) + "websockets<13.0"))))))) (propagated-inputs (list python-httpx python-async-generator python-pytest python-websockets)) @@ -2204,42 +2619,6 @@ reducing a number of combinations of variables into a lesser set that covers most situations.") (license license:expat))) -(define-public python-pytest-mp - (package - (name "python-pytest-mp") - (version "0.0.4p2") - (source - (origin - (method git-fetch) - (uri (git-reference - (url "https://github.com/ansible/pytest-mp") - (commit "49a8ff2ca9ef62d8c86854ab31d6b5d5d6cf3f28"))) - (file-name (git-file-name name version)) - (sha256 - (base32 "01v98b6n3yvkfmxf2v38xk5ijqlk6ika0yljwkhl5bh6qhq23498")))) - (build-system python-build-system) - (propagated-inputs - (list python-pytest python-psutil)) - (arguments - ;; tests require setuptools-markdown, which is deprecated and not in guix - '(#:tests? #f - #:phases - (modify-phases %standard-phases - (add-after 'unpack 'remove-useless-requirements - (lambda _ - (substitute* "setup.py" - ((" setup_requires=") " #"))))))) - (home-page "https://github.com/ansible/pytest-mp") - (synopsis "Segregate tests into several processes") - (description "pytest-mp is a minimalist approach to distribute and -segregate pytest tests across processes using python's multiprocessing library -and is heavily inspired by pytest-concurrent and pytest-xdist. As a very -early beta, it doesn't pledge or intend to support the majority of platforms -or use cases. Design is based on supporting slow, io-bound testing with often -tedious system under test configuration that can benefit from running several -tests at one time.") - (license license:expat))) - (define-public python-aioresponses (package (name "python-aioresponses") @@ -2266,7 +2645,7 @@ tests at one time.") (native-inputs (list python-pbr python-ddt python-pytest)) (propagated-inputs - (list python-aiohttp)) + (list python-aiohttp python-setuptools)) (home-page "https://github.com/pnuckowski/aioresponses") (synopsis "Mock out requests made by ClientSession from aiohttp package") (description @@ -2417,6 +2796,17 @@ in an opinionated way.") eliminate flaky failures.") (license license:mpl2.0))) +(define-public python-pytest-rerunfailures-13 + (package + (inherit python-pytest-rerunfailures) + (version "13.0") + (source + (origin + (method url-fetch) + (uri (pypi-uri "pytest-rerunfailures" version)) + (sha256 + (base32 "16cin0chv59w4rvnd6r0fisp0s8avmp07rwn9da6yixw43jdncp1")))))) + (define-public python-xunitparser (package (name "python-xunitparser") @@ -2503,7 +2893,9 @@ which make writing and running functional and integration tests easier.") (native-inputs (list python-jinja2 python-pytest - python-tox)) + python-tox + python-setuptools + python-wheel)) (home-page "https://nox.thea.codes/") (synopsis "Flexible test automation") (description @@ -2644,7 +3036,7 @@ parametrize. This plugin allows you to use all four.") (define-public python-pytest-httpx (package (name "python-pytest-httpx") - (version "0.22.0") + (version "0.34.0") (source (origin ;; pypi package doesn't include the tests @@ -2654,10 +3046,14 @@ parametrize. This plugin allows you to use all four.") (commit (string-append "v" version)))) (file-name (git-file-name name version)) (sha256 - (base32 "1ncpd74hmsz4sadvjg99fnfscxpgh3mc2siini0dhxzwgwdkk5i7")))) + (base32 "0dk1z9zy483nffbmn883mcjrlwkn79c3sqlxf6qnwcgrvdw1w9zz")))) (build-system pyproject-build-system) + (native-inputs + (list python-pytest + python-pytest-asyncio + python-setuptools + python-wheel)) (propagated-inputs (list python-httpx)) - (native-inputs (list python-pytest python-pytest-asyncio)) (home-page "https://colin-b.github.io/pytest_httpx/") (synopsis "Pytest plugin to mock httpx") (description "This package provides a pytest fixture to mock httpx @@ -2734,7 +3130,11 @@ running acceptance tests on headless servers.") ;; skip test that uses python-pint ;; pint has many dependencies "not test_whitelists_with_python"))))))) - (native-inputs (list python-pytest python-pytest-cov)) + (native-inputs + (list python-pytest + python-pytest-cov + python-setuptools + python-wheel)) (propagated-inputs (list python-toml)) (home-page "https://github.com/jendrikseipp/vulture") (synopsis "Find dead Python code") @@ -2746,3 +3146,57 @@ dynamic nature, static code analyzers like Vulture are likely to miss some dead code. Also, code that is only called implicitly may be reported as unused.") (license license:expat))) + +(define-public python-green + (package + (name "python-green") + (version "4.0.2") + (source + (origin + (method url-fetch) + (uri (pypi-uri "green" version)) + (sha256 + (base32 "1cd62nbn5dvlpnsyplp6cb24wd230san8dpm6pnl99n2kwzpq1m4")))) + (build-system pyproject-build-system) + (arguments + (list + #:test-flags #~(list "-vr" "green") + #:phases + #~(modify-phases %standard-phases + (replace 'check + (lambda* (#:key tests? test-flags #:allow-other-keys) + (when tests? + (apply invoke "python" "-m" "green" test-flags))))))) + (native-inputs + (list python-mypy + python-setuptools + python-testtools + python-wheel)) + (propagated-inputs + (list python-colorama + python-coverage + python-lxml + python-unidecode)) + (home-page "https://github.com/CleanCut/green") + (synopsis "Clean, colorful, fast Python test runner") + (description + "@code{green} is a Python test runner that describes itself as: +@table @emph +@item Clean +Low redundancy in output. Result statistics for each test is vertically aligned. +@item Colorful +Terminal output makes good use of color when the terminal supports it. +@item Fast +Tests run in independent processes (one per processor by default). +@item Powerful +Multi-target and auto-discovery support. +@item Traditional +It uses the normal @code{unittest} classes and methods. +@item Descriptive +Multiple verbosity levels, from just dots to full docstring output. +@item Convenient +Bash-completion and ZSH-completion of options and test targets. +@item Thorough +Built-in integration with @url{http://nedbatchelder.com/code/coverage/, coverage}. +@end table") + (license license:expat))) |