projects/guix·blob onnx · refs

5588 lines · 205.0 KiB

1;;; GNU Guix --- Functional package management for GNU
2;;; Copyright © 2015, 2017 Cyril Roelandt <[email protected]>
3;;; Copyright © 2015, 2019-2021, 2025 Efraim Flashner <[email protected]>
4;;; Copyright © 2016-2022 Marius Bakke <[email protected]>
5;;; Copyright © 2016 宋文武 <[email protected]>
6;;; Copyright © 2017 Muriithi Frederick Muriuki <[email protected]>
7;;; Copyright © 2017 Thomas Danckaert <[email protected]>
8;;; Copyright © 2018 Fis Trivial <[email protected]>
9;;; Copyright © 2018-2020 Tobias Geerinckx-Rice <[email protected]>
10;;; Copyright © 2019-2025 Ricardo Wurmus <[email protected]>
11;;; Copyright © 2019-2025 Maxim Cournoyer <[email protected]>
12;;; Copyright © 2019, 2021, 2025 Hartmut Goebel <[email protected]>
13;;; Copyright © 2020, 2022 Julien Lepiller <[email protected]>
14;;; Copyright © 2020 Matthew James Kraai <[email protected]>
15;;; Copyright © 2020 Edouard Klein <[email protected]>
16;;; Copyright © 2020, 2021, 2025, 2026 Vinicius Monego <[email protected]>
17;;; Copyright © 2020 Tanguy Le Carrour <[email protected]>
18;;; Copyright © 2021 Hugo Lecomte <[email protected]>
19;;; Copyright © 2021 Lars-Dominik Braun <[email protected]>
20;;; Copyright © 2021-2025 Sharlatan Hellseher <[email protected]>
21;;; Copyright © 2021 Brendan Tildesley <[email protected]>
22;;; Copyright © 2021 Giacomo Leidi <[email protected]>
23;;; Copyright © 2021, 2022 Guillaume Le Vaillant <[email protected]>
24;;; Copyright © 2021 Bonface Munyoki Kilyungi <[email protected]>
25;;; Copyright © 2021 Sebastian Gibb <[email protected]>
26;;; Copyright © 2022 Malte Frank Gerdes <[email protected]>
27;;; Copyright © 2022 Felix Gruber <[email protected]>
28;;; Copyright © 2022 Tomasz Jeneralczyk <[email protected]>
29;;; Copyright © 2022 jgart <[email protected]>
30;;; Copyright © 2023 Antero Mejr <[email protected]>
31;;; Copyright © 2023 John Kehayias <[email protected]>
32;;; Copyright © 2024 Danny Milosavljevic <[email protected]>
33;;; Copyright © 2024-2025 Troy Figiel <[email protected]>
34;;; Copyright © 2024 Navid Afkhami <[email protected]>
35;;; Copyright © 2024, 2025 David Elsing <[email protected]>
36;;; Copyright © 2024 Eric Bavier <[email protected]>
37;;; Copyright © 2024 Markku Korkeala <[email protected]>
38;;; Copyright © 2024 Vincent Prat <[email protected]>
39;;; Copyright © 2025 Evgeny Pisemsky <[email protected]>
40;;; Copyright © 2025 Florent Pruvost <[email protected]>
41;;; Copyright © 2025 Matthew Elwin <[email protected]>
42;;; Copyright © 2025 Nicolas Graves <[email protected]>
43;;; Copyright © 2025 Sergio Pastor Pérez <[email protected]>
44;;; Copyright © 2025 Zheng Junjie <[email protected]>
45;;; Copyright © 2026 Nguyễn Gia Phong <[email protected]>
46;;; Copyright © 2026 bdunahu <[email protected]>
47;;;
48;;; This file is part of GNU Guix.
49;;;
50;;; GNU Guix is free software; you can redistribute it and/or modify it
51;;; under the terms of the GNU General Public License as published by
52;;; the Free Software Foundation; either version 3 of the License, or (at
53;;; your option) any later version.
54;;;
55;;; GNU Guix is distributed in the hope that it will be useful, but
56;;; WITHOUT ANY WARRANTY; without even the implied warranty of
57;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
58;;; GNU General Public License for more details.
59;;;
60;;; You should have received a copy of the GNU General Public License
61;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>.
62
63(define-module (gnu packages python-check)
64 #:use-module (gnu packages)
65 #:use-module (gnu packages admin)
66 #:use-module (gnu packages autotools)
67 #:use-module (gnu packages base)
68 #:use-module (gnu packages bash)
69 #:use-module (gnu packages build-tools)
70 #:use-module (gnu packages cmake)
71 #:use-module (gnu packages nss)
72 #:use-module (gnu packages check)
73 #:use-module (gnu packages compression)
74 #:use-module (gnu packages databases)
75 #:use-module (gnu packages django)
76 #:use-module (gnu packages docker)
77 #:use-module (gnu packages jemalloc)
78 #:use-module (gnu packages jupyter)
79 #:use-module (gnu packages maths)
80 #:use-module (gnu packages mpi)
81 #:use-module (gnu packages openstack)
82 #:use-module (gnu packages perl)
83 #:use-module (gnu packages pkg-config)
84 #:use-module (gnu packages python-build)
85 #:use-module (gnu packages python-science)
86 #:use-module (gnu packages python-web)
87 #:use-module (gnu packages python-xyz)
88 #:use-module (gnu packages qt)
89 #:use-module (gnu packages sphinx)
90 #:use-module (gnu packages time)
91 #:use-module (gnu packages version-control)
92 #:use-module (gnu packages web)
93 #:use-module (gnu packages xml)
94 #:use-module (gnu packages xdisorg)
95 #:use-module (gnu packages xorg)
96 #:use-module ((guix licenses) #:prefix license:)
97 #:use-module (guix build-system cargo)
98 #:use-module (guix build-system gnu)
99 #:use-module (guix build-system pyproject)
100 #:use-module (guix deprecation)
101 #:use-module (guix download)
102 #:use-module (guix gexp)
103 #:use-module (guix git-download)
104 #:use-module (guix hg-download)
105 #:use-module (guix packages)
106 #:use-module (guix utils))
107
108(define-public austin
109 (package
110 (name "austin")
111 (version "4.0.0")
112 (source
113 (origin
114 (method git-fetch)
115 (uri (git-reference
116 (url "https://github.com/P403n1x87/austin")
117 (commit (string-append "v" version))))
118 (sha256
119 (base32 "0h52z214w1xbx96i222c3syf2g2j9q762v39wcncaxhk2sa07xhn"))
120 (file-name (git-file-name name version))))
121 (build-system gnu-build-system)
122 (native-inputs (list autoconf automake))
123 (home-page "https://github.com/P403n1x87/austin")
124 (synopsis "Python frame stack sampler for CPython")
125 (description
126 "Austin is a Python frame stack sampler for CPython. Samples are
127collected by reading the CPython interpreter virtual memory space to retrieve
128information about the currently running threads along with the stack of the
129frames that are being executed. Austin's binary output can be piped into any
130other external or custom tools for further processing.")
131 (license (list license:gpl3+
132 license:unlicense)))) ;src/ansi.h
133
134(define-public python-aioresponses
135 (package
136 (name "python-aioresponses")
137 (version "0.7.2")
138 (source
139 (origin
140 (method git-fetch)
141 (uri (git-reference
142 (url "https://github.com/pnuckowski/aioresponses")
143 (commit version)))
144 (file-name (git-file-name name version))
145 (sha256
146 (base32 "0fcm1rl1h91c2ca446kl5r2q229a8cfad2xn9gmsmdvn29wm35kc"))))
147 (build-system pyproject-build-system)
148 (arguments
149 (list
150 #:test-flags
151 #~(list
152 "tests" "-k"
153 (string-append
154 ;; These tests require network access.
155 "not test_address_as_instance_of_url_combined_with_pass_through "
156 "and not test_pass_through_with_origin_params"))))
157 (native-inputs (list python-pbr python-ddt python-pytest python-setuptools))
158 (propagated-inputs (list python-aiohttp))
159 (home-page "https://github.com/pnuckowski/aioresponses")
160 (synopsis "Mock out requests made by ClientSession from aiohttp package")
161 (description
162 "Aioresponses is a helper to mock/fake web requests in python aiohttp
163package. For requests module there are a lot of packages that help us with
164testing (eg. httpretty, responses, requests-mock). When it comes to testing
165asynchronous HTTP requests it is a bit harder (at least at the beginning).
166The purpose of this package is to provide an easy way to test asynchronous
167HTTP requests.")
168 (license license:expat)))
169
170(define-public python-aiounittest
171 (package
172 (name "python-aiounittest")
173 (version "1.5.0")
174 (source
175 (origin
176 (method git-fetch)
177 (uri (git-reference
178 (url "https://github.com/kwarunek/aiounittest.git")
179 (commit version)))
180 (file-name (git-file-name name version))
181 (sha256
182 (base32 "0266i5z589jh75hjzakvwcqx5shgv5zis8mr70qa209v7jjclzfd"))))
183 (build-system pyproject-build-system)
184 (native-inputs
185 (list python-pytest
186 python-setuptools))
187 (propagated-inputs
188 (list python-wrapt))
189 (home-page "https://github.com/kwarunek/aiounittest")
190 (synopsis "Test asyncio code more easily")
191 (description
192 "Aiounittest is a library that helps write tests using asynchronous code
193in Python (asyncio).")
194 (license license:expat)))
195
196(define-public python-allpairspy
197 (package
198 (name "python-allpairspy")
199 (version "2.5.1")
200 (source
201 (origin
202 (method url-fetch)
203 (uri (pypi-uri "allpairspy" version))
204 (sha256
205 (base32 "1zh983y9k5idna677vsjlfxlzm1dfff3w1n63sfi3vkfnnik37gn"))))
206 (build-system pyproject-build-system)
207 (native-inputs
208 (list python-pytest
209 python-setuptools))
210 (home-page "https://github.com/thombashi/allpairspy")
211 (synopsis "Pairwise test combinations generator")
212 (description
213 "This is a Python library for test combinations generator. The generator
214allows one to create a set of tests using @emph{pairwise combinations} method,
215reducing a number of combinations of variables into a lesser set that covers
216most situations.")
217 (license license:expat)))
218
219(define-public python-approval-utilities
220 (package
221 (name "python-approval-utilities")
222 (version "15.3.2")
223 (source
224 (origin
225 (method git-fetch)
226 (uri (git-reference
227 (url "https://github.com/approvals/ApprovalTests.Python")
228 (commit (string-append "v" version))))
229 (file-name (git-file-name name version))
230 (sha256
231 (base32 "0mkvrx252xc140n4rrvgbqc1hrlw1gq7nx5hr1z4rxkaxvr8prkh"))))
232 (build-system pyproject-build-system)
233 (arguments
234 (list
235 #:tests? #f ; Tests are run in the python-approvaltests package.
236 #:phases
237 #~(modify-phases %standard-phases
238 (add-after 'unpack 'setup
239 (lambda _
240 (rename-file "setup/setup.approval_utilities.py"
241 "setup.py")
242 (substitute* "setup.py"
243 (("from setup_utils import get_version")
244 "")
245 (("version=get_version\\(\\),")
246 (format #f "version=~s," #$version))))))))
247 (native-inputs (list python-setuptools))
248 (home-page "https://github.com/approvals/ApprovalTests.Python")
249 (synopsis "Utilities for @code{python-approvaltests}")
250 (description
251 "This package provides utilities for production code that work well with
252@code{python-approvaltests}.")
253 (license license:asl2.0)))
254
255(define-public python-approvaltests
256 (package/inherit python-approval-utilities
257 (name "python-approvaltests")
258 (version (package-version python-approval-utilities))
259 (arguments
260 (list
261 #:tests? #f ; Tests are run in the python-approvaltests package.
262 #:phases
263 #~(modify-phases %standard-phases
264 (add-after 'unpack 'chdir
265 (lambda _
266 (substitute* "setup/setup_utils.py"
267 (("version=get_version\\(\\),")
268 (format #f "version=~s," #$version))
269 (("\\(get_parent_directory\\(\\)\\.parent / ")
270 "Path("))
271 (rename-file "setup/setup.py"
272 "setup.py")
273 ;; Assume the chdir.
274 (substitute* "setup.py"
275 (("\\.\\.")
276 "."))
277 (rename-file "setup/setup_utils.py"
278 "setup_utils.py"))))))
279 (native-inputs (list python-setuptools))
280 (propagated-inputs
281 (list python-allpairspy
282 python-approval-utilities
283 python-beautifulsoup4
284 python-empty-files
285 python-mock
286 python-pyperclip
287 python-pytest
288 python-testfixtures
289 python-typing-extensions))
290 (home-page "https://github.com/approvals/ApprovalTests.Python")
291 (synopsis "Assertion/verification library to aid testing")
292 (description
293 "This package provides tools verify objects that require more than a
294simple assert including long strings, large arrays, and complex hash
295structures and objects, i.e. when you need a more granular look at the test
296failure.")
297 (license license:asl2.0)))
298
299(define-public python-assay
300 ;; No release yet.
301 (let ((commit "74617d70e77afa09f58b3169cf496679ac5d5621")
302 (revision "0"))
303 (package
304 (name "python-assay")
305 (version (git-version "0.0.0" revision commit))
306 (source
307 (origin
308 (method git-fetch)
309 (uri (git-reference
310 (url "https://github.com/brandon-rhodes/assay")
311 (commit commit)))
312 (file-name (git-file-name name version))
313 (sha256
314 (base32 "1klxmamj88mn0q348r08zksccgsbch8sp0m4b04s3myrqnslp2nd"))))
315 (build-system pyproject-build-system)
316 (arguments
317 (list
318 #:test-flags #~(list "-m" "assay.tests")
319 #:phases
320 #~(modify-phases %standard-phases
321 (replace 'check
322 (lambda* (#:key tests? test-flags #:allow-other-keys)
323 (when tests?
324 (apply invoke "python" test-flags)))))))
325 (native-inputs
326 (list python-setuptools python-wheel))
327 (home-page "https://github.com/brandon-rhodes/assay")
328 (synopsis "Python testing framework")
329 (description
330 "This package provides opiniotated Python test framework prototype.")
331 (license license:expat))))
332
333(define-public python-assertpy
334 (package
335 (name "python-assertpy")
336 (version "1.1")
337 (source
338 (origin
339 (method git-fetch) ;no tests in PyPI distribution
340 (uri (git-reference
341 (url "https://github.com/assertpy/assertpy")
342 (commit version)))
343 (file-name (git-file-name name version))
344 (sha256
345 (base32 "0hnfh45cmqyp7zasrllwf8gbq3mazqlhhk0sq1iqlh6fig0yfq2f"))))
346 (build-system pyproject-build-system)
347 (native-inputs (list python-pytest python-setuptools))
348 (home-page "https://github.com/assertpy/assertpy")
349 (synopsis "Simple assertion library for unit testing")
350 (description
351 "This package provides a simple assertion library for unit testing in
352Python with a fluent API.")
353 (license license:bsd-3)))
354
355(define-public python-atpublic
356 (package
357 (name "python-atpublic")
358 (version "3.1.1")
359 (source
360 (origin
361 (method url-fetch)
362 (uri (pypi-uri "atpublic" version))
363 (sha256
364 (base32
365 "060v2b5jfn7p99j09amxlb6w9ynwbq7fix31kl0caz0hs09fx61h"))))
366 (build-system pyproject-build-system)
367 (arguments (list #:build-backend "pdm.backend"))
368 (native-inputs
369 (list python-pytest python-pdm-backend python-sybil))
370 (home-page "https://public.readthedocs.io/")
371 (synopsis "@code{@@public} decorator for populating @code{__all__}")
372 (description
373 "This Python module adds a @code{@@public} decorator and function which
374populates a module's @code{__all__} and optionally the module globals. With
375it, the declaration of a name's public export semantics are not separated from
376the implementation of that name.")
377 (license (list license:asl2.0
378 license:lgpl3)))) ; only for setup_helpers.py
379
380(define-public python-autopep8
381 (package
382 (name "python-autopep8")
383 (version "2.3.2")
384 (source
385 (origin
386 (method url-fetch)
387 (uri (pypi-uri "autopep8" version))
388 (sha256
389 (base32 "0n0pjdk39n6vlddjqvbpkxd4a7q33dkf0k2yk6dbd5wijr7hli49"))))
390 (build-system pyproject-build-system)
391 (propagated-inputs
392 (list python-pycodestyle python-tomli))
393 (native-inputs
394 (list python-setuptools))
395 (arguments
396 `(#:phases
397 (modify-phases %standard-phases
398 (add-before 'check 'prepare-check
399 (lambda _
400 (setenv "HOME" "/tmp"))))))
401 (home-page "https://github.com/hhatto/autopep8")
402 (synopsis "Format Python code according to the PEP 8 style guide")
403 (description
404 "@code{autopep8} automatically formats Python code to conform to
405the PEP 8 style guide. It uses the pycodestyle utility to determine
406what parts of the code needs to be formatted. @code{autopep8} is
407capable of fixing most of the formatting issues that can be reported
408by pycodestyle.")
409 (license (license:non-copyleft
410 "https://github.com/hhatto/autopep8/blob/master/LICENSE"))))
411
412(define-public python-avocado-framework
413 (package
414 (name "python-avocado-framework")
415 (version "96.0")
416 (source
417 (origin
418 (method url-fetch)
419 (uri (pypi-uri "avocado-framework" version))
420 (sha256
421 (base32 "0zhz6423p0b5gqx2mvg7dmq8m9gbsay7wqjdwzirlwcg2v3rcz0m"))))
422 (build-system pyproject-build-system)
423 (arguments
424 (list
425 ;; The test suite hangs, due to a serious bug in Python/Avocado (see:
426 ;; https://github.com/avocado-framework/avocado/issues/4935).
427 #:tests? #f
428 #:phases
429 #~(modify-phases %standard-phases
430 (add-after 'unpack 'patch-paths
431 (lambda* (#:key native-inputs inputs #:allow-other-keys)
432 ;; These are runtime dependencies (inputs).
433 (substitute* "avocado/plugins/spawners/podman.py"
434 (("default='/usr/bin/podman'")
435 "default='podman'"))
436 (substitute* "avocado/utils/podman.py"
437 (("\"/usr/bin/env\", \"python3\"")
438 (format #f "~s" (search-input-file inputs "bin/python"))))
439 (substitute* "avocado/utils/memory.py"
440 (("\"sync\"")
441 (format #f "~s" (search-input-file inputs "bin/sync")))
442 (("/bin/sh")
443 (search-input-file inputs "bin/sh")))
444 ;; Batch process the tests modules with less care; if something
445 ;; is wrong, the test suite will fail. These are tests
446 ;; dependencies (native inputs).
447 (substitute* (find-files "selftests" "\\.py$")
448 (("#!/usr/bin/env")
449 (string-append "#!" (search-input-file (or native-inputs inputs)
450 "bin/env")))
451 (("/bin/(false|true|sh|sleep|sudo)" _ name)
452 (search-input-file (or native-inputs inputs)
453 (string-append "bin/" name))))))
454 (add-after 'unpack 'remove-broken-entrypoints
455 ;; The avocado-external-runner entry point fails to load, the
456 ;; 'scripts' top level package not being found (see:
457 ;; https://github.com/avocado-framework/avocado/issues/5370).
458 (lambda _
459 (substitute* "setup.py"
460 (("'avocado-external-runner = scripts.external_runner:main'.*")
461 ""))))
462 (replace 'check
463 (lambda* (#:key tests? #:allow-other-keys)
464 (when tests?
465 (setenv "HOME" "/tmp")
466 (setenv "PYTHONPATH" (getcwd))
467 (invoke "./selftests/check.py" "--skip" "static-checks")))))))
468 (native-inputs (list bash-minimal coreutils-minimal perl sudo
469 python-setuptools))
470 (inputs (list bash-minimal coreutils-minimal))
471 (home-page "https://avocado-framework.github.io/")
472 (synopsis "Tools and libraries to help with automated testing")
473 (description "Avocado is a set of tools and libraries to help with
474automated testing, i.e. a test framework. Native tests are written in Python
475and they follow the unittest pattern, but any executable can serve as a
476test. The following output formats are supported:
477@table @asis
478@item xUnit
479an XML format that contains test results in a structured form, and are used by
480other test automation projects, such as Jenkins.
481@item JSON
482a widely used data exchange format. The JSON Avocado plugin outputs job
483information, similarly to the xunit output plugin.
484@item TAP
485Provides the basic TAP (Test Anything Protocol) results. Unlike most existing
486Avocado machine readable outputs this one is streamlined (per test results).
487@end table")
488 (license license:gpl2))) ;some files are under GPLv2 only
489
490(define-public python-bandit
491 (package
492 (name "python-bandit")
493 (version "1.8.6")
494 (source
495 (origin
496 (method url-fetch)
497 (uri (pypi-uri "bandit" version))
498 (sha256
499 (base32 "0sz5lkg9anqz6ir157xr8ng9ymgj37ymbplkhl3w4qb9zhjrrznv"))))
500 (build-system pyproject-build-system)
501 (arguments
502 (list #:tests? #f)) ;tests require complex setup and networking
503 (native-inputs
504 (list python-setuptools))
505 (propagated-inputs
506 (list python-pyyaml
507 python-rich
508 python-stevedore))
509 (home-page "https://github.com/PyCQA/bandit")
510 (synopsis "Security oriented static analyser for python code")
511 (description
512 "Bandit is a tool designed to find common security issues in Python code.
513To do this Bandit processes each file, builds an AST from it, and runs
514appropriate plugins against the AST nodes. Once Bandit has finished scanning
515all the files it generates a report.")
516 (license license:asl2.0)))
517
518(define-public python-beartype
519 (package
520 (name "python-beartype")
521 (version "0.21.0")
522 (source
523 (origin
524 (method url-fetch)
525 (uri (pypi-uri "beartype" version))
526 (sha256
527 (base32 "0i1j1mkcw0fgms9qg7j30nlgcr0b0ndx2l98sb162wp8bj7hg9gr"))))
528 (build-system pyproject-build-system)
529 (native-inputs
530 (list python-hatchling python-pytest))
531 (home-page "https://github.com/beartype/beartype")
532 (synopsis "Fast runtime type checking for Python")
533 (description "Beartype aims to be a very fast runtime type checking tool
534written in pure Python.")
535 (license license:expat)))
536
537(define-public python-blockbuster
538 (package
539 (name "python-blockbuster")
540 (version "1.5.26")
541 (source
542 (origin
543 (method git-fetch)
544 (uri (git-reference
545 (url "https://github.com/cbornet/blockbuster")
546 (commit (string-append "v" version))))
547 (file-name (git-file-name name version))
548 (sha256
549 (base32 "16ycwblivp6d7s78sxq97f9xb4vxcjfr5srxhpkpssv770lp37fs"))))
550 (build-system pyproject-build-system)
551 ;; test_ssl_socket wants to connects to the Internet.
552 (arguments (list #:test-flags #~'("-k" "not test_ssl_socket")))
553 (native-inputs (list python-hatchling
554 python-pytest
555 python-pytest-asyncio
556 python-requests))
557 (propagated-inputs (list python-forbiddenfruit))
558 (home-page "https://github.com/cbornet/blockbuster")
559 (synopsis "Utility to detect blocking calls in Python async event loop")
560 (description
561 "Blockbuster is a Python package designed to detect and prevent
562blocking calls within an asynchronous event loop. It is particularly useful
563when executing tests to ensure that your asynchronous code
564does not inadvertently call blocking operations,
565which can lead to performance bottlenecks and unpredictable behavior.
566
567It does this by wrapping common blocking functions
568and raising an exception when they are called within an asynchronous context.
569Note that Blockbuster currently only detects @code{asyncio} event loops
570and is tested only with CPython.")
571 (license license:asl2.0)))
572
573(define-public python-codacy-coverage
574 (package
575 (name "python-codacy-coverage")
576 (version "1.3.11")
577 (source
578 (origin
579 (method git-fetch)
580 (uri (git-reference
581 (url "https://github.com/codacy/python-codacy-coverage")
582 (commit version)))
583 (file-name (git-file-name name version))
584 (sha256
585 (base32 "1cxq2c6wyzynqjvc5szyhwvzdz4g3a4dv6bx80w4k4d9p40699hv"))))
586 (build-system pyproject-build-system)
587 (arguments
588 (list
589 ;; XXX: Pytest is unable to find tests, even with common tricks.
590 ;; TODO: Run tox.ini unittests after next python-team merge.
591 #:tests? #f))
592 (native-inputs (list python-setuptools python-wheel))
593 (propagated-inputs (list python-check-manifest python-requests))
594 (home-page "https://github.com/codacy/python-codacy-coverage")
595 (synopsis "Codacy coverage reporter for Python")
596 (description
597 "This package analyses Python test suites and reports how much of the
598code is covered by them. This tool is part of the Codacy suite for analysing
599code quality.")
600 (license license:expat)))
601
602(define-public python-covdefaults
603 (package
604 (name "python-covdefaults")
605 (version "2.3.0")
606 (source
607 (origin
608 ;; The PyPI tarball does not include tests.
609 (method git-fetch)
610 (uri (git-reference
611 (url "https://github.com/asottile/covdefaults")
612 (commit (string-append "v" version))))
613 (file-name (git-file-name name version))
614 (sha256
615 (base32 "1b34zkn7g66iavjxdy8hg25ab56bafgsqizf6l1anszncayal6px"))))
616 (build-system pyproject-build-system)
617 (arguments
618 ;; 88 passed, 1 deselected
619 ;; AttributeError: type object 'Plugins' has no attribute 'load_plugins'
620 (list #:test-flags #~(list "-k" "not test_coverage_init")))
621 (native-inputs
622 (list python-pytest
623 python-setuptools))
624 (propagated-inputs
625 (list python-coverage))
626 (home-page "https://github.com/asottile/covdefaults")
627 (synopsis "Coverage plugin to provide opinionated default settings")
628 (description
629 "Covdefaults is a coverage plugin to provide opinionated default
630 settings.")
631 (license license:expat)))
632
633(define-public python-coveralls
634 (package
635 (name "python-coveralls")
636 (version "4.0.1")
637 (source
638 (origin
639 (method git-fetch) ;no tests in PyPI archive
640 (uri (git-reference
641 (url "https://github.com/coveralls-clients/coveralls-python")
642 (commit version)))
643 (file-name (git-file-name name version))
644 (sha256
645 (base32 "1411h7rwxgp9ag26bmlpy7g7sdh39f56dc1mrd1n74bjsgvwzj6l"))))
646 (build-system pyproject-build-system)
647 (arguments
648 (list #:test-flags '(list
649 ;; XXX: Avoid git dependency.
650 "--ignore=tests/git_test.py"
651 ;; XXX: Unable to find coverage package.
652 "--ignore=tests/api/reporter_test.py"
653 "--ignore=tests/integration_test.py")))
654 (native-inputs
655 (list python-poetry-core
656 python-mock
657 python-pytest
658 python-responses))
659 (propagated-inputs
660 (list python-coverage
661 python-docopt
662 python-pyyaml
663 python-requests))
664 (home-page "https://github.com/coveralls-clients/coveralls-python")
665 (synopsis "Show coverage stats online via coveralls.io")
666 (description
667 "Coveralls.io is a service for publishing code coverage statistics online.
668This package provides seamless integration with coverage.py (and thus pytest,
669nosetests, etc...) in Python projects.")
670 (license license:expat)))
671
672(define-public python-cram
673 (package
674 (name "python-cram")
675 (version "0.7")
676 (home-page "https://bitheap.org/cram/")
677 (source
678 (origin
679 (method url-fetch)
680 (uri (list (string-append home-page "cram-" version ".tar.gz")
681 (pypi-uri "cram" version)))
682 (sha256
683 (base32 "0bvz6fwdi55rkrz3f50zsy35gvvwhlppki2yml5bj5ffy9d499vx"))))
684 (build-system pyproject-build-system)
685 (arguments
686 (list
687 #:phases
688 #~(modify-phases %standard-phases
689 (add-after 'unpack 'patch-source
690 (lambda* (#:key inputs #:allow-other-keys)
691 (substitute* (find-files "cram" ".*\\.py$")
692 ;; Replace default shell path.
693 (("/bin/sh")
694 (search-input-file inputs "bin/sh")))
695 (substitute* (find-files "tests" ".*\\.t$")
696 (("md5")
697 "md5sum")
698 (("/bin/(sh|bash)")
699 (search-input-file inputs "bin/sh")))
700 (substitute* "cram/_test.py"
701 ;; This hack works around a bug triggered by substituting
702 ;; the /bin/sh paths. "tests/usage.t" compares the output of
703 ;; "cram -h", which breaks the output at 80 characters. This
704 ;; causes the line showing the default shell to break into two
705 ;; lines, but the test expects a single line...
706 (("env\\['COLUMNS'\\] = '80'")
707 "env['COLUMNS'] = '160'"))))
708 (replace 'check
709 ;; The test phase uses the built library and executable.
710 (lambda* (#:key tests? #:allow-other-keys)
711 (if tests?
712 (begin
713 (setenv "PATH" (string-append (getenv "PATH")
714 ":" #$output "/bin"))
715 (invoke "make" "quicktest"))
716 (format #t "test suite not run.~%")))))))
717 (native-inputs (list python-setuptools python-wheel))
718 (synopsis "Simple testing framework for command line applications")
719 (description
720 "Cram is a functional testing framework for command line applications.
721Cram tests look like snippets of interactive shell sessions. Cram runs each
722command and compares the command output in the test with the command’s actual
723output.")
724 (license license:gpl2+)))
725
726(define-public python-crosshair
727 (package
728 (name "python-crosshair")
729 (version "0.0.101")
730 (source
731 (origin
732 (method url-fetch)
733 (uri (pypi-uri "crosshair_tool" version))
734 (sha256
735 (base32 "10vrfrwmxgvfxcqz284xf40cpr3an788bbwsvi3lnd0v467b2vn3"))))
736 (build-system pyproject-build-system)
737 (arguments
738 (list
739 ;; tests: 12229 passed, 12 skipped, 3 xfailed, 84 warnings
740 #:test-flags
741 #~(list "--numprocesses" (number->string (min 8 (parallel-job-count)))
742 ;; check_examples_test.py contains failing tests that
743 ;; show what happens if a counterexample is found.
744 "--ignore=crosshair/examples/check_examples_test.py"
745 ;; AttributeError: 'ArithRef' object has no attribute 'as_long'
746 "--deselect=crosshair/statespace_test.py::test_model_value_to_python_ArithRef"
747 ;; AssertionError: Got MessageType.CANNOT_CONFIRM instead of
748 ;; MessageType.CONFIRMED (use `pytest -v` to show trace)
749 "--deselect=crosshair/register_contract_test.py::test_register_numpy_randint")
750 #:phases
751 #~(modify-phases %standard-phases
752 (add-after 'unpack 'relax-requirements
753 (lambda _
754 (substitute* "setup.py"
755 ;; For some reason Python version is not set properly or can't
756 ;; be identified.
757 ((".*z3-solver.*") ""))))
758 (add-before 'check 'set-test-env
759 (lambda _
760 (setenv "PYTHONHASHSEED" "0")))))) ;tests rely on this value
761 (native-inputs
762 (list python-icontract ;optional
763 python-importlib-metadata
764 python-mypy
765 python-numpy
766 python-pytest
767 python-pytest-xdist
768 python-setuptools))
769 (propagated-inputs
770 (list python-importlib-metadata
771 python-packaging
772 python-pygls
773 python-typeshed-client
774 python-typing-inspect
775 python-typing-extensions
776 z3))
777 (home-page "https://crosshair.readthedocs.io")
778 (synopsis "Analysis tool for Python using symbolic execution")
779 (description
780 "@code{crosshair} is an analysis tool for Python that works by repeatedly
781calling your functions with symbolic inputs. It uses an @acronym{SMT,
782Satisfiability modulo theories} solver explore viable execution paths and find
783counterexamples for you.")
784 (license (list license:asl2.0 license:expat license:psfl))))
785
786(define-public python-cucumber-expressions
787 (package
788 (name "python-cucumber-expressions")
789 (version "19.0.0")
790 (source
791 (origin
792 (method git-fetch)
793 (uri (git-reference
794 (url "https://github.com/cucumber/cucumber-expressions")
795 (commit (string-append "v" version))))
796 (file-name (git-file-name name version))
797 (sha256
798 (base32 "1ijjvh9hwfcagawysd4p1xirjpx719i7v4iwkbziwqw73jy8gayh"))))
799 (build-system pyproject-build-system)
800 (arguments
801 (list
802 #:build-backend "setuptools.build_meta" ;requires uv_build
803 #:phases
804 #~(modify-phases %standard-phases
805 ;; Project's repository contains go, java, javascript, perl, python
806 ;; and ruby implementations.
807 (add-after 'unpack 'chdir-python
808 (lambda _
809 (chdir "python")))
810 (add-after 'chdir-python 'patch-pyproject
811 (lambda _
812 ;; setuptools cannot handle both license and license-files
813 (substitute* "pyproject.toml"
814 (("^license = .*") "")))))))
815 (native-inputs
816 (list python-pytest python-pyyaml python-setuptools))
817 (home-page "https://github.com/cucumber/cucumber-expressions")
818 (synopsis "A simpler alternative to Regular Expressions")
819 (description
820 "This package provides an alternative to Regular Expressions with a more
821intuitive syntax.")
822 (license license:expat)))
823
824(define-public python-cucumber-tag-expressions
825 (package
826 (name "python-cucumber-tag-expressions")
827 (version "9.1.0")
828 (source
829 (origin
830 (method git-fetch)
831 (uri (git-reference
832 (url "https://github.com/cucumber/tag-expressions")
833 (commit (string-append "v" version))))
834 (file-name (git-file-name name version))
835 (sha256
836 (base32 "05c8zppc3cwgdrrir0nigjy2jm2pm8f6rl5xrhxl91cbnyar0bq9"))))
837 (build-system pyproject-build-system)
838 (arguments
839 (list
840 #:build-backend "setuptools.build_meta" ;requires uv_build
841 #:phases
842 #~(modify-phases %standard-phases
843 ;; Project's repository contains go, java, javascript, perl, python
844 ;; and ruby implementations.
845 (add-after 'unpack 'chdir-python
846 (lambda _
847 (chdir "python"))))))
848 (native-inputs
849 (list python-path
850 python-pytest
851 python-pytest-metadata
852 python-pyyaml
853 python-setuptools
854 python-setuptools-scm))
855 (home-page "https://github.com/cucumber/tag-expressions")
856 (synopsis "Tag-expression parser for cucumber/behave")
857 (description
858 "This package provides a tag-expression parser for Cucumber and
859@command{behave}.")
860 (license license:expat)))
861
862(define-public python-ddt
863 (package
864 (name "python-ddt")
865 (version "1.7.2")
866 (source
867 (origin
868 (method url-fetch)
869 (uri (pypi-uri "ddt" version))
870 (sha256
871 (base32 "0jz0lglz5z5clsbralbpmd1hxs4ndb6ls7lvl7216c4nhfqdc5fj"))))
872 (build-system pyproject-build-system)
873 (native-inputs
874 (list python-aiounittest
875 python-pytest
876 python-setuptools
877 python-six
878 python-wheel))
879 (propagated-inputs
880 (list python-pyyaml))
881 (home-page "https://github.com/datadriventests/ddt")
882 (synopsis "Data-Driven Tests")
883 (description
884 "Data-Driven Tests (@dfn{DDT}) allow you to multiply one test case by
885running it with different test data, and make it appear as multiple test
886cases.")
887 (license license:expat)))
888
889(define-public python-deal
890 (package
891 (name "python-deal")
892 (version "4.24.6")
893 (source
894 (origin
895 (method url-fetch)
896 (uri (pypi-uri "deal" version))
897 (sha256
898 (base32 "078a46agz00k6chf9pjnfcnnc298in4d6rp06mspd11frfxx9x0w"))))
899 (build-system pyproject-build-system)
900 (arguments
901 (list
902 ;; tests: 992 passed, 13 skipped, 28 deselected, 2 warnings
903 #:test-flags
904 ;; Network access is required
905 #~(list "--deselect=tests/test_imports.py::test_smoke_has"
906 #$@(map (lambda (test) (string-append "--deselect="
907 "tests/test_runtime/"
908 "test_offline.py::"
909 test))
910 (list "test_raises_exception"
911 "test_raises_specified_exception"
912 "test_allow_network"
913 "test_decorating_async_function"
914 "test_decorating_generator"))
915 ;; TypeError: MaxRetryError.__init__() missing 2 required
916 ;; positional arguments: 'pool' and 'url'
917 "--deselect=tests/test_runtime/test_pure.py::test_pure_offline"
918 ;; TypeError: MaxRetryError.__init__() missing 2 required
919 ;; positional arguments: 'pool' and 'url'
920 #$@(map (lambda (test) (string-append "--deselect="
921 "tests/test_runtime/"
922 "test_raises.py::"
923 test))
924 (list "test_raises_doesnt_override_another_contract"
925 "test_raises_doesnt_override_another_contract_async"
926 "test_raises_generator"))
927 ;; AttributeError: module 'typeguard' has no attribute 'CallMemo'
928 #$@(map (lambda (test) (string-append "--deselect="
929 "tests/test_testing.py::"
930 test))
931 (list "test_concat"
932 "test_decorator_div1_smoke"
933 "test_decorator_div2_smoke"
934 "test_decorator_rejects_bad"
935 "test_disable_type_checks"
936 "test_div1_short"
937 "test_div2_short"
938 "test_example"
939 "test_explicit_kwargs"
940 "test_explicit_strategy"
941 "test_params_ok_with_excs"
942 "test_return_type"
943 "test_return_type_checks"
944 "test_run_ok"
945 "test_type_var"
946 "test_typecheck_explicit_kwargs"))
947 ;; Assertions are not equal.
948 "--deselect=tests/test_cli/test_test.py::test_no_violations"
949 "--deselect=tests/test_doctest.py::test_doctest[test5]")))
950 (native-inputs
951 (list python-flit-core
952 python-docstring-parser
953 python-pytest
954 python-urllib3))
955 (propagated-inputs
956 (list python-astroid
957 python-deal-solver
958 python-pygments
959 python-typeguard))
960 (home-page "https://github.com/life4/deal")
961 (synopsis "Design by contract for Python")
962 (description
963 "This package provides a Python library for
964@url{https://en.wikipedia.org/wiki/Design_by_contract, design by contract}
965(DbC) and checking values, exceptions, and side-effects. In a nutshell, deal
966implements functionality to write bug-free code. By adding a few decorators
967to the code, providing free tests, static analysis, formal verification, and
968much more.")
969 (license license:expat)))
970
971(define-public python-deal-solver
972 (package
973 (name "python-deal-solver")
974 (version "0.1.2")
975 (source
976 (origin
977 (method git-fetch)
978 (uri (git-reference
979 (url "https://github.com/life4/deal-solver")
980 (commit version)))
981 (file-name (git-file-name name version))
982 (sha256
983 (base32 "16kxxip5czjsy1b4xds4zpjz3rgpsrp4k2bbvw1r3z2in509w0qc"))))
984 (build-system pyproject-build-system)
985 (arguments
986 (list
987 ;; tests: 6893 passed, 40 warnings
988 #:test-flags
989 #~(list "--numprocesses" (number->string (min 8 (parallel-job-count)))
990 ;; AssertionError: assert <Conclusion.SKIP: 'skipped'> is
991 ;; <Conclusion.OK: 'proved!'>
992 (string-append "--deselect=tests/test_types/test_set.py"
993 "::test_expr_asserts_ok[len({4, 5, 5, 6}) >= 3]"))))
994 (native-inputs
995 (list python-pytest
996 python-pytest-xdist
997 python-flit-core))
998 (propagated-inputs
999 (list python-astroid
1000 z3))
1001 (home-page "https://github.com/life4/deal-solver")
1002 (synopsis "z3-powered solver (theorem prover) for Deal")
1003 (description
1004 "This package provides a @url{https://github.com/Z3Prover/z3, z3}-powered
1005solver (theorem prover) for Deal.")
1006 (license license:expat)))
1007
1008(define-public python-diagnostic
1009 (package
1010 (name "python-diagnostic")
1011 (version "3.0.0")
1012 (source
1013 (origin
1014 (method git-fetch)
1015 (uri (git-reference
1016 (url "https://github.com/pradyunsg/diagnostic")
1017 (commit version)))
1018 (file-name (git-file-name name version))
1019 (sha256
1020 (base32 "119js783bfq89slhkxispl01xzv4a2c2wa59armncl6x23shrr02"))))
1021 (build-system pyproject-build-system)
1022 (arguments
1023 ;; This test fails due to meaningless print differences.
1024 (list #:test-flags #~(list "-k" "not test_directory_traversal")))
1025 (propagated-inputs
1026 (list python-docutils python-markdown-it-py python-rich))
1027 (native-inputs
1028 (list python-flit-core python-pytest))
1029 (home-page "https://github.com/pradyunsg/diagnostic")
1030 (synopsis "Tooling to present errors in Python")
1031 (description
1032 "This package provides tooling to makes it easier to build command line
1033tools with great error reporting.")
1034 (license license:expat)))
1035
1036(define-public python-doc8
1037 (package
1038 (name "python-doc8")
1039 (version "1.1.2")
1040 (source
1041 (origin
1042 (method url-fetch)
1043 (uri (pypi-uri "doc8" version))
1044 (sha256
1045 (base32 "162b6lff5pcd4sp6sfm5fds8kllnx7ipzbyvi3irgk718h0z698j"))))
1046 (build-system pyproject-build-system)
1047 (native-inputs
1048 (list python-pytest
1049 python-setuptools
1050 python-setuptools-scm
1051 python-wheel))
1052 (propagated-inputs
1053 (list python-docutils
1054 python-pygments
1055 python-restructuredtext-lint
1056 python-stevedore
1057 python-tomli))
1058 (home-page "https://launchpad.net/doc8")
1059 (synopsis "Style checker for Sphinx (or other) RST documentation")
1060 (description
1061 "Doc8 is an opinionated style checker for reStructured Text and plain
1062text styles of documentation.")
1063 (license license:asl2.0)))
1064
1065(define-public python-dpcontracts
1066 (package
1067 (name "python-dpcontracts")
1068 (version "0.6.0")
1069 (source
1070 (origin
1071 (method url-fetch)
1072 (uri (pypi-uri "dpcontracts" version))
1073 (sha256
1074 (base32 "0ji38afb5kb52rrjhcqklqvabxxb1lbl32vr7d94iamy2qgxzybc"))))
1075 (build-system pyproject-build-system)
1076 (arguments
1077 (list #:tests? #f)) ;no tests
1078 (native-inputs (list python-setuptools))
1079 (home-page "https://github.com/deadpixi/contracts")
1080 (synopsis "Implementation of contracts for Python")
1081 (description
1082 "This package provides a simple implementation of contracts for Python.
1083Contracts are a debugging and verification tool. They are declarative
1084statements about what states a program must be in to be considered \"correct\"
1085at runtime. They are similar to assertions, and are verified automatically at
1086various well-defined points in the program. Contracts can be specified on
1087functions and on classes.")
1088 (license license:lgpl3+)))
1089
1090(define-public python-empty-files
1091 (package
1092 (name "python-empty-files")
1093 (version "0.0.9")
1094 (source
1095 (origin
1096 (method git-fetch)
1097 (uri (git-reference
1098 (url "https://github.com/approvals/EmptyFiles.Python")
1099 (commit (string-append "v" version))))
1100 (file-name (git-file-name name version))
1101 (sha256
1102 (base32 "0w3pkhymkh9wl4g8x5pssbsxr78bzb6qix95mxqqfwbx0g42iz1z"))))
1103 (build-system pyproject-build-system)
1104 ;; XXX: Circular dependency on python-approvaltests for tests.
1105 (arguments (list #:tests? #f))
1106 (propagated-inputs (list python-requests))
1107 (native-inputs (list python-setuptools))
1108 (home-page "https://github.com/approvals/EmptyFiles.Python")
1109 (synopsis "Serve empty files of many types")
1110 (description "This project will create an empty file of a type
1111requested. If possible, that file will be the smallest valid file for that
1112type. For example, an empty jpg will be a 1x1 pixel jpg.")
1113 (license license:asl2.0)))
1114
1115(define-public python-eradicate
1116 (package
1117 (name "python-eradicate")
1118 (version "3.0.0")
1119 (source
1120 (origin
1121 (method git-fetch)
1122 (uri (git-reference
1123 (url "https://github.com/myint/eradicate")
1124 (commit version)))
1125 (file-name (git-file-name name version))
1126 (sha256
1127 (base32 "135xywygriid1wvqkra13iccaayh5r6a233jyfrj6kizhflksy2p"))))
1128 (build-system pyproject-build-system)
1129 (native-inputs (list python-pytest python-setuptools python-wheel))
1130 (home-page "https://github.com/myint/eradicate")
1131 (synopsis "Remove commented-out code from Python sources")
1132 (description
1133 "The @command{eradicate} command removes commented-out code from Python
1134files. It does this by detecting block comments that contain valid Python
1135syntax that are likely to be commented out code.")
1136 (license license:expat)))
1137
1138(define-public python-expecttest
1139 (package
1140 (name "python-expecttest")
1141 (version "0.3.0")
1142 (source
1143 (origin
1144 (method git-fetch)
1145 (uri (git-reference
1146 (url "https://github.com/pytorch/expecttest")
1147 (commit (string-append "v" version))))
1148 (file-name (git-file-name name version))
1149 (sha256
1150 (base32
1151 "1diz07lbbdlypbmcikj646vr5fav4prgs68nmnlqi0fr7m01l4zw"))))
1152 (build-system pyproject-build-system)
1153 (native-inputs
1154 (list python-hypothesis
1155 python-poetry-core
1156 ))
1157 (home-page "https://github.com/pytorch/expecttest")
1158 (synopsis "Python module for expect tests")
1159 (description "@code{expecttest} is a Python module for expect tests, where
1160the initial expected value of a test can be automatically set by running the
1161test itself.")
1162 (license license:expat)))
1163
1164(define-public python-flake8-builtins
1165 (package
1166 (name "python-flake8-builtins")
1167 (version "2.5.0")
1168 (source
1169 (origin
1170 (method url-fetch)
1171 (uri (pypi-uri "flake8_builtins" version))
1172 (sha256
1173 (base32 "19psav7pnqy3m5g4z1zah4ksbnk9bzx1jbbibs631xg44gc3vamx"))))
1174 (build-system pyproject-build-system)
1175 (arguments
1176 (list #:test-flags #~(list "run_tests.py")))
1177 (native-inputs
1178 (list python-hatchling
1179 python-pytest))
1180 (propagated-inputs
1181 (list python-flake8))
1182 (home-page "https://github.com/gforcada/flake8-builtins")
1183 (synopsis "Check for python builtins being used as variables or parameters")
1184 (description
1185 "This package implements a functionality to check for python builtins
1186being used as variables or parameters.")
1187 (license license:gpl2)))
1188
1189(define-public python-flake8-class-newline
1190 (package
1191 (name "python-flake8-class-newline")
1192 (version "1.6.0")
1193 (source
1194 (origin
1195 (method git-fetch)
1196 (uri (git-reference
1197 (url "https://github.com/AlexanderVanEck/flake8-class-newline")
1198 (commit version)))
1199 (file-name (git-file-name name version))
1200 (sha256
1201 (base32 "15fw0iw2c3a3n2aarfgq7147406489xd8nk0kkj9k2x98fkwwnyh"))))
1202 (build-system pyproject-build-system)
1203 (arguments (list #:test-backend #~'unittest))
1204 (propagated-inputs (list python-flake8))
1205 (native-inputs (list python-setuptools))
1206 (home-page "https://github.com/AlexanderVanEck/flake8-class-newline")
1207 (synopsis "Flake8 lint for newline after class definitions")
1208 (description
1209 "This package provides a flake8 extension to lint for newline after class
1210definitions.")
1211 (license license:expat)))
1212
1213(define-public python-flake8-comprehensions
1214 (package
1215 (name "python-flake8-comprehensions")
1216 (version "3.16.0")
1217 (source
1218 (origin
1219 (method git-fetch) ;; no tests in the PyPI tarball
1220 (uri (git-reference
1221 (url "https://github.com/adamchainz/flake8-comprehensions")
1222 (commit version)))
1223 (file-name (git-file-name name version))
1224 (sha256
1225 (base32 "0w49k9hv77s5kq60j8j3pbvq7d79rfldqmghlqvn1xxkdkra1v7q"))))
1226 (build-system pyproject-build-system)
1227 (native-inputs
1228 (list python-pytest
1229 python-pytest-flake8-path
1230 python-pytest-randomly
1231 python-setuptools
1232 python-wheel))
1233 (propagated-inputs
1234 (list python-flake8))
1235 (home-page "https://github.com/adamchainz/flake8-comprehensions")
1236 (synopsis "List, set and dict comprehensions")
1237 (description
1238 "This package provides a flake8 plugin to help you write better
1239list/set/dict comprehensions.")
1240 (license license:expat)))
1241
1242(define-public python-flake8-deprecated
1243 (package
1244 (name "python-flake8-deprecated")
1245 (version "2.2.1")
1246 (source
1247 (origin
1248 (method url-fetch)
1249 (uri (pypi-uri "flake8_deprecated" version))
1250 (sha256
1251 (base32 "18iazzh2l42fcjmkqdwncsl1h2s6sbi26vz4m0gmd80w3l0cm5pf"))))
1252 (build-system pyproject-build-system)
1253 (arguments
1254 (list
1255 #:test-flags
1256 #~(list "run_tests.py")))
1257 (native-inputs
1258 (list python-hatchling
1259 python-pytest))
1260 (propagated-inputs
1261 (list python-flake8))
1262 (home-page "https://github.com/gforcada/flake8-deprecated")
1263 (synopsis "Warns about deprecated method calls in Python")
1264 (description
1265 "This flake8 plugin helps you keep up with method deprecations by
1266providing hints about what deprecated methods should be replaced with.")
1267 (license license:gpl2)))
1268
1269(define-public python-flake8-docstrings
1270 (package
1271 (name "python-flake8-docstrings")
1272 (version "1.7.0")
1273 (source
1274 (origin
1275 (method git-fetch)
1276 (uri (git-reference
1277 (url "https://github.com/pycqa/flake8-docstrings")
1278 (commit version)))
1279 (file-name (git-file-name name version))
1280 (sha256
1281 (base32 "0a9cx11rz9asb4xkz7dg65kx8mpa74xqh5qp3lsiy74y4idwp9qi"))))
1282 (build-system pyproject-build-system)
1283 (arguments (list #:tests? #f)) ;there are no tests
1284 (propagated-inputs (list python-flake8 python-pydocstyle))
1285 (native-inputs (list python-setuptools))
1286 (home-page "https://github.com/pycqa/flake8-docstrings")
1287 (synopsis "Extension for flake8 which uses pydocstyle to check docstrings")
1288 (description
1289 "This package provides a extension for flake8 which uses pydocstyle to
1290check docstrings.")
1291 (license license:expat)))
1292
1293(define-public python-flake8-import-order
1294 (package
1295 (name "python-flake8-import-order")
1296 (version "0.19.2")
1297 (source
1298 (origin
1299 (method url-fetch)
1300 (uri (pypi-uri "flake8_import_order" version))
1301 (sha256
1302 (base32 "1cmhpiaj9bgh64mg4y93hcbsifvqa2lriz3la0iy8cbn95akqfqk"))))
1303 (build-system pyproject-build-system)
1304 (native-inputs
1305 (list python-setuptools
1306 python-pytest
1307 python-pylama))
1308 (propagated-inputs
1309 (list python-pycodestyle))
1310 (home-page "https://github.com/PyCQA/flake8-import-order")
1311 (synopsis
1312 "Flake8 and pylama plugin that checks the ordering of import statements")
1313 (description
1314 "This package provieds a flake8 and pylama plugin that checks the ordering
1315of import statements.")
1316 (license license:lgpl3)))
1317
1318(define-public python-flexmock
1319 (package
1320 (name "python-flexmock")
1321 (version "0.12.2")
1322 (source
1323 (origin
1324 (method url-fetch)
1325 (uri (pypi-uri "flexmock" version))
1326 (sha256
1327 (base32 "18dcr7mpldf3cxsqi9rak75n4z7x3j544l4ixdspairm7cf6cp23"))))
1328 (build-system pyproject-build-system)
1329 (native-inputs
1330 (list python-poetry-core
1331 python-pytest))
1332 (home-page "https://flexmock.readthedocs.io/")
1333 (synopsis "Testing library for Python")
1334 (description
1335 "flexmock is a testing library for Python that makes it easy to create
1336mocks, stubs and fakes.")
1337 (license license:bsd-3)))
1338
1339(define-public python-gcovr
1340 (package
1341 (name "python-gcovr")
1342 (version "8.3")
1343 (source
1344 (origin
1345 (method url-fetch)
1346 (uri (pypi-uri "gcovr" version))
1347 (sha256
1348 (base32
1349 "0ych0kqbxp5giksdkh6i32vh97zrsh3m2rfs02c8rxx7qkwp38zs"))))
1350 (build-system pyproject-build-system)
1351 (native-inputs
1352 (list python-hatchling
1353 python-hatch-fancy-pypi-readme
1354 python-hatch-vcs
1355 python-pytest
1356 python-pytest-timeout))
1357 (propagated-inputs
1358 (list python-lxml
1359 python-jinja2
1360 python-colorlog
1361 python-pygments
1362 python-tomli))
1363 (home-page "https://gcovr.com/")
1364 (synopsis "Utility for generating code coverage results")
1365 (description
1366 "Gcovr provides a utility for managing the use of the GNU gcov
1367utility and generating summarized code coverage results. It is inspired
1368by the Python coverage.py package, which provides a similar utility for
1369Python.")
1370 (license license:bsd-3)))
1371
1372(define-public python-green
1373 (package
1374 (name "python-green")
1375 (version "4.0.2")
1376 (source
1377 (origin
1378 (method url-fetch)
1379 (uri (pypi-uri "green" version))
1380 (sha256
1381 (base32 "1cd62nbn5dvlpnsyplp6cb24wd230san8dpm6pnl99n2kwzpq1m4"))))
1382 (build-system pyproject-build-system)
1383 (arguments
1384 (list
1385 #:test-flags
1386 #~(list "-tvvv"
1387 "green.test.test_version"
1388 "green.test.test_cmdline")
1389 #:phases
1390 #~(modify-phases %standard-phases
1391 (replace 'check
1392 (lambda* (#:key tests? test-flags #:allow-other-keys)
1393 (when tests?
1394 (setenv "PATH" (string-append #$output "/bin:" (getenv "PATH")))
1395 (apply invoke "green" test-flags)))))))
1396 (native-inputs
1397 (list python-setuptools))
1398 (propagated-inputs
1399 (list python-colorama
1400 python-coverage
1401 python-lxml
1402 python-unidecode))
1403 (home-page "https://github.com/CleanCut/green")
1404 (synopsis "Clean, colorful, fast Python test runner")
1405 (description
1406 "@code{green} is a Python test runner that describes itself as:
1407@table @emph
1408@item Clean
1409Low redundancy in output. Result statistics for each test is vertically aligned.
1410@item Colorful
1411Terminal output makes good use of color when the terminal supports it.
1412@item Fast
1413Tests run in independent processes (one per processor by default).
1414@item Powerful
1415Multi-target and auto-discovery support.
1416@item Traditional
1417It uses the normal @code{unittest} classes and methods.
1418@item Descriptive
1419Multiple verbosity levels, from just dots to full docstring output.
1420@item Convenient
1421Bash-completion and ZSH-completion of options and test targets.
1422@item Thorough
1423Built-in integration with @url{http://nedbatchelder.com/code/coverage/, coverage}.
1424@end table")
1425 (license license:expat)))
1426
1427(define-public python-hiro
1428 (package
1429 (name "python-hiro")
1430 (version "1.1.1")
1431 (source
1432 (origin
1433 (method git-fetch)
1434 (uri (git-reference
1435 (url "https://github.com/alisaifee/hiro")
1436 (commit version)))
1437 (file-name (git-file-name name version))
1438 (sha256
1439 (base32 "0j7z54nd72qfc065jgljqx53dhfkfz0922fk8qqczg7swmqf6cqv"))))
1440 (build-system pyproject-build-system)
1441 (native-inputs
1442 (list python-pytest python-setuptools))
1443 (home-page "https://hiro.readthedocs.io")
1444 (synopsis "Time manipulation utilities for testing in Python")
1445 (description
1446 "Hiro provides context managers and utilities to either freeze,
1447accelerate or decelerate and jump between different points in time. Functions
1448exposed by the standard library’s @code{time}, @code{datetime} and @code{date}
1449modules are patched within the contexts exposed.")
1450 (license license:expat)))
1451
1452(define-public python-httmock
1453 (package
1454 (name "python-httmock")
1455 (version "1.3.0")
1456 (source
1457 (origin
1458 (method git-fetch)
1459 (uri (git-reference
1460 (url "https://github.com/patrys/httmock")
1461 (commit version)))
1462 (file-name (git-file-name name version))
1463 (sha256
1464 (base32 "1dy7pjq4gz476jcnbbpzk8w8qxr9l8wwgw9x2c7lf6fzsgnf404q"))))
1465 (build-system pyproject-build-system)
1466 (arguments
1467 (list
1468 #:test-backend #~'custom
1469 #:test-flags #~(list "tests.py")))
1470 (native-inputs (list python-setuptools))
1471 (propagated-inputs (list python-requests))
1472 (home-page "https://github.com/patrys/httmock")
1473 (synopsis "Mocking library for requests")
1474 (description "This package provides a library for replying fake data to
1475Python software under test, when they make an HTTP query.")
1476 (license license:asl2.0)))
1477
1478(define-public python-hypothesmith
1479 (package
1480 (name "python-hypothesmith")
1481 (version "0.3.3")
1482 (source
1483 (origin
1484 (method url-fetch)
1485 (uri (pypi-uri "hypothesmith" version))
1486 (sha256
1487 (base32 "05hpr3iqqsrfvkzdn7wjxp92hjxmin3pch96fn4mvs68sq14ihcn"))))
1488 (build-system pyproject-build-system)
1489 (arguments
1490 (list
1491 #:test-flags
1492 #~(list "--numprocesses" (number->string (parallel-job-count))
1493 "-k" (string-append
1494 ;; XXX: hypothesis.errors.Unsatisfiable
1495 "not test_source_code_from_libcst_node_type[MatchSingleton]"
1496 ;; XXX: Python/Black versions not as expected.
1497 " and not test_black_autoformatter_from_grammar"))))
1498 (native-inputs
1499 (list python-black ;hard requirements to run tests
1500 python-parso
1501 python-pytest
1502 python-pytest-xdist
1503 python-setuptools))
1504 (propagated-inputs
1505 (list python-hypothesis
1506 python-lark
1507 python-libcst-minimal))
1508 (home-page "https://github.com/Zac-HD/hypothesmith")
1509 (synopsis "Strategies for generating Python programs")
1510 (description
1511 "This package contains hypothesis strategies for generating Python
1512programs, something like CSmith, a random generator of C programs.")
1513 (license license:mpl2.0)))
1514
1515(define-public python-icontract
1516 (package
1517 (name "python-icontract")
1518 (version "2.7.3")
1519 (source
1520 (origin
1521 (method git-fetch)
1522 (uri (git-reference
1523 (url "https://github.com/Parquery/icontract")
1524 (commit (string-append "v" version))))
1525 (file-name (git-file-name name version))
1526 (sha256
1527 (base32 "07ga4jdsk25f7jmd681y8vijdr00ycpfz62hyp09vfx7i696r02i"))))
1528 (arguments
1529 (list
1530 #:phases
1531 #~(modify-phases %standard-phases
1532 (add-after 'unpack 'relax-requirements
1533 (lambda _
1534 (substitute* "setup.py"
1535 (("asttokens>=2,<3") "asttokens"))))
1536 (add-before 'check 'set-icontract-slow
1537 (lambda _
1538 ;; Setting ICONTRACT_SLOW, does not enable a slow test suite.
1539 ;; It only causes a single test to run, that checks the value of
1540 ;; icontract.SLOW is set correctly.
1541 (setenv "ICONTRACT_SLOW" "1"))))))
1542 (build-system pyproject-build-system)
1543 (native-inputs
1544 (list python-asyncstdlib
1545 python-astor
1546 python-deal
1547 python-dpcontracts
1548 python-mypy
1549 python-numpy
1550 python-pytest
1551 python-setuptools
1552 python-typeguard))
1553 (propagated-inputs
1554 (list python-asttokens
1555 python-typing-extensions))
1556 (home-page "https://icontract.readthedocs.io")
1557 (synopsis "Design-by-contract programming for Python")
1558 (description
1559 "@code{icontract} brings design-by-contract to Python with informative
1560violation messages and inheritance. @code{icontract} provides two function,
1561@code{require} and @code{ensure} for preconditions and postconditions
1562respectively. Additionally, it provides a class decorator, @code{invariant},
1563to establish class invariants.")
1564 (license license:expat)))
1565
1566(define-public python-inline-snapshot
1567 (package
1568 (name "python-inline-snapshot")
1569 (version "0.32.6")
1570 (source
1571 (origin
1572 (method git-fetch)
1573 (uri (git-reference
1574 (url "https://github.com/15r10nk/inline-snapshot/")
1575 (commit (string-append "v" version))))
1576 (file-name (git-file-name name version))
1577 (sha256
1578 (base32 "1xcn26z1c7awkfpbjnr579vk7nchvl7vn3c2i88ihyabjblmy0d5"))))
1579 (build-system pyproject-build-system)
1580 (arguments
1581 (list
1582 ;; tests: 1329 passed, 7 skipped, 1 xfailed
1583 #:test-flags
1584 #~(list "--numprocesses" (number->string (min 8 (parallel-job-count)))
1585 ;; To prevent adding mypy and pyright.
1586 "--ignore=tests/test_typing.py"
1587 ;; Tests require isort.
1588 "--ignore=tests/test_docs.py")))
1589 (native-inputs
1590 (list python-black ;XXX: used in tests/conftest.py to self lint
1591 python-dirty-equals
1592 python-freezegun
1593 python-hatchling
1594 python-hypothesis
1595 python-pydantic
1596 python-pytest-bootstrap
1597 python-pytest-freezer
1598 python-pytest-mock
1599 python-pytest-subtests
1600 python-pytest-xdist))
1601 (propagated-inputs
1602 (list python-asttokens
1603 python-executing
1604 python-rich))
1605 (home-page "https://github.com/15r10nk/inline-snapshot/")
1606 (synopsis "Golden master/snapshot/approval testing library")
1607 (description
1608 "This package can be used for different things:
1609
1610@enumerate
1611@item golden master/approval/snapshot testing. The idea is that you have a
1612 function with a currently unknown result and you want to write a tests, which
1613 ensures that the result does not change during refactoring.
1614@item Compare things which are complex like lists with lot of numbers or
1615 complex data structures.
1616@item Things which might change during the development like error messages.
1617@end enumerate
1618
1619@code{inline-snapshot} automates the process of recording, storing and
1620updating the value you want to compare with. The value is converted with
1621@code{repr()} and stored in the source file as argument of the
1622@code{snapshot()} function.")
1623 (license license:expat)))
1624
1625(define-public python-junit-xml
1626 ;; XXX: There are no tags or PyPI releases, so take the latest commit
1627 ;; and use the version defined in setup.py.
1628 (let ((version "1.9")
1629 (commit "4bd08a272f059998cedf9b7779f944d49eba13a6")
1630 (revision "0"))
1631 (package
1632 (name "python-junit-xml")
1633 (version (git-version version revision commit))
1634 (home-page "https://github.com/kyrus/python-junit-xml")
1635 (source (origin
1636 (method git-fetch)
1637 (uri (git-reference (url home-page) (commit commit)))
1638 (file-name (git-file-name name version))
1639 (sha256
1640 (base32
1641 "0b8kbjhk3j10rk0vcniy695m3h43yip6y93h1bd6jjh0cp7s09c7"))))
1642 (build-system pyproject-build-system)
1643 (native-inputs (list python-pytest python-setuptools))
1644 (propagated-inputs (list python-six))
1645 (synopsis "Create JUnit XML test results")
1646 (description
1647 "This package provides a Python module for creating JUnit XML test
1648result documents that can be read by tools such as Jenkins or Bamboo.")
1649 (license license:expat))))
1650
1651(define-public python-line-profiler
1652 (package
1653 (name "python-line-profiler")
1654 (version "4.2.0")
1655 (source
1656 (origin
1657 (method url-fetch)
1658 (uri (pypi-uri "line_profiler" version))
1659 (sha256
1660 (base32 "15hs8pmv7pcilnhhp0l5pamjihmh7zlnvvpsnf046lbnz0jhzq89"))))
1661 (build-system pyproject-build-system)
1662 (arguments
1663 (list
1664 #:test-flags
1665 ;; XXX: Test can't compare the versions: AssertionError: Version
1666 ;; Mismatch: kernprof and line_profiler must be in
1667 ;; sync. kernprof.line_profiler = . kernprof.__version__ = 4.2.0.
1668 #~(list "--deselect=tests/test_cli.py::test_version_agreement")))
1669 (native-inputs
1670 (list python-cython
1671 python-pytest
1672 python-setuptools
1673 python-ubelt
1674 python-wheel
1675 python-xdoctest))
1676 (home-page "https://github.com/pyutils/line_profiler")
1677 (synopsis "Line-by-line profiler for Python")
1678 (description
1679 "This package provides @code{line_profiler} - a Python module for doing
1680line-by-line profiling of functions. @code{kernprof} is a convenient script
1681for running either @code{line_profiler} or the Python standard library's
1682cProfile or profile modules, depending on what is available. It's a
1683successor of @url{https://github.com/rkern/line_profiler}.")
1684 (license license:bsd-3)))
1685
1686(define-public python-lsp-ruff
1687 (package
1688 (name "python-lsp-ruff")
1689 (version "2.3.1")
1690 (source
1691 (origin
1692 (method git-fetch)
1693 (uri (git-reference
1694 (url "https://github.com/python-lsp/python-lsp-ruff")
1695 (commit (string-append "v" version))))
1696 (file-name (git-file-name name version))
1697 (sha256
1698 (base32 "1xjvqyn3qn54cq63ay9n1rr1wkzx04bf99cki68n46gm8nwjvn6m"))))
1699 (build-system pyproject-build-system)
1700 (arguments
1701 (list
1702 #:test-flags #~(list (string-append
1703 ;; Tests below do a diff check on the ruff store
1704 ;; path against the python store path.
1705 "-k" "not test_ruff_settings"
1706 " and not test_ruff_config_param"))
1707 #:phases #~(modify-phases %standard-phases
1708 (add-after 'unpack 'use-system-ruff
1709 ;; This package requests Ruff from PyPI. Make it use
1710 ;; the guix package instead.
1711 (lambda _
1712 (substitute* "pyproject.toml"
1713 (("\"ruff.*\",") "")))))))
1714 (propagated-inputs (list python-cattrs
1715 python-lsprotocol
1716 python-lsp-server
1717 python-tomli
1718 ;; Ruff is detected by shutil.which.
1719 ruff))
1720 (native-inputs (list python-pytest python-setuptools))
1721 (home-page "https://github.com/python-lsp/python-lsp-ruff")
1722 (synopsis "Ruff linting plugin for @code{pylsp}")
1723 (description
1724 "@code{python-lsp-ruff} is a plugin for @code{python-lsp-server} that
1725adds linting, code actions and formatting capabilities that are provided by
1726Ruff.")
1727 (license license:expat)))
1728
1729(define-public python-memory-profiler
1730 (package
1731 (name "python-memory-profiler")
1732 ;; 0.61 (2022-11-15), the latest changes provide support for Python
1733 ;; 3.12+; move back to git tag when released.
1734 (properties '((commit . "025929f8e4f4ea8c27ddb5ef72fc91f6bd703ea5")
1735 (revision . "0")))
1736 (version (git-version "0.61"
1737 (assoc-ref properties 'revision)
1738 (assoc-ref properties 'commit)))
1739 (source
1740 (origin
1741 (method git-fetch)
1742 (uri (git-reference
1743 (url "https://github.com/pythonprofilers/memory_profiler")
1744 (commit (assoc-ref properties 'commit))))
1745 (file-name (git-file-name name version))
1746 (sha256
1747 (base32 "1hg6qd236hx8shwpvwrwffnskjjiqicd8fxlx9fm8jkiryb955nn"))))
1748 (build-system pyproject-build-system)
1749 (arguments
1750 (list
1751 #:phases
1752 #~(modify-phases %standard-phases
1753 (replace 'check
1754 (lambda* (#:key tests? #:allow-other-keys)
1755 (when tests?
1756 (for-each (lambda (test)
1757 (invoke "python" "-m" "memory_profiler" test))
1758 (list "test/test_func.py"
1759 "test/test_loop.py"
1760 "test/test_mprofile.py"
1761 "test/test_as.py"
1762 "test/test_global.py"
1763 "test/test_precision_command_line.py"
1764 "test/test_gen.py"
1765 "test/test_unicode.py"))
1766 (for-each (lambda (test)
1767 (invoke "python" test))
1768 (list "test/test_tracemalloc.py"
1769 "test/test_import.py"
1770 "test/test_memory_usage.py"
1771 "test/test_precision_import.py"
1772 "test/test_exception.py"
1773 "test/test_exit_code.py"))
1774 (invoke "mprof" "run" "test/test_func.py")))))))
1775 (native-inputs
1776 (list python-setuptools))
1777 (propagated-inputs
1778 (list python-psutil))
1779 (home-page "https://github.com/pythonprofilers/memory_profiler")
1780 (synopsis "Memory profiler for Python")
1781 (description
1782 "This package provides a module for monitoring the memory usage of a
1783Python program.")
1784 (license license:bsd-3)))
1785
1786(define-public python-mockito
1787 (package
1788 (name "python-mockito")
1789 (version "1.2.2")
1790 (source
1791 (origin
1792 (method git-fetch) ;no tests in pypi archive
1793 (uri (git-reference
1794 (url "https://github.com/kaste/mockito-python")
1795 (commit version)))
1796 (file-name (git-file-name name version))
1797 (sha256
1798 (base32 "0fg8jflcf4c929gd4zbcrk73d08waaqjfjmdjrgnv54mzl35pjxl"))))
1799 (build-system pyproject-build-system)
1800 (native-inputs
1801 (list python-numpy python-pytest python-setuptools python-wheel))
1802 (home-page "https://github.com/kaste/mockito-python")
1803 (synopsis "Mocking library for Python")
1804 (description "This package provides a Python implementation of the Java
1805library of the same name. It eases monkey patching, for example to stub out
1806side effects when unit testing.")
1807 (license license:expat)))
1808
1809(define-public python-multipart-form-data-conformance
1810 (package
1811 (name "python-multipart-form-data-conformance")
1812 (version "0.1a0")
1813 (source
1814 (origin
1815 (method git-fetch)
1816 (uri (git-reference
1817 (url "https://github.com/simonw/multipart-form-data-conformance")
1818 (commit version)))
1819 (file-name (git-file-name name version))
1820 (sha256
1821 (base32 "0lxaz00s5q5qdvqcyc233qd622f4fw6qsw2pny55j3v6ssn8m2v6"))))
1822 (build-system pyproject-build-system)
1823 (arguments
1824 (list #:tests? #f)) ;XXX: tests need some setupt
1825 (native-inputs
1826 (list python-hatchling))
1827 (home-page "https://github.com/simonw/multipart-form-data-conformance")
1828 (synopsis "Conformance suite for HTTP multipart form data")
1829 (description
1830 "This package provides a language-independent test suite for validating
1831HTTP @code{multipart/form-data} parsers and generators.")
1832 (license license:expat)))
1833
1834(define-public python-mypy
1835 (package
1836 (name "python-mypy")
1837 (version "1.18.2")
1838 (source
1839 (origin
1840 (method git-fetch)
1841 (uri (git-reference
1842 (url "https://github.com/python/mypy")
1843 (commit (string-append "v" version))))
1844 (file-name (git-file-name name version))
1845 (sha256
1846 (base32 "1nz5nxbw92milfq71df24p2nisw2q04gi8qh7f2p5az39y0fx1yq"))))
1847 (build-system pyproject-build-system)
1848 (arguments
1849 (list
1850 #:test-flags
1851 #~(list "--numprocesses" (number->string (parallel-job-count))
1852 ;; It tries to download hatchling and install additional test
1853 ;; dependencies.
1854 "--ignore=mypy/test/testpep561.py")
1855 #:phases
1856 #~(modify-phases %standard-phases
1857 (add-before 'check 'set-home
1858 (lambda _
1859 ;; The directory '/homeless-shelter/.cache/pip' or its parent
1860 ;; directory is not owned or is not writable by the current
1861 ;; user.
1862 (setenv "HOME" "/tmp"))))))
1863 (native-inputs
1864 (list nss-certs-for-test
1865 python-lxml
1866 python-psutil
1867 python-pytest
1868 python-pytest-xdist
1869 python-setuptools
1870 python-types-setuptools))
1871 (propagated-inputs
1872 (list python-mypy-extensions
1873 python-pathspec
1874 python-tomli
1875 python-typing-extensions))
1876 (home-page "https://www.mypy-lang.org/")
1877 (synopsis "Static type checker for Python")
1878 (description "Mypy is an optional static type checker for Python that aims
1879to combine the benefits of dynamic typing and static typing. Mypy combines
1880the expressive power and convenience of Python with a powerful type system and
1881compile-time type checking. Mypy type checks standard Python programs; run
1882them using any Python VM with basically no runtime overhead.")
1883 ;; Most of the code is under MIT license; Some files are under Python Software
1884 ;; Foundation License version 2: stdlib-samples/*, mypyc/lib-rt/pythonsupport.h and
1885 ;; mypyc/lib-rt/getargs.c
1886 (license (list license:expat license:psfl))))
1887
1888(define-public python-mypy-extensions
1889 (package
1890 (name "python-mypy-extensions")
1891 (version "1.1.0")
1892 (source
1893 (origin
1894 (method git-fetch) ;no tests in PyPI archive
1895 (uri (git-reference
1896 (url "https://github.com/python/mypy_extensions")
1897 (commit version)))
1898 (file-name (git-file-name name version))
1899 (sha256
1900 (base32 "12a3qs6rckxljlgw8ylkgcgpwllz96rw82lrgmhlzdgqcnqhbl0w"))))
1901 (build-system pyproject-build-system)
1902 (arguments (list #:test-backend #~'unittest
1903 #:test-flags #~(list "discover" "tests")))
1904 (native-inputs
1905 (list python-flit-core))
1906 (home-page "https://github.com/python/mypy_extensions")
1907 (synopsis "Experimental extensions for MyPy")
1908 (description
1909 "The @code{python-mypy-extensions} module defines experimental extensions
1910to the standard @code{typing} module that are supported by the MyPy
1911typechecker.")
1912 (license license:expat)))
1913
1914;;; This variant exists to break a cycle between python-pylama and python-isort.
1915(define-public python-mypy-minimal
1916 (hidden-package
1917 (package
1918 (inherit python-mypy)
1919 (name "python-mypy-minimal")
1920 (arguments
1921 `(#:tests? #f))
1922 (native-inputs
1923 (list python-setuptools
1924 python-wheel)))))
1925
1926;; The python-mypy-for-tests variant should be used only in native-inputs of
1927;; packages with a large number of (indirect) dependents. This allows the main,
1928;; user-facing, python-mypy package to be refreshed freely without requiring
1929;; thousands of packages to be rebuild. python-mypy-for-tests should only be
1930;; updated on the python-team branch, and is allowed to lag behind python-mypy on
1931;; master.
1932(define-public python-mypy-for-tests
1933 (hidden-package
1934 (package
1935 (inherit python-mypy)
1936 (version "1.16.1")
1937 (name "python-mypy-for-tests")
1938 (source
1939 (origin
1940 (method url-fetch)
1941 (uri (pypi-uri "mypy" version))
1942 (sha256
1943 (base32 "1avv8cj0qfhpw4s36bjhg994rml35fs4ndz78xg1r14l4050ml3b"))))
1944 (native-inputs
1945 (list nss-certs-for-test
1946 python-lxml
1947 python-psutil
1948 python-pytest
1949 python-pytest-xdist
1950 python-setuptools
1951 python-types-setuptools))
1952 (propagated-inputs
1953 (list python-mypy-extensions
1954 python-pathspec
1955 python-tomli
1956 python-typing-extensions)))))
1957
1958(define-public python-nbmake
1959 (package
1960 (name "python-nbmake")
1961 (version "1.5.3")
1962 (source
1963 (origin
1964 (method git-fetch)
1965 (uri (git-reference
1966 (url "https://github.com/treebeardtech/nbmake")
1967 (commit (string-append "v" version))))
1968 (file-name (git-file-name name version))
1969 (sha256
1970 (base32 "06syl819kwqhmjwp34lri31f0pypwnxs9j03s5lbk12w42mihzdi"))))
1971 (build-system pyproject-build-system)
1972 (arguments
1973 (list
1974 #:phases
1975 '(modify-phases %standard-phases
1976 (add-before 'check 'set-HOME
1977 (lambda _ (setenv "HOME" "/tmp"))))))
1978 (propagated-inputs
1979 (list python-ipykernel python-nbclient python-nbformat python-pygments))
1980 (native-inputs
1981 (list python-poetry-core
1982 python-pytest
1983 python-pytest-xdist
1984 python-pyyaml))
1985 (home-page "https://github.com/treebeardtech/nbmake")
1986 (synopsis "Pytest plugin for testing notebooks")
1987 (description "This package provides a Pytest plugin for testing Jupyter
1988notebooks.")
1989 (license license:asl2.0)))
1990
1991(define-public python-nbval
1992 (package
1993 (name "python-nbval")
1994 (version "0.11.0")
1995 (source
1996 (origin
1997 (method url-fetch)
1998 (uri (pypi-uri "nbval" version))
1999 (sha256
2000 (base32 "154h6xpf9h6spgg3ax6k79fd40j197ipwnfjmf5rc2kvc2bmgjbp"))))
2001 (build-system pyproject-build-system)
2002 (arguments
2003 (list
2004 #:test-flags
2005 ;; This test fails because of a mismatch in the output of LaTeX
2006 ;; equation environments. Seems OK to skip.
2007 #~(list "--ignore=tests/test_nbdime_reporter.py"
2008 ;; assert <ExitCode.USAGE_ERROR: 4> == 0
2009 "--deselect=tests/test_coverage.py::test_coverage")
2010 #:phases
2011 #~(modify-phases %standard-phases
2012 (add-before 'check 'fix-test
2013 (lambda _
2014 ;; This test fails because of a mismatch in the output of LaTeX
2015 ;; equation environments. Seems OK to skip.
2016 (delete-file
2017 "tests/ipynb-test-samples/test-latex-pass-correctouput.ipynb")
2018 ;; Prevent adding python-sympy.
2019 (delete-file
2020 "tests/ipynb-test-samples/test-latex-pass-failsbutignoreoutput.ipynb"))))))
2021 (native-inputs
2022 (list python-pytest
2023 python-setuptools))
2024 (propagated-inputs
2025 (list python-coverage
2026 python-ipykernel
2027 python-jupyter-client
2028 python-nbformat))
2029 (home-page "https://github.com/computationalmodelling/nbval")
2030 (synopsis "Pytest plugin to validate Jupyter notebooks")
2031 (description
2032 "This plugin adds functionality to Pytest to recognise and collect Jupyter
2033notebooks. The intended purpose of the tests is to determine whether execution
2034of the stored inputs match the stored outputs of the @file{.ipynb} file. Whilst
2035also ensuring that the notebooks are running without errors.")
2036 (license license:bsd-3)))
2037
2038(define-public python-nox
2039 (package
2040 (name "python-nox")
2041 (version "2025.11.12")
2042 (source
2043 (origin
2044 (method git-fetch)
2045 (uri (git-reference
2046 (url "https://github.com/wntrblm/nox")
2047 (commit version)))
2048 (file-name (git-file-name name version))
2049 (sha256
2050 (base32 "19cpsdi158ngn5jskfk50zbjn745nhlijx1w73rcmmqph0rl518r"))))
2051 (build-system pyproject-build-system)
2052 ;; tests: 631 passed, 40 skipped
2053 (arguments
2054 (list
2055 #:test-flags
2056 #~(list "-k"
2057 (string-join
2058 ;; XXX: Tests fails to find uv.
2059 (list "not test_download_python_always_preexisting_interpreter[uv]"
2060 "test_download_python_auto_missing_interpreter[uv]"
2061 "test_download_python_failed_install[always-uv]"
2062 "test_download_python_failed_install[auto-uv]"
2063 "test_noxfile_script_mode"
2064 "test_noxfile_script_mode_exec"
2065 "test_noxfile_script_mode_url_req")
2066 " and not "))))
2067 (native-inputs
2068 (list python-hatchling
2069 python-pytest))
2070 (propagated-inputs
2071 (list python-argcomplete
2072 python-attrs
2073 python-colorlog
2074 python-dependency-groups
2075 python-humanize
2076 python-virtualenv))
2077 (home-page "https://nox.thea.codes/")
2078 (synopsis "Flexible test automation")
2079 (description
2080 "@code{nox} is a command-line tool that automates testing in multiple
2081Python environments, similar to @code{tox}. Unlike tox, Nox uses a standard
2082Python file for configuration.")
2083 (license license:asl2.0)))
2084
2085(define-public python-pep8-naming
2086 (package
2087 (name "python-pep8-naming")
2088 (version "0.15.1")
2089 (source
2090 (origin
2091 (method url-fetch)
2092 (uri (pypi-uri "pep8_naming" version))
2093 (sha256
2094 (base32 "0acxcg4z43kkddlvjbcbbh1jp8rx5z0cq9hz7jlyvpm2mfcs9x7n"))))
2095 (build-system pyproject-build-system)
2096 (arguments
2097 (list
2098 #:phases
2099 #~(modify-phases %standard-phases
2100 (replace 'check
2101 (lambda* (#:key tests? #:allow-other-keys)
2102 (when tests?
2103 (invoke "python" "run_tests.py")))))))
2104 (native-inputs
2105 (list python-setuptools
2106 python-wheel))
2107 (propagated-inputs
2108 (list python-flake8))
2109 (home-page "https://github.com/PyCQA/pep8-naming")
2110 (synopsis "Check PEP-8 naming conventions")
2111 (description
2112 "This package provides the @code{pep8-naming} Python module, a plugin for
2113flake8 to check PEP-8 naming conventions.")
2114 (license license:expat)))
2115
2116(define-public python-psleak
2117 (package
2118 (name "python-psleak")
2119 (version "0.1.5")
2120 (source
2121 (origin
2122 (method git-fetch)
2123 (uri (git-reference
2124 (url "https://github.com/giampaolo/psleak")
2125 (commit (string-append "release-" version))))
2126 (file-name (git-file-name name version))
2127 (sha256
2128 (base32 "0ifysg0j0qh4h06l3xqlk97kdf4sj5mlg5c9dwigakjg9ydnkdv6"))))
2129 (build-system pyproject-build-system)
2130 (arguments
2131 (list
2132 #:tests? (and (target-64bit?)
2133 (not (%current-target-system)))
2134 #:phases
2135 #~(modify-phases %standard-phases
2136 (add-before 'check 'pre-check
2137 ;; Test steps are taken from project's Makefile.
2138 (lambda _
2139 (setenv "PYTHONWARNINGS" "always")
2140 (setenv "PYTHONUNBUFFERED" "1")
2141 (setenv "PYTEST_DISABLE_PLUGIN_AUTOLOAD" "1")
2142 (setenv "PYTHONMALLOC" "malloc")
2143 (invoke "python" "tests/build_ext.py" "build_ext" "--inplace"))))))
2144 (native-inputs
2145 (list python-pytest
2146 python-pytest-instafail
2147 python-setuptools))
2148 (propagated-inputs
2149 (list python-psutil-bootstrap))
2150 (home-page "https://github.com/giampaolo/psleak")
2151 (synopsis "Detect memory and resource leaks in Python C extensions")
2152 (description
2153 "@code{psleak} is a testing framework for detecting memory leaks and
2154unclosed resources created by Python functions, particularly those implemented
2155in C extensions.
2156
2157It was originally developed as part of @code{psutil} test suite, and later
2158split out into a standalone project.")
2159 (license license:bsd-3)))
2160
2161(define-public python-pycotap
2162 (package
2163 (name "python-pycotap")
2164 (version "1.3.1")
2165 (source
2166 (origin
2167 (method git-fetch)
2168 (uri (git-reference
2169 (url "https://github.com/remko/pycotap")
2170 (commit (string-append "v" version))))
2171 (file-name (git-file-name name version))
2172 (sha256
2173 (base32 "1xw3mrrsw7wc8yas9p2hnzj2m3mw7p1qxkj6l942gidngqphyhar"))))
2174 (build-system pyproject-build-system)
2175 (arguments
2176 ;; FIXME Unclear why tests fail.
2177 (list #:tests? #f))
2178 (native-inputs (list python-pytest python-setuptools))
2179 (home-page "https://github.com/remko/pycotap")
2180 (synopsis "Tiny Python TAP test runner")
2181 (description
2182 "This package provides a simple Python test runner for unittest that
2183outputs Test Anything Protocol (TAP) results to standard output. Contrary to
2184other TAP runners for Python, pycotap...
2185@itemize
2186@item
2187prints TAP (and only TAP) to standard output instead of to a separate file,
2188allowing you to pipe it directly to TAP pretty printers and processors;
2189@item only contains a TAP reporter, so no parsers, no frameworks, no
2190dependencies, etc;
2191@item
2192is configurable: you can choose how you want the test output and test result
2193diagnostics to end up in your TAP output (as TAP diagnostics, YAML blocks, or
2194attachments).
2195@end itemize")
2196 (license license:expat)))
2197
2198(define-public python-pyflakes
2199 (package
2200 (name "python-pyflakes")
2201 (version "3.2.0")
2202 (source
2203 (origin
2204 (method url-fetch)
2205 (uri (pypi-uri "pyflakes" version))
2206 (sha256
2207 (base32 "0gxgz0kg008pgmjk1dn8z3g00dfa9pc3f80pm6r1yqjly4zn0q8w"))))
2208 (build-system pyproject-build-system)
2209 (native-inputs
2210 (list python-pytest
2211 python-setuptools
2212 python-wheel))
2213 (home-page "https://github.com/PyCQA/pyflakes")
2214 (synopsis "Passive checker of Python programs")
2215 (description
2216 "Pyflakes statically checks Python source code for common errors.")
2217 (license license:expat)))
2218
2219(define-public python-pyinstrument
2220 (package
2221 (name "python-pyinstrument")
2222 (version "5.1.1")
2223 (source
2224 (origin
2225 (method url-fetch)
2226 (uri (pypi-uri "pyinstrument" version))
2227 (sha256
2228 (base32 "1a5shhhqy45bqjdahy1lnxikrpq5sv5p610fivz1qg0bk7d1qh5w"))))
2229 (build-system pyproject-build-system)
2230 (arguments
2231 (list
2232 #:test-flags
2233 #~(list
2234 #$@(map (lambda (test) (string-append "--deselect="
2235 "test/test_cmdline.py::"
2236 "TestCommandLine::"
2237 test))
2238 ;; subprocess.CalledProcessError: Command '['pyinstrument',
2239 ;; '-m', 'busy_wait_module']' returned non-zero exit status
2240 ;; 1.
2241 (list "test_module_running[pyinstrument_invocation0]"
2242 "test_single_file_module_running[pyinstrument_invocation0]"
2243 "test_running_yourself_as_module[pyinstrument_invocation0]"
2244 "test_module_execution_details[pyinstrument_invocation0]")))
2245 #:phases
2246 #~(modify-phases %standard-phases
2247 (add-before 'check 'pre-check
2248 (lambda _
2249 (setenv "HOME" "/tmp")
2250 (delete-file-recursively "pyinstrument"))))))
2251 (native-inputs
2252 (list python-flaky
2253 python-greenlet
2254 python-pytest
2255 python-pytest-asyncio
2256 python-pytest-trio
2257 python-setuptools))
2258 (home-page "https://github.com/joerick/pyinstrument")
2259 (synopsis "Call stack profiler for Python")
2260 (description
2261 "Pyinstrument is a Python profiler to help you optimize your code.")
2262 (license license:bsd-3)))
2263
2264(define-public python-pylama
2265 (package
2266 (name "python-pylama")
2267 (version "8.4.1")
2268 (source
2269 (origin
2270 (method git-fetch) ;no tests in PyPI archive
2271 (uri (git-reference
2272 (url "https://github.com/klen/pylama")
2273 (commit version)))
2274 (file-name (git-file-name name version))
2275 (sha256
2276 (base32 "1x9cnyfnd574mj8ckd5hbfg2wy128zg0k2cd3zc7vdbnimksvqaq"))))
2277 (build-system pyproject-build-system)
2278 (arguments
2279 (list
2280 ;; Cycles with pylint: python-pylama -> python-isort -> python-pylint ->
2281 ;; python-pylama
2282 #:tests? #f))
2283 (native-inputs
2284 (list python-setuptools
2285 python-wheel))
2286 (propagated-inputs
2287 (list python-mypy-minimal
2288 python-mccabe
2289 python-pycodestyle
2290 python-pydocstyle
2291 python-pyflakes))
2292 (home-page "https://github.com/klen/pylama")
2293 (synopsis "Code audit tool for python")
2294 (description
2295 "Pylama is a code audit tool for Python and JavaScript to check for
2296style, syntax and other code health metrics. It is essentially a convenient
2297wrapper above tools such as Pyflakes, pydocstyle, pycodestyle and McCabe,
2298among others.")
2299 (license license:lgpl3+)))
2300
2301(define-public python-pylint-venv
2302 (package
2303 (name "python-pylint-venv")
2304 (version "3.0.4")
2305 (source
2306 (origin
2307 (method git-fetch)
2308 (uri (git-reference
2309 (url "https://github.com/jgosmann/pylint-venv/")
2310 (commit (string-append "v" version))))
2311 (file-name (git-file-name name version))
2312 (sha256
2313 (base32 "06va7vy3bg331aab589wcr3nmafxlya0ac1as39qqyvkbdz9b5bl"))))
2314 (build-system pyproject-build-system)
2315 (arguments
2316 ;; Test is a simple shell script that activates a virtual environment
2317 ;; and runs pylint inside of it. There are no checks.
2318 (list #:tests? #f))
2319 (native-inputs (list python-poetry-core))
2320 (home-page "https://github.com/jgosmann/pylint-venv/")
2321 (synopsis
2322 "Pylint init-hook to share a Pylint installation across virtualenvs")
2323 (description "@code{pylint-venv} provides a Pylint init-hook to use the
2324same Pylint installation with different virtual environments.")
2325 (license license:expat)))
2326
2327(define-public python-pynose
2328 (package
2329 (name "python-pynose")
2330 (version "1.5.5")
2331 (source
2332 (origin
2333 (method url-fetch)
2334 (uri (pypi-uri "pynose" version))
2335 (sha256
2336 (base32 "0jbzmxnxmgf60158gpvfsp8j2cid6psfwj3j94vxv61z8wk4xnl1"))))
2337 (build-system pyproject-build-system)
2338 (arguments
2339 (list
2340 #:phases
2341 #~(modify-phases %standard-phases
2342 (replace 'check
2343 ;; A simple regression tests, taken from project's GitHub Actions,
2344 ;; see: <.github/workflows/python-package.yml>.
2345 (lambda* (#:key inputs outputs tests? #:allow-other-keys)
2346 (when tests?
2347 (with-output-to-file "nothing.py"
2348 (const (display "def test_1(): pass\n")))
2349 (invoke "pynose" "nothing.py" "--co" "-v")
2350 (invoke "pynose" "nothing.py" "-v")
2351 (invoke "nosetests" "nothing.py" "--co" "-v")
2352 (invoke "nosetests" "nothing.py" "-v")
2353 (delete-file "nothing.py")))))))
2354 (native-inputs
2355 (list python-setuptools))
2356 (home-page "https://github.com/mdmintz/pynose")
2357 (synopsis "Unittest framework for Python")
2358 (description
2359 "@code{pynose} is a maintained successor of deprecated @code{nose} unittest
2360runner.
2361Changes over @code{nose}:
2362@itemize
2363@item fixes @code{AttributeError: module 'collections' has no attribute 'Callable'}
2364@item fixes @code{AttributeError: module 'inspect' has no attribute 'getargspec'}
2365@item fixes @code{ImportError: cannot import name '_TextTestResult' from 'unittest'}
2366@item fixes @code{RuntimeWarning: TestResult has no addDuration method}
2367@item fixes @code{DeprecationWarning: pkg_resources is deprecated as an API}
2368@item fixes all @code{flake8} issues from the original nose
2369@item replaces the imp module with the newer importlib module
2370@item the default logging level now hides @code{INFO} logs for less noise
2371@item adds @code{--capture-logs} for hiding output from all logging levels
2372@item adds @code{--logging-init} to use @code{logging.basicConfig(level)}
2373@item the @code{-s} option is always active to see the output of @code{print()}
2374@item adds @code{--capture-output} for hiding the output of @code{print()}
2375@item adds @code{--co} as a shortcut to using @code{--collect-only}
2376@end itemize")
2377 (license license:lgpl2.0)))
2378
2379;; XXX: Deprecated on <2026-01-26>.
2380;;; This package is unmaintained (see the note at the top of doc/index.rst).
2381;;; Pynose is actively maintained successor of Nose tests runner.
2382(define-deprecated-package python-nose python-pynose)
2383
2384(define-public python-pytest-aiohttp
2385 (package
2386 (name "python-pytest-aiohttp")
2387 (version "1.1.0")
2388 (source
2389 (origin
2390 (method git-fetch)
2391 (uri (git-reference
2392 (url "https://github.com/aio-libs/pytest-aiohttp")
2393 (commit (string-append "v" version))))
2394 (file-name (git-file-name name version))
2395 (sha256
2396 (base32
2397 "0hqj6fqqhvyy61ikwqjcs1p4g3s7z01prsjgck19r8as4pfih5g7"))))
2398 (build-system pyproject-build-system)
2399 (arguments
2400 (list
2401 #:phases
2402 #~(modify-phases %standard-phases
2403 ;; Patch based on
2404 ;; https://github.com/aio-libs/pytest-aiohttp/pull/115/files
2405 (add-after 'unpack 'create-pytest-ini
2406 (lambda _
2407 (call-with-output-file "pytest.ini"
2408 (lambda (port)
2409 (format port "[pytest]
2410asyncio_default_fixture_loop_scope = function"))))))))
2411 (native-inputs
2412 (list python-pytest
2413 python-setuptools
2414 python-setuptools-scm))
2415 (propagated-inputs
2416 (list python-aiohttp
2417 python-pytest-asyncio))
2418 (home-page "https://github.com/aio-libs/pytest-aiohttp/")
2419 (synopsis "Pytest plugin for aiohttp support")
2420 (description "This package provides a pytest plugin for aiohttp support.")
2421 (license license:asl2.0)))
2422
2423(define-public python-pytest-arraydiff
2424 (package
2425 (name "python-pytest-arraydiff")
2426 (version "0.6.1")
2427 (source
2428 (origin
2429 (method url-fetch)
2430 (uri (pypi-uri "pytest-arraydiff" version))
2431 (sha256
2432 (base32 "1pk7v96rkypx4ld59f6p8fh5bq371ka8g7bh4h7n4df91x2v2dr9"))))
2433 (build-system pyproject-build-system)
2434 (arguments
2435 (list
2436 #:test-flags
2437 #~(list "-k" (string-append
2438 ;; Disable tests requiring python-astropy, to break cycle.
2439 "not test_succeeds_func_fits_hdu"
2440 " and not test_fails"
2441 " and not test_generate"
2442 " and not test_default_format"))))
2443 (native-inputs
2444 (list python-pytest python-setuptools-scm
2445 python-setuptools python-wheel))
2446 (propagated-inputs
2447 (list python-numpy))
2448 (home-page "https://github.com/astropy/pytest-arraydiff")
2449 (synopsis "Pytest plugin to help with comparing array output from tests")
2450 (description
2451 "This is a py.test plugin to facilitate the generation and comparison of
2452data arrays produced during tests, in particular in cases where the arrays
2453are too large to conveniently hard-code them in the tests.")
2454 (license license:bsd-3)))
2455
2456(define-public python-pytest-asdf-plugin
2457 (package
2458 (name "python-pytest-asdf-plugin")
2459 (version "0.1.2")
2460 (source
2461 (origin
2462 (method url-fetch)
2463 (uri (pypi-uri "pytest_asdf_plugin" version))
2464 (sha256
2465 (base32 "0bcfl1s7yrnr2rlpr3hswcg9jyq6gnj0ppmpzppw9xgj796ycfb5"))))
2466 (build-system pyproject-build-system)
2467 (arguments
2468 (list #:tests? #f ;to avoid import astronomy module
2469 #:phases
2470 #~(modify-phases %standard-phases
2471 (delete 'sanity-check))))
2472 (native-inputs
2473 (list python-setuptools
2474 python-setuptools-scm))
2475 (home-page "https://github.com/asdf-format/pytest-asdf-plugin")
2476 (synopsis "Pytest plugin for testing ASDF schemas")
2477 (description
2478 "This package provides a Pytest plugin for testing ASDF schemas.")
2479 (license license:bsd-3)))
2480
2481(define-public python-pytest-astropy
2482 (package
2483 (name "python-pytest-astropy")
2484 (version "0.11.0")
2485 (source
2486 (origin
2487 (method url-fetch)
2488 (uri (pypi-uri "pytest-astropy" version))
2489 (sha256
2490 (base32 "1d9rcxnc57rjp96xag1gq725pwl11b3k5hdaz7c3w5lixncsmbjf"))))
2491 (build-system pyproject-build-system)
2492 (arguments (list #:tests? #f)) ; there are no tests
2493 (native-inputs
2494 (list python-attrs
2495 python-pytest-mock
2496 python-setuptools
2497 python-setuptools-scm))
2498 (propagated-inputs
2499 (list python-hypothesis
2500 python-pytest-arraydiff
2501 python-pytest-astropy-header
2502 python-pytest-cov
2503 python-pytest-doctestplus
2504 python-pytest-filter-subpackage
2505 python-pytest-openfiles
2506 python-pytest-remotedata))
2507 (home-page "https://github.com/astropy/pytest-astropy")
2508 (synopsis
2509 "Metapackage for all the testing machinery used by the Astropy Project")
2510 (description
2511 "This is a meta-package that pulls in the dependencies that are used by
2512astropy related packages.")
2513 (license license:bsd-3)))
2514
2515(define-public python-pytest-astropy-header
2516(package
2517 (name "python-pytest-astropy-header")
2518 (version "0.2.2")
2519 (source
2520 (origin
2521 (method url-fetch)
2522 (uri (pypi-uri "pytest-astropy-header" version))
2523 (sha256
2524 (base32 "046v4arinv8b5jz05pvhnc0n1aqqndwvhlsl635ahxabr40i32bp"))))
2525 (build-system pyproject-build-system)
2526 (native-inputs
2527 (list python-numpy
2528 python-pytest
2529 python-setuptools
2530 python-setuptools-scm))
2531 (home-page "https://www.astropy.org/")
2532 (synopsis
2533 "Pytest plugin adding diagnostic data to the header of the test output")
2534 (description
2535 "This plugin package provides a way to include information about the system,
2536Python installation, and select dependencies in the header of the output when
2537running pytest. It can be used with packages that are not affiliated with the
2538Astropy project, but is optimized for use with astropy-related projects.")
2539 (license license:bsd-3)))
2540
2541(define-public python-pytest-benchmark
2542 (package
2543 (name "python-pytest-benchmark")
2544 (version "5.2.3")
2545 (source
2546 (origin
2547 (method git-fetch)
2548 (uri (git-reference
2549 (url "https://github.com/ionelmc/pytest-benchmark")
2550 (commit (string-append "v" version))))
2551 (file-name (git-file-name name version))
2552 (sha256
2553 (base32 "0xqwr78rcs5lps4zqhbqzx10k5lk8sl3m9hnsxk82lfngps0yf5a"))))
2554 (build-system pyproject-build-system)
2555 (arguments
2556 (list #:tests? #f)) ;XXX: cycles with python-nbmake
2557 (propagated-inputs
2558 (list python-py-cpuinfo))
2559 (native-inputs
2560 (list python-pytest-bootstrap python-setuptools))
2561 (home-page "https://github.com/ionelmc/pytest-benchmark")
2562 (synopsis "Pytest fixture for benchmarking code")
2563 (description
2564 "This package provides a pytest fixture that will group the tests into
2565rounds that are calibrated to the chosen timer.")
2566 (license license:bsd-2)))
2567
2568(define-public python-pytest-black
2569 (package
2570 (name "python-pytest-black")
2571 (version "0.6.0")
2572 (source
2573 (origin
2574 (method url-fetch)
2575 (uri (pypi-uri "pytest_black" version))
2576 (sha256
2577 (base32
2578 "04dmhv8dzh356qdxz6hrwfz3nk3mlc9shicgpns5r03rydap9dzc"))))
2579 (build-system pyproject-build-system)
2580 (native-inputs
2581 (list python-pytest-8
2582 python-setuptools))
2583 (propagated-inputs
2584 (list python-black
2585 python-toml))
2586 ;; Project maintenance has been changed, see
2587 ;; <https://github.com/shopkeep/pytest-black/issues/70>.
2588 (home-page "https://github.com/coherent-oss/pytest-black")
2589 (synopsis "Pytest plugin to enable format checking with black")
2590 (description
2591 "This package provides a pytest plugin to enable format checking with the
2592Python code formatter \"black\".")
2593 (license license:expat)))
2594
2595(define-public python-pytest-cases
2596 (package
2597 (name "python-pytest-cases")
2598 (version "3.9.1")
2599 (source
2600 (origin
2601 (method url-fetch)
2602 (uri (pypi-uri "pytest_cases" version))
2603 (sha256
2604 (base32 "13vzivzca36g3rbz3k3zny7jqv35vsl2z0fl32ik3j95npqq3qf4"))))
2605 (build-system pyproject-build-system)
2606 (native-inputs
2607 (list python-pytest-asyncio
2608 python-pytest-bootstrap
2609 python-pytest-harvest
2610 python-pytest-steps
2611 python-setuptools
2612 python-setuptools-scm))
2613 (propagated-inputs
2614 (list python-decopatch
2615 python-makefun
2616 python-packaging))
2617 (home-page "https://github.com/smarie/python-pytest-cases")
2618 (synopsis "Separate test code from test cases in pytest.")
2619 (description
2620 "This package provides a Pytest plugin which leverages
2621@code{@@pytest.mark.parametrize} decorator separating test cases from test
2622functions.")
2623 (license license:bsd-3)))
2624
2625(define-public python-pytest-celery
2626 (package
2627 (name "python-pytest-celery")
2628 (version "1.3.0")
2629 (source
2630 (origin
2631 (method git-fetch)
2632 (uri (git-reference
2633 (url "https://github.com/celery/pytest-celery")
2634 (commit (string-append "v" version))))
2635 (file-name (git-file-name name version))
2636 (sha256
2637 (base32 "0ck330n94q4yv3hhrs00px355xvvv2njfnv4b02i6dzlrg4fg87j"))))
2638 (build-system pyproject-build-system)
2639 (arguments
2640 (list
2641 #:test-flags
2642 ;; Disable tests that require docker/rabbit/redis running.
2643 #~(list "--deselect=tests/integration"
2644 "-k" "not rabbit and not redis")))
2645 (native-inputs
2646 (list python-celery-minimal
2647 python-memcached ;optional dependency, needed for tests
2648 python-poetry-core
2649 python-pytest
2650 python-redis ;optional dependency, needed for tests
2651 python-requests)) ;for python-docker
2652 (propagated-inputs
2653 (list python-psutil
2654 python-pytest-docker-tools
2655 python-tenacity))
2656 (home-page "https://github.com/celery/pytest-celery")
2657 (synopsis "Pytest plugin designed for Celery application developers")
2658 (description
2659 "This package enables dynamic orchestration of Celery environments for
2660testing tasks in isolated conditions, leveraging Docker & pytest-docker-tools
2661for environment simulation.")
2662 (license license:bsd-3)))
2663
2664(define-public python-pytest-check
2665 (package
2666 (name "python-pytest-check")
2667 (version "2.5.3")
2668 (source
2669 (origin
2670 (method url-fetch)
2671 (uri (pypi-uri "pytest_check" version))
2672 (sha256
2673 (base32 "1jkhmii6zrgzq0427sy9igm7a6nfvx7p4ms91h6d75f3fzgxfmr3"))))
2674 (build-system pyproject-build-system)
2675 (native-inputs (list python-hatchling python-pytest))
2676 (home-page "https://github.com/okken/pytest-check")
2677 (synopsis "Pytest plugin to allow multiple failures")
2678 (description "This package provides a pytest plugin that allows multiple
2679failures per test.")
2680 (license license:expat)))
2681
2682(define-public python-pytest-checkdocs
2683 (package
2684 (name "python-pytest-checkdocs")
2685 (version "2.10.0") ;PyPI contains only the latest version
2686 (source
2687 (origin
2688 (method git-fetch)
2689 (uri (git-reference
2690 (url "https://github.com/jaraco/pytest-checkdocs")
2691 (commit (string-append "v" version))))
2692 (file-name (git-file-name name version))
2693 (sha256
2694 (base32 "1amw07skzfwy88dqvcsh308lcds7avyyja0qzdqrk4739cm1g0vh"))))
2695 (build-system pyproject-build-system)
2696 (arguments
2697 (list
2698 #:tests? #f)) ;tests require network access
2699 (native-inputs
2700 (list python-pytest-bootstrap
2701 python-setuptools-scm
2702 python-wheel))
2703 (propagated-inputs
2704 (list python-docutils
2705 python-pypa-build))
2706 (home-page "https://github.com/jaraco/pytest-checkdocs")
2707 (synopsis "Check the README when running tests")
2708 (description
2709 "This package provides a pytest plugin that checks the long description
2710of the project to ensure it renders properly.")
2711 (license license:expat)))
2712
2713(define-public python-pytest-click
2714 (package
2715 (name "python-pytest-click")
2716 (version "1.0.2")
2717 (source
2718 (origin
2719 (method git-fetch)
2720 (uri (git-reference
2721 (url "https://github.com/Stranger6667/pytest-click")
2722 (commit (string-append "v" version))))
2723 (file-name (git-file-name name version))
2724 (sha256
2725 (base32 "197nvlqlyfrqpy5lrkmfh1ywpr6j9zipxl9d7syg2a2n7jz3a8rj"))))
2726 (build-system pyproject-build-system)
2727 (native-inputs (list python-setuptools python-wheel))
2728 (propagated-inputs (list python-click python-pytest))
2729 (home-page "https://github.com/Stranger6667/pytest-click")
2730 (synopsis "Pytest plugin for Click")
2731 (description
2732 "This package provides a plugin to test Python click interfaces with
2733pytest.")
2734 (license license:expat)))
2735
2736(define-public python-pytest-console-scripts
2737 (package
2738 (name "python-pytest-console-scripts")
2739 (version "1.4.1")
2740 (source
2741 (origin
2742 (method url-fetch)
2743 (uri (pypi-uri "pytest-console-scripts" version))
2744 (sha256
2745 (base32 "15d8yi6g9wd7g6gkzhp0m3fpnbvnglfkhi4yxc1a5by09kc6x0js"))))
2746 (build-system pyproject-build-system)
2747 (arguments
2748 (list
2749 #:test-flags
2750 #~(list "-k" (string-join
2751 ;; FileNotFoundError: [Errno 2] No such file or directory:
2752 ;; 'script.py'
2753 (list "not test_elsewhere_in_the_path"
2754 "test_shell"
2755 "test_run_path")
2756 " and not "))))
2757 (native-inputs
2758 (list python-pytest-bootstrap
2759 python-setuptools))
2760 (home-page "https://github.com/kvas-it/pytest-console-scripts")
2761 (synopsis "Pytest plugin for testing console scripts")
2762 (description
2763 "This package provides a pytest plugin for testing console scripts.")
2764 (license license:expat)))
2765
2766(define-public python-pytest-cookies
2767 (package
2768 (name "python-pytest-cookies")
2769 (version "0.7.0")
2770 (source
2771 (origin
2772 (method git-fetch) ; no tests in PyPI
2773 (uri (git-reference
2774 (url "https://github.com/hackebrot/pytest-cookies")
2775 (commit version)))
2776 (file-name (git-file-name name version))
2777 (sha256
2778 (base32 "1x7ny6mx1siy9law1cv1i63nvv9ds2g1dlagm40l8qymxry43mjn"))))
2779 (build-system pyproject-build-system)
2780 (native-inputs (list python-pytest python-setuptools python-wheel))
2781 (propagated-inputs (list python-cookiecutter))
2782 (home-page "https://github.com/hackebrot/pytest-cookies")
2783 (synopsis "Pytest plugin for Cookiecutter templates")
2784 (description
2785 "This Pytest plugin adds a @code{cookies} fixture, which is a
2786wrapper for the Cookiecutter API. This fixture helps you verify that
2787your template is working as expected and takes care of cleaning up after
2788running the tests.")
2789 (license license:expat)))
2790
2791(define-public python-pytest-csv
2792 (package
2793 (name "python-pytest-csv")
2794 (version "3.0.0")
2795 (source
2796 (origin
2797 (method git-fetch) ;no tests in PyPI archive
2798 (uri (git-reference
2799 (url "https://github.com/nicoulaj/pytest-csv")
2800 (commit version)))
2801 (file-name (git-file-name name version))
2802 (sha256
2803 (base32
2804 "17518f2fn5l98lyk9p8r7215c1whi61imzrh6ahrmcksr8w0zz04"))))
2805 (build-system pyproject-build-system)
2806 (native-inputs
2807 (list python-pytest-8
2808 python-pytest-flake8
2809 python-pytest-xdist
2810 python-setuptools
2811 python-tabulate
2812 python-wheel))
2813 (propagated-inputs
2814 (list python-six))
2815 (home-page "https://github.com/nicoulaj/pytest-csv")
2816 (synopsis "CSV reporter for Pytest")
2817 (description "This package provides a plugin for Pytest that enables a
2818CSV output mode for Pytest. It can be enabled via the @option{--csv} option
2819it adds to the Pytest command line interface (CLI).")
2820 (license license:gpl3+)))
2821
2822(define-public python-pytest-cython
2823 (package
2824 (name "python-pytest-cython")
2825 (version "0.3.1")
2826 (source
2827 (origin
2828 (method url-fetch)
2829 (uri (pypi-uri "pytest-cython" version))
2830 (sha256
2831 (base32 "0ma496dgmmrpgqd3zk6vin29dgajcplh63yqd8jh2a3ai954fr22"))))
2832 (build-system pyproject-build-system)
2833 (arguments
2834 (list
2835 ;; E ModuleNotFoundError: No module named 'setuptools.sandbox'
2836 #:tests? #f)) ;XXX: tests are broken
2837 (native-inputs (list python-cython python-setuptools python-wheel))
2838 (propagated-inputs (list python-pytest))
2839 (home-page "https://github.com/lgpage/pytest-cython")
2840 (synopsis "Cython extension modules testing plugin")
2841 (description
2842 "This package provides a plugin for testing Cython extension modules.")
2843 (license license:expat)))
2844
2845(define-public python-pytest-datafiles
2846 (package
2847 (name "python-pytest-datafiles")
2848 (version "3.0.0")
2849 (source
2850 (origin
2851 (method git-fetch) ; no tests in the PyPI tarball
2852 (uri (git-reference
2853 (url "https://github.com/omarkohl/pytest-datafiles")
2854 (commit version)))
2855 (file-name (git-file-name name version))
2856 (sha256
2857 (base32 "1wbgfsn4pcdm0bw61pwaaq707mlfnixlff3x8m5mpsf6jhrzql30"))))
2858 (build-system pyproject-build-system)
2859 (native-inputs
2860 (list python-pytest python-setuptools python-wheel))
2861 (home-page "https://github.com/omarkohl/pytest-datafiles")
2862 (synopsis "Pytest plugin to create a tmpdir")
2863 (description
2864 "A pytest plugin to create a tmpdir containing a preconfigured set of
2865files and/or directories.")
2866 (license license:expat)))
2867
2868(define-public python-pytest-dependency
2869 (package
2870 (name "python-pytest-dependency")
2871 (version "0.6.0")
2872 (source
2873 (origin
2874 (method url-fetch)
2875 (uri (pypi-uri "pytest-dependency" version))
2876 (sha256
2877 (base32 "1hdcidq4miqd5fvg9khvzw3gm3waxnp7wgqr5h39anfr75m0wjwk"))))
2878 (build-system pyproject-build-system)
2879 (native-inputs
2880 (list python-pytest-bootstrap
2881 python-setuptools))
2882 (home-page "https://github.com/RKrahl/pytest-dependency")
2883 (synopsis "Manage dependencies of tests")
2884 (description
2885 "This pytest plugin manages dependencies of tests. It allows
2886to mark some tests as dependent from other tests. These tests will then be
2887skipped if any of the dependencies did fail or has been skipped.")
2888 (license license:asl2.0)))
2889
2890(define-public python-pytest-describe
2891 (package
2892 (name "python-pytest-describe")
2893 (version "3.1.0")
2894 (source
2895 (origin
2896 (method git-fetch)
2897 (uri (git-reference
2898 (url "https://github.com/pytest-dev/pytest-describe")
2899 (commit version)))
2900 (file-name (git-file-name name version))
2901 (sha256
2902 (base32 "1miz5wi43fp4zi0a2h1lsj5zhg6681zalws7gamxcfswvp0xj2na"))))
2903 (build-system pyproject-build-system)
2904 (arguments
2905 (list
2906 ;; XXX: Requires the unpackaged python-uv.
2907 #:build-backend "setuptools.build_meta"
2908 #:phases
2909 #~(modify-phases %standard-phases
2910 (add-after 'unpack 'fix-pyproject.toml
2911 (lambda _
2912 (substitute* "pyproject.toml"
2913 (("\"License :: OSI Approved :: MIT License\",")
2914 "")))))))
2915 (propagated-inputs (list python-pytest))
2916 (native-inputs (list python-setuptools))
2917 (home-page "https://github.com/pytest-dev/pytest-describe")
2918 (synopsis "Describe-style plugin for pytest")
2919 (description
2920 "@code{pytest-describe} is a plugin for @code{python-pytest} that allows
2921tests to be written in arbitrary nested describe-blocks, similar to
2922@code{ruby-rspec}.")
2923 (license license:expat)))
2924
2925(define-public python-pytest-docker-tools
2926 (package
2927 (name "python-pytest-docker-tools")
2928 (version "3.1.9")
2929 (source
2930 (origin
2931 (method git-fetch)
2932 (uri (git-reference
2933 (url "https://github.com/Jc2k/pytest-docker-tools")
2934 (commit (string-append "v" version))))
2935 (file-name (git-file-name name version))
2936 (sha256
2937 (base32 "06w89kvxqma5ns6gndmk6g048qpv10wdwf61ynii1mm1n0xy11sr"))))
2938 (build-system pyproject-build-system)
2939 (arguments
2940 (list
2941 #:test-flags
2942 ;; All other tests seem to require docker daemon running.
2943 #~(list "tests/test_utils.py")))
2944 (native-inputs
2945 (list python-pytest
2946 python-requests
2947 python-setuptools))
2948 (propagated-inputs
2949 (list python-docker))
2950 (home-page "https://github.com/Jc2k/pytest-docker-tools")
2951 (synopsis "Test your built docker image")
2952 (description
2953 "This package is a set of opinionated helpers for creating py.test fixtures
2954for your smoke testing and integration testing. It strives to keep your
2955environment definition declarative, like a docker-compose.yml. It embraces
2956 py.test fixture overloading.")
2957 (license license:asl2.0)))
2958
2959(define-public python-pytest-doctest-custom
2960 (package
2961 (name "python-pytest-doctest-custom")
2962 (version "1.0.0")
2963 (source
2964 (origin
2965 (method git-fetch)
2966 (uri (git-reference
2967 (url "https://github.com/danilobellini/pytest-doctest-custom")
2968 (commit (string-append "v" version))))
2969 (file-name (git-file-name name version))
2970 (sha256
2971 (base32 "0hpdfazzvpgyhfr5la9n8k7a1j3z2nvqp76wiyzr73ha5wij33zl"))))
2972 (build-system pyproject-build-system)
2973 (arguments
2974 (list
2975 #:phases
2976 #~(modify-phases %standard-phases
2977 (replace 'check
2978 (lambda* (#:key inputs outputs tests? #:allow-other-keys)
2979 (when tests?
2980 (add-installed-pythonpath inputs outputs)
2981 (invoke "python" "test_pytest_doctest_custom.py")))))))
2982 (native-inputs (list python-pytest python-setuptools python-wheel))
2983 (home-page "https://github.com/danilobellini/pytest-doctest-custom")
2984 (synopsis
2985 "Pytest plugin to customize string representations of doctest results")
2986 (description
2987 "This package provides a Pytest plugin for customizing string
2988representations of doctest results. It can change the display hook used by
2989doctest to render the object representations.")
2990 (license license:expat)))
2991
2992(define-public python-pytest-doctestplus
2993 (package
2994 (name "python-pytest-doctestplus")
2995 (version "1.6.0")
2996 (source
2997 (origin
2998 (method url-fetch)
2999 (uri (pypi-uri "pytest-doctestplus" version))
3000 (sha256
3001 (base32 "0ybn613rp0wqzm97hncwnpn8wx7bz91rajgnclplv8yfr2iahwi4"))))
3002 (build-system pyproject-build-system)
3003 (arguments
3004 (list
3005 ;; tests: 44 passed, 6 deselected, 1 xfailed
3006 #:test-flags
3007 #~(list "-k" (string-join
3008 ;; Tests requiring network access.
3009 (list "not test_remote_data_url"
3010 "test_remote_data_float_cmp"
3011 "test_remote_data_ignore_whitespace"
3012 "test_remote_data_ellipsis"
3013 "test_remote_data_requires"
3014 "test_remote_data_ignore_warnings")
3015 " and not "))
3016 #:phases
3017 #~(modify-phases %standard-phases
3018 (add-after 'unpack 'patch-git-path
3019 (lambda* (#:key inputs #:allow-other-keys)
3020 (substitute* "pytest_doctestplus/plugin.py"
3021 (("\"git\"")
3022 (format #f "~s" (search-input-file inputs "/bin/git")))))))))
3023 (native-inputs
3024 (list git-minimal/pinned
3025 python-numpy
3026 python-pytest-bootstrap
3027 python-setuptools
3028 python-setuptools-scm))
3029 (propagated-inputs
3030 (list python-packaging))
3031 (home-page "https://github.com/astropy/pytest-doctestplus")
3032 (synopsis "Pytest plugin with advanced doctest features")
3033 (description
3034 "This package contains a plugin for the Pytest framework that provides
3035advanced doctest support and enables the testing of reStructuredText files.")
3036 (license license:bsd-3)))
3037
3038(define-public python-pytest-env
3039 (package
3040 (name "python-pytest-env")
3041 (version "1.1.5")
3042 (source
3043 (origin
3044 (method url-fetch)
3045 (uri (pypi-uri "pytest_env" version))
3046 (sha256
3047 (base32 "1ky11hgb00wdz3mrsfk6zp17r56j99allimcfd83hhqfm909h84i"))))
3048 (build-system pyproject-build-system)
3049 (native-inputs
3050 (list python-hatch-vcs
3051 python-hatchling
3052 python-pytest))
3053 (home-page "https://github.com/MobileDynasty/pytest-env")
3054 (synopsis "Pytest plugin that allows you to add environment variables")
3055 (description
3056 "This is a @code{py.test} plugin that enables you to set environment
3057variables in the @file{pytest.ini} file.")
3058 (license license:expat)))
3059
3060(define-public python-pytest-fail-slow
3061 (package
3062 (name "python-pytest-fail-slow")
3063 (version "0.6.0")
3064 (source
3065 (origin
3066 (method git-fetch)
3067 (uri (git-reference
3068 (url "https://github.com/jwodder/pytest-fail-slow")
3069 (commit (string-append "v" version))))
3070 (file-name (git-file-name name version))
3071 (sha256
3072 (base32 "0xabggi5s6p87dji1f8gg08fxp74g9h2nbj9x9n5vkzmf3hy5l7i"))))
3073 (build-system pyproject-build-system)
3074 ;; Each test waits 2-5s which delays completion.
3075 ;; tests: 317 passed
3076 (native-inputs
3077 (list python-hatchling
3078 python-pytest-bootstrap))
3079 (propagated-inputs
3080 (list python-pluggy))
3081 (home-page "https://github.com/jwodder/pytest-fail-slow")
3082 (synopsis "Fail tests that take too long to run")
3083 (description "Pytest plugin for failing tests that take too long to run.")
3084 (license license:expat)))
3085
3086(define-public python-pytest-filter-subpackage
3087 (package
3088 (name "python-pytest-filter-subpackage")
3089 (version "0.2.0")
3090 (source
3091 (origin
3092 (method url-fetch)
3093 (uri (pypi-uri "pytest-filter-subpackage" version))
3094 (sha256
3095 (base32 "0mmgg2n8qk6s2kprycjl70lxcpm43dkapplmkf32i0ai6qdqyiiz"))))
3096 (build-system pyproject-build-system)
3097 (native-inputs
3098 (list python-pytest
3099 python-pytest-doctestplus
3100 python-setuptools-scm
3101 python-setuptools
3102 python-wheel))
3103 (home-page "https://github.com/astropy/pytest-filter-subpackage")
3104 (synopsis "Pytest plugin for filtering based on sub-packages")
3105 (description
3106 "This package contains a simple plugin for the pytest framework that
3107provides a shortcut to testing all code and documentation for a given
3108sub-package.")
3109 (license license:bsd-3)))
3110
3111(define-public python-pytest-fixture-config
3112 ;; TODO: Master branch has removed all Python 2 support such Six, consider
3113 ;; to update and drop python-six from closure in the next update cycle.
3114 (package
3115 (name "python-pytest-fixture-config")
3116 (version "1.8.0")
3117 (source
3118 (origin
3119 (method url-fetch)
3120 (uri (pypi-uri "pytest-fixture-config" version))
3121 (sha256
3122 (base32
3123 "03hvviv0a4y0r8pdnj5s3hdbr2d3k9cx0ipjafxbsl88w9gqjff7"))))
3124 (build-system pyproject-build-system)
3125 (native-inputs
3126 (list python-pytest-bootstrap
3127 python-setuptools
3128 python-six))
3129 (home-page "https://github.com/manahl/pytest-plugins")
3130 (synopsis "Fixture configuration utils for py.test")
3131 (description
3132 "This package provides fixture configuration utilities for the py.test
3133testing framework.")
3134 (license license:expat)))
3135
3136(define-public python-pytest-flake8
3137 (package
3138 (name "python-pytest-flake8")
3139 (version "1.3.0")
3140 (source
3141 (origin
3142 (method url-fetch)
3143 (uri (pypi-uri "pytest_flake8" version))
3144 (sha256
3145 (base32
3146 "1rhz7mxcg7x9dbabfcjai3zxikfgw7az07m4ddf92bg35ib3byw8"))))
3147 (build-system pyproject-build-system)
3148 (native-inputs
3149 (list python-pytest-8
3150 python-setuptools))
3151 (propagated-inputs
3152 (list python-flake8))
3153 (home-page "https://github.com/tholo/pytest-flake8")
3154 (synopsis "Pytest plugin to check FLAKE8 requirements")
3155 (description
3156 "This package provides a pytest plugin for efficiently checking PEP8
3157compliance.")
3158 (license license:bsd-3)))
3159
3160(define-public python-pytest-flake8-path
3161 (package
3162 (name "python-pytest-flake8-path")
3163 (version "1.6.0")
3164 (source
3165 (origin
3166 (method git-fetch) ;no tests in PyPI archive
3167 (uri (git-reference
3168 (url "https://github.com/adamchainz/pytest-flake8-path")
3169 (commit version)))
3170 (file-name (git-file-name name version))
3171 (sha256
3172 (base32 "1k1lv34jmfirdwa2dpiim8803b6krqy3m7k2knc39fgmzbd6yc8z"))))
3173 (build-system pyproject-build-system)
3174 (native-inputs
3175 (list python-setuptools
3176 python-wheel))
3177 (propagated-inputs
3178 (list python-flake8
3179 python-pytest))
3180 (home-page "https://github.com/adamchainz/pytest-flake8-path")
3181 (synopsis "Pytest fixture for testing flake8 plugins")
3182 (description
3183 "This package provides a pytest fixture for testing flake8 plugins.")
3184 (license license:expat)))
3185
3186(define-public python-pytest-flakefinder
3187 (package
3188 (name "python-pytest-flakefinder")
3189 (version "1.1.0")
3190 (source
3191 (origin
3192 (method url-fetch)
3193 (uri (pypi-uri "pytest-flakefinder" version))
3194 (sha256
3195 (base32 "03iy80xlkpgzjs2kxa9rrj8dbnp9awyhpcl3hy8fgf5x40cjlhg2"))))
3196 (build-system pyproject-build-system)
3197 (native-inputs (list python-wheel python-setuptools))
3198 (propagated-inputs (list python-pytest))
3199 (home-page "https://github.com/dropbox/pytest-flakefinder")
3200 (synopsis "Pytest plugin for finding flaky tests")
3201 (description "This package provides a Pytest plugin to run tests multiple
3202times and detect flakiness.")
3203 (license license:asl2.0)))
3204
3205(define-public python-pytest-flask
3206 (package
3207 (name "python-pytest-flask")
3208 (version "1.3.0")
3209 (source
3210 (origin
3211 (method url-fetch)
3212 (uri (pypi-uri "pytest-flask" version))
3213 (sha256
3214 (base32 "0pm93xli1pvq9w053grndi84hxq087mr2xhagvac98qvnabirgjq"))))
3215 (build-system pyproject-build-system)
3216 (native-inputs
3217 (list python-pytest
3218 python-setuptools
3219 python-setuptools-scm
3220 python-wheel))
3221 (propagated-inputs
3222 (list python-flask))
3223 (home-page "https://github.com/pytest-dev/pytest-flask")
3224 (synopsis "Pytest fixtures to test Flask applications")
3225 (description
3226 "This pytest plugin provides fixtures to simplify Flask app testing.")
3227 (license license:expat)))
3228
3229(define-public python-pytest-freezer
3230 (package
3231 (name "python-pytest-freezer")
3232 (version "0.4.9")
3233 (source
3234 (origin
3235 (method url-fetch)
3236 (uri (pypi-uri "pytest_freezer" version))
3237 (sha256
3238 (base32 "0an8y6ri3bhij4137gphdw2yg6rq7if4nb1qjj7zjsy4kjy1dgr1"))))
3239 (build-system pyproject-build-system)
3240 (native-inputs
3241 (list python-flit-core))
3242 (propagated-inputs
3243 (list python-freezegun
3244 python-pytest))
3245 (home-page "https://github.com/pytest-dev/pytest-freezer/")
3246 (synopsis "Pytest plugin providing a fixture interface for spulec/freezegun")
3247 (description
3248 "Pytest plugin providing a fixture interface for
3249@url{https://github.com/spulec/freezegun, freezegun}.")
3250 (license license:expat)))
3251
3252(define-public python-pytest-harvest
3253 (package
3254 (name "python-pytest-harvest")
3255 (version "1.10.5")
3256 (source
3257 (origin
3258 (method url-fetch)
3259 (uri (pypi-uri "pytest-harvest" version))
3260 (sha256
3261 (base32 "066lqx46hqlvllq6ppmyi47fjc1dww7jwa4wfkkx2hrf3z7s9kr7"))))
3262 (build-system pyproject-build-system)
3263 (arguments
3264 (list #:tests? #f)) ;XXX: cycle with python-pytest-harvest
3265 (native-inputs
3266 (list python-pytest-bootstrap
3267 python-setuptools
3268 python-setuptools-scm))
3269 (propagated-inputs
3270 (list python-decopatch
3271 python-makefun
3272 python-packaging))
3273 (home-page "https://github.com/smarie/python-pytest-harvest")
3274 (synopsis "Pytest plugin to store data during runs")
3275 (description
3276 "This package implements a functionality to store data created during your
3277pytest tests execution, and retrieve it at the end of the session, e.g. for
3278applicative benchmarking purposes.")
3279 (license license:bsd-3)))
3280
3281(define-public python-pytest-helpers-namespace
3282 (package
3283 (name "python-pytest-helpers-namespace")
3284 (version "2021.3.24")
3285 (source
3286 (origin
3287 (method git-fetch)
3288 (uri (git-reference
3289 (url "https://github.com/saltstack/pytest-helpers-namespace")
3290 (commit (string-append "v" version))))
3291 (file-name (git-file-name name version))
3292 (sha256
3293 (base32 "0ikwiwp9ycgg7px78nxdkqvg7j97krb6vzqlb8fq8fvbwrj4q4v2"))))
3294 (build-system pyproject-build-system)
3295 (native-inputs (list python-pytest python-setuptools python-setuptools-scm
3296 python-setuptools-declarative-requirements
3297 python-wheel))
3298 (home-page "https://github.com/saltstack/pytest-helpers-namespace")
3299 (synopsis "Pytest Helpers Namespace Plugin")
3300 (description
3301 "Pytest Helpers Namespace Plugin provides a helpers pytest namespace
3302which can be used to register helper functions without requiring someone to
3303import them in their actual tests to use them.")
3304 (license license:asl2.0)))
3305
3306(define-public python-pytest-home
3307 (package
3308 (name "python-pytest-home")
3309 (version "0.6.0")
3310 (source
3311 (origin
3312 (method git-fetch)
3313 (uri (git-reference
3314 (url "https://github.com/jaraco/pytest-home")
3315 (commit (string-append "v" version))))
3316 (file-name (git-file-name name version))
3317 (sha256
3318 (base32 "151xx48dahbh7yx2a9cr9f2iy2i6f7s3zsm4zn5apvgl9qmjhkk7"))))
3319 (build-system pyproject-build-system)
3320 (propagated-inputs (list python-pytest))
3321 (native-inputs
3322 (list git-minimal/pinned
3323 python-pytest
3324 python-setuptools
3325 python-setuptools-scm))
3326 (home-page "https://github.com/jaraco/pytest-home")
3327 (synopsis "Home directory fixtures")
3328 (description
3329 "This package provides home directory fixtures for pytest.")
3330 (license license:expat)))
3331
3332(define-public python-pytest-html
3333 (package
3334 (name "python-pytest-html")
3335 (version "4.1.1")
3336 (source
3337 (origin
3338 (method url-fetch)
3339 (uri (pypi-uri "pytest_html" version))
3340 (sha256
3341 (base32 "01vgd2bbk3n9wcqzx9dv72qgkx684l8cp92n9c3ll3w0wn51x83h"))))
3342 (build-system pyproject-build-system)
3343 (arguments
3344 (list
3345 #:test-flags
3346 ;; It requires running browser for selenium.
3347 #~(list "--ignore=testing/test_integration.py"
3348 "--ignore=testing/test_e2e.py")))
3349 (native-inputs
3350 (list python-hatchling
3351 python-hatch-vcs
3352 python-assertpy
3353 python-beautifulsoup4
3354 python-pytest))
3355 (propagated-inputs
3356 (list python-jinja2
3357 python-pytest-metadata))
3358 (home-page "https://github.com/pytest-dev/pytest-html")
3359 (synopsis "Pytest plugin for generating HTML reports")
3360 (description
3361 "This package provides a pytest plugin for generating HTML reports.")
3362 (license license:mpl2.0)))
3363
3364(define-public python-pytest-httpx
3365 (package
3366 (name "python-pytest-httpx")
3367 (version "0.35.0")
3368 (source
3369 (origin
3370 ;; pypi package doesn't include the tests
3371 (method git-fetch)
3372 (uri (git-reference
3373 (url "https://github.com/Colin-b/pytest_httpx")
3374 (commit (string-append "v" version))))
3375 (file-name (git-file-name name version))
3376 (sha256
3377 (base32 "1w8qwhcaq1l63kfj4ncsi3355ln37ws6066mxr0b9646g68wp69v"))))
3378 (build-system pyproject-build-system)
3379 (arguments
3380 (list
3381 ;; XXX: 261 failed, 170 errors
3382 #:tests? #f))
3383 (native-inputs
3384 (list python-pytest-8
3385 python-pytest-asyncio
3386 python-setuptools
3387 python-wheel))
3388 (propagated-inputs (list python-httpx))
3389 (home-page "https://colin-b.github.io/pytest_httpx/")
3390 (synopsis "Pytest plugin to mock httpx")
3391 (description "This package provides a pytest fixture to mock httpx
3392requests to be replied to with user provided responses.")
3393 (license license:expat)))
3394
3395(define-public python-pytest-instafail
3396 (package
3397 (name "python-pytest-instafail")
3398 (version "0.5.0")
3399 (source
3400 (origin
3401 (method git-fetch)
3402 (uri (git-reference
3403 (url "https://github.com/pytest-dev/pytest-instafail")
3404 (commit (string-append "v" version))))
3405 (file-name (git-file-name name version))
3406 (sha256
3407 (base32 "0dxlvvs08ln9y2d3bzs88c303xxgd0n18q9liy9kkdyhy54f70wa"))))
3408 (build-system pyproject-build-system)
3409 (propagated-inputs (list python-pytest))
3410 (native-inputs (list python-setuptools))
3411 (home-page "https://github.com/pytest-dev/pytest-instafail")
3412 (synopsis "Pytest plugin to show failures instantly")
3413 (description
3414 "This package provides a pytest plugin to show failures instantly.")
3415 (license license:bsd-3)))
3416
3417(define-public python-pytest-isort
3418 (package
3419 (name "python-pytest-isort")
3420 (version "4.0.0")
3421 (source
3422 (origin
3423 (method git-fetch)
3424 (uri (git-reference
3425 (url "https://github.com/stephrdev/pytest-isort")
3426 (commit version)))
3427 (file-name (git-file-name name version))
3428 (sha256
3429 (base32 "1bhcmn4589l228n05bn8mgk7chyr9262bm9zxpwhcdiyhyspdjvw"))))
3430 (build-system pyproject-build-system)
3431 (propagated-inputs (list python-isort python-pytest))
3432 (native-inputs (list python-poetry-core))
3433 (home-page "https://github.com/stephrdev/pytest-isort")
3434 (synopsis "Pytest plugin to check import ordering using isort")
3435 (description
3436 "This package provides a pytest plugin to check import ordering using
3437isort.")
3438 (license license:bsd-3)))
3439
3440(define-public python-pytest-localftpserver
3441 (package
3442 (name "python-pytest-localftpserver")
3443 (version "1.5.0")
3444 (source
3445 (origin
3446 (method git-fetch)
3447 (uri (git-reference
3448 (url "https://github.com/oz123/pytest-localftpserver")
3449 (commit (string-append "v" version))))
3450 (file-name (git-file-name name version))
3451 (sha256
3452 (base32 "1am6hxizr57fg59fgqmkclwd3hj2p65jpma9jv6l8jl39cqyl4xa"))))
3453 (build-system pyproject-build-system)
3454 (arguments
3455 (list
3456 #:test-flags
3457 ;; Taken from tox.ini.
3458 #~(list "--basetemp=/tmp/pytest_localftpserver"
3459 "tests/test_pytest_localftpserver.py"
3460 "tests/test_helper_functions.py"
3461 "tests/test_pytest_localftpserver_TLS.py")))
3462 (native-inputs
3463 (list python-pytest-bootstrap
3464 python-setuptools
3465 python-setuptools-scm))
3466 (propagated-inputs
3467 (list python-pyftpdlib))
3468 (home-page "https://github.com/oz123/pytest-localftpserver")
3469 (synopsis "Pytest plugin which provides an FTP fixture for tests")
3470 (description
3471 "This package provides the fixtures @code{ftpserver} and
3472@code{ftpserver_TLS}, which are threaded instances of a FTP server, with which
3473you can upload files and test FTP functionality.")
3474 (license license:expat)))
3475
3476(define-public python-pytest-metadata
3477 (package
3478 (name "python-pytest-metadata")
3479 (version "3.1.1")
3480 (source
3481 (origin
3482 (method url-fetch)
3483 (uri (pypi-uri "pytest_metadata" version))
3484 (sha256
3485 (base32 "1j0ph028mj81314vxb027d5b98xii3zl2vd9i8b3zh7val1rp8nj"))))
3486 (build-system pyproject-build-system)
3487 (native-inputs
3488 (list python-hatchling
3489 python-hatch-vcs
3490 python-pytest
3491 python-setuptools-scm))
3492 (home-page "https://github.com/pytest-dev/pytest-metadata")
3493 (synopsis "Access test session metadata with Pytest")
3494 (description
3495 "@code{pytest-metadata} is a @command{pytest} plugin that provides
3496access to test session metadata.")
3497 (license license:mpl2.0)))
3498
3499(define-public python-pytest-mockito
3500 (package
3501 (name "python-pytest-mockito")
3502 (version "0.0.5")
3503 (source
3504 (origin
3505 (method git-fetch)
3506 (uri (git-reference
3507 (url "https://github.com/kaste/pytest-mockito")
3508 (commit version)))
3509 (file-name (git-file-name name version))
3510 (sha256
3511 (base32 "0rq4mb1ycs3l1mpl682ybycvywmf4cp3vlrv9r1a9d2cb6qdwz8r"))))
3512 (build-system pyproject-build-system)
3513 (native-inputs
3514 (list python-hatch-vcs
3515 python-hatchling
3516 python-pytest-bootstrap
3517 python-setuptools-scm))
3518 (propagated-inputs
3519 (list python-mockito))
3520 (home-page "https://github.com/kaste/pytest-mockito")
3521 (synopsis "Mockito base fixtures for Pytest")
3522 (description
3523 "The @code{pytest-mockito} plugin provides base Mockito fixtures for
3524Pytest. It covers the main entry points of the Mockito mocking framework and
3525makes it easy to undo any monkey patching.
3526
3527The fixtures are:
3528@itemize
3529@item when
3530@item when2
3531@item expect
3532@item patch
3533@item unstub
3534@item spy2
3535@end itemize")
3536 (license license:expat)))
3537
3538(define-public python-pytest-mpi
3539 (package
3540 (name "python-pytest-mpi")
3541 (version "0.6")
3542 (source
3543 (origin
3544 (method url-fetch)
3545 (uri (pypi-uri "pytest-mpi" version))
3546 (sha256
3547 (base32 "1a954cai5lr327np5f38mg8gw91p4akx8m2z416wvwzq24swvcq9"))))
3548 (build-system pyproject-build-system)
3549 (arguments
3550 ;; See <https://github.com/aragilar/pytest-mpi/issues/4>.
3551 (list #:test-flags
3552 #~(list "-p" "pytester"
3553 #$@(if (target-aarch64?)
3554 ;; Some tests fail on non x86_64 more likely the
3555 ;; project does not support any other ones, see
3556 ;; <ci/azure-pipelines-steps.yml>.
3557 ;; ValueError: Pytest terminal summary report not found
3558 '("-k" (string-join
3559 (list "not test_mpi_file_name"
3560 "test_mpi_only_mpi"
3561 "test_mpi_skip_under_mpi"
3562 "test_mpi_tmp_path"
3563 "test_mpi_tmpdir"
3564 "test_mpi_with_mpi"
3565 "test_mpi_xfail_under_mpi")
3566 " and not "))
3567 '()))))
3568 (native-inputs
3569 (list openmpi
3570 python-pytest
3571 python-setuptools
3572 python-sybil
3573 python-wheel))
3574 (home-page "https://pytest-mpi.readthedocs.io")
3575 (synopsis "Pytest plugin to collect information from tests")
3576 (description
3577 "@code{pytest_mpi} is a plugin for pytest providing some useful tools
3578when running tests under MPI, and testing MPI-related code.")
3579 (license license:bsd-3)))
3580
3581(define-public python-pytest-mpl
3582 (package
3583 (name "python-pytest-mpl")
3584 (version "0.17.0")
3585 (source
3586 (origin
3587 (method url-fetch)
3588 (uri (pypi-uri "pytest-mpl" version))
3589 (sha256
3590 (base32 "1inaaafzxgbxldz4xqvx68gpj8p5i30qlsgva8sb7d34wvbhbvzv"))))
3591 (build-system pyproject-build-system)
3592 (arguments
3593 (list
3594 #:test-flags #~(list "-m" "mpl_image_compare")))
3595 (native-inputs
3596 (list python-pytest
3597 python-setuptools
3598 python-setuptools-scm
3599 python-wheel))
3600 (propagated-inputs
3601 (list python-jinja2
3602 python-matplotlib
3603 python-packaging
3604 python-pillow))
3605 (home-page "https://github.com/matplotlib/pytest-mpl")
3606 (synopsis "Pytest plugin to help with testing figures output from Matplotlib")
3607 (description
3608 "This is a plugin to facilitate image comparison for Matplotlib figures
3609in Pytest.")
3610 (license license:bsd-3)))
3611
3612(define-public python-pytest-openfiles
3613 (package
3614 (name "python-pytest-openfiles")
3615 (version "0.6.0")
3616 (source
3617 (origin
3618 (method url-fetch)
3619 (uri (pypi-uri "pytest_openfiles" version))
3620 (sha256
3621 (base32 "14x9f1l9a5ghf527i5qfcfa003mkrky1dhx2hfwq5nma9v1n0lgz"))))
3622 (build-system pyproject-build-system)
3623 (native-inputs
3624 (list python-pytest
3625 python-setuptools
3626 python-setuptools-scm
3627 python-wheel))
3628 (propagated-inputs
3629 (list python-psutil))
3630 (home-page "https://github.com/astropy/pytest-openfiles")
3631 (synopsis "Pytest plugin for detecting inadvertent open file handles")
3632 (description
3633 "This package provides a plugin for the pytest framework that allows
3634developers to detect whether any file handles or other file-like objects
3635were inadvertently left open at the end of a unit test.")
3636 (license license:bsd-3)))
3637
3638(define-public python-pytest-order
3639 (package
3640 (name "python-pytest-order")
3641 (version "1.3.0")
3642 (source
3643 (origin
3644 (method url-fetch)
3645 (uri (pypi-uri "pytest_order" version))
3646 (sha256
3647 (base32 "1pixy83l6hcg16gjc04vp4misk2w989alkd9msnw1s9y7pn8yq2i"))))
3648 (build-system pyproject-build-system)
3649 (arguments
3650 (list
3651 ;; XXX: 4 failed, 18 errors
3652 #:tests? #f))
3653 (native-inputs
3654 (list python-pytest python-pytest-xdist
3655 python-setuptools python-wheel))
3656 (home-page "https://github.com/pytest-dev/pytest-order")
3657 (synopsis "Pytest plugin to run your tests in a specific order")
3658 (description
3659 "This plugin defines Pytest markers to ensure that some tests, or groups
3660of tests run in a specific order.")
3661 (license license:expat)))
3662
3663(define-public python-pytest-parawtf
3664 (package
3665 (name "python-pytest-parawtf")
3666 (version "1.0.2")
3667 (source
3668 (origin
3669 (method url-fetch)
3670 (uri (pypi-uri "pytest-parawtf" version))
3671 (sha256
3672 (base32 "08s86hy58lvrd90cnayzydvac4slaflj0ph9yknakcc42anrm023"))))
3673 (build-system pyproject-build-system)
3674 (arguments
3675 (list
3676 #:test-flags
3677 ;; https://github.com/flub/pytest-parawtf/issues/1
3678 #~(list "-k" "not test_mark")))
3679 (native-inputs (list python-pytest python-setuptools python-wheel))
3680 (propagated-inputs (list python-pytest))
3681 (home-page "https://github.com/flub/pytest-parawtf/")
3682 (synopsis "Finally spell paramete?ri[sz]e correctly")
3683 (description
3684 "Pytest uses one of four different spellings of parametrize. This plugin
3685allows you to use all four.")
3686 (license license:expat)))
3687
3688(define-public python-pytest-pycodestyle
3689 (package
3690 (name "python-pytest-pycodestyle")
3691 (version "2.5.0")
3692 (source
3693 (origin
3694 (method git-fetch)
3695 (uri (git-reference
3696 (url "https://github.com/henry0312/pytest-pycodestyle")
3697 (commit (string-append "v" version))))
3698 (file-name (git-file-name name version))
3699 (sha256
3700 (base32 "1zkzxz37s9ki822q8rfj5wyxwl5wxxna4xjnmb452i1l29rxmysz"))))
3701 (build-system pyproject-build-system)
3702 (native-inputs
3703 (list python-pytest
3704 python-setuptools))
3705 (propagated-inputs
3706 (list python-pycodestyle))
3707 (home-page "https://github.com/henry0312/pytest-pycodestyle")
3708 (synopsis "Pytest plugin to run pycodestyle")
3709 (description "This package provides a plugin to run @code{pycodestyle}
3710for the @code{pytest} framework.")
3711 (license license:expat)))
3712
3713(define-public python-pytest-pydocstyle
3714 (package
3715 (name "python-pytest-pydocstyle")
3716 (version "2.4.0")
3717 (source
3718 (origin
3719 (method git-fetch)
3720 (uri (git-reference
3721 (url "https://github.com/henry0312/pytest-pydocstyle")
3722 (commit (string-append "v" version))))
3723 (file-name (git-file-name name version))
3724 (sha256
3725 (base32 "08jaz92pzq6lqg64jbl9f6j0gdb622wl0qb2llfcy82grx2vv09q"))))
3726 (build-system pyproject-build-system)
3727 (arguments
3728 (list
3729 ;; XXX: pytest failed to import 'py.io', while python can.
3730 #:tests? #f))
3731 (native-inputs
3732 (list python-pytest
3733 python-pytest-isort
3734 python-pytest-pycodestyle
3735 python-setuptools
3736 python-wheel))
3737 (propagated-inputs (list python-pydocstyle python-pytest)) ;apparently required
3738 (home-page "https://github.com/henry0312/pytest-pydocstyle")
3739 (synopsis "Pytest plugin to run @command{pydocstyle}")
3740 (description
3741 "This package provides a Pytest plugin to run @command{pydocstyle}.")
3742 (license license:expat)))
3743
3744(define-public python-pytest-pylint
3745 (package
3746 (name "python-pytest-pylint")
3747 (version "0.21.0")
3748 (source
3749 (origin
3750 (method url-fetch)
3751 (uri (pypi-uri "pytest-pylint" version))
3752 (sha256
3753 (base32 "0gjm9qy1rsngvli042szqc45y0q5zk1crq28ja01iyjw3n74nxl8"))))
3754 (build-system pyproject-build-system)
3755 (native-inputs
3756 (list python-pytest-8
3757 python-setuptools))
3758 (propagated-inputs
3759 (list python-pylint))
3760 (home-page "https://github.com/carsongee/pytest-pylint")
3761 (synopsis "Pytest plugin to check source code with Pylint")
3762 (description
3763 "This plugin allows running Pylint with Pytest and have configurable rule
3764types (i.e. Convention, Warn, and Error) fail the build.")
3765 (license license:expat)))
3766
3767(define-public python-pytest-qt
3768 (package
3769 (name "python-pytest-qt")
3770 (version "4.5.0")
3771 (source
3772 (origin
3773 (method url-fetch)
3774 (uri (pypi-uri "pytest_qt" version))
3775 (sha256
3776 (base32 "17ridbk4gsr1aclgs1ai55r6k2ngrg0wn9b40g96bw48qh0hwqji"))))
3777 (build-system pyproject-build-system)
3778 (arguments
3779 (list
3780 #:phases
3781 #~(modify-phases %standard-phases
3782 (add-before 'check 'set-qpa
3783 (lambda _ (setenv "QT_QPA_PLATFORM" "offscreen"))))))
3784 (native-inputs
3785 (list python-pyqt-6
3786 python-pytest-bootstrap
3787 python-setuptools
3788 python-setuptools-scm))
3789 (propagated-inputs
3790 (list python-pluggy
3791 python-typing-extensions))
3792 (home-page "https://github.com/pytest-dev/pytest-qt")
3793 (synopsis "Pytest support for PyQt and PySide applications")
3794 (description
3795 "@code{pytest-qt} is a Pytest plugin that allows programmers to write
3796tests for PyQt5 and PySide2 applications.
3797
3798The main usage is to use the @code{qtbot} fixture, responsible for handling
3799@code{qApp} creation as needed and provides methods to simulate user
3800interaction, like key presses and mouse clicks.")
3801 (license license:expat)))
3802
3803(define-public python-pytest-random-order
3804 (package
3805 (name "python-pytest-random-order")
3806 (version "1.2.0")
3807 (source
3808 (origin
3809 (method git-fetch)
3810 (uri (git-reference
3811 (url "https://github.com/jbasko/pytest-random-order")
3812 (commit (string-append "v" version))))
3813 (file-name (git-file-name name version))
3814 (sha256
3815 (base32 "044cq8bk3815xckm75yfsjd4x7ykksss9r0r1bb6xi2pnwz3cvvk"))))
3816 (build-system pyproject-build-system)
3817 (arguments
3818 (list
3819 #:test-flags
3820 ;; Tests depending on python-py and python-pytest-xdist, deselect them
3821 ;; to reduce closure size.
3822 #~(list #$@(map (lambda (test)
3823 (string-append "--deselect=tests/"
3824 "test_actual_test_runs.py::"
3825 test))
3826 (list "test_it_works_with_actual_tests[class-2-5]"
3827 "test_it_works_with_actual_tests[module-2-5]"
3828 "test_it_works_with_actual_tests[package-2-5]"
3829 "test_it_works_with_actual_tests[global-2-5]"
3830 "test_it_works_with_actual_tests[none-1-1]"
3831 "test_it_works_with_actual_tests[parent-1-5]"
3832 "test_it_works_with_actual_tests[grandparent-1-5]"
3833 "test_failed_first[global]"
3834 "test_failed_first[package]"
3835 "test_failed_first[module]"
3836 "test_failed_first[class]"
3837 "test_failed_first[parent]"
3838 "test_failed_first[grandparent]"
3839 "test_failed_first[none]"))
3840 #$@(map (lambda (test)
3841 (string-append "--deselect=tests/"
3842 "test_doctests.py::"
3843 test))
3844 (list "test_doctests[global]"
3845 "test_doctests[package]"
3846 "test_doctests[module]"
3847 "test_doctests[class]"
3848 "test_doctests[parent]"
3849 "test_doctests[grandparent]"
3850 "test_doctests[none]"))
3851 "--deselect=tests/test_xdist.py::test_xdist_not_broken")))
3852 (native-inputs
3853 (list python-pytest
3854 python-setuptools))
3855 (home-page "https://github.com/jbasko/pytest-random-order")
3856 (synopsis "Pytest plugin to randomize the order of tests")
3857 (description "@code{pytest-random-order} is a Pytest plugin that
3858randomizes the order of tests. This can be useful to detect a test that
3859passes just because it happens to run after an unrelated test that leaves the
3860system in a favourable state. The plugin allows user to control the level of
3861randomness they want to introduce and to disable reordering on subsets of
3862tests. Tests can be rerun in a specific order by passing a seed value
3863reported in a previous test run.")
3864 (license license:expat)))
3865
3866(define-public python-pytest-randomly
3867 (package
3868 (name "python-pytest-randomly")
3869 (version "4.0.1")
3870 (source
3871 (origin
3872 (method git-fetch)
3873 (uri (git-reference
3874 (url "https://github.com/pytest-dev/pytest-randomly")
3875 (commit version)))
3876 (file-name (git-file-name name version))
3877 (sha256
3878 (base32 "0zglnyl3wc2ri9dhkvd1z0ywksk2v1abpdlclc253c8xivv4c3ai"))))
3879 (build-system pyproject-build-system)
3880 (arguments
3881 (list
3882 ;; tests: 23 passed, 13 deselected
3883 #:test-flags
3884 #~(list "-p" "no:randomly"
3885 ;; Skip tests requiring python-factory-boy, python-faker,
3886 ;; python-numpy, and python-pytest-xdist to reduce closure size.
3887 "-k" (string-join
3888 (list "not test_entrypoint_injection"
3889 "test_factory_boy"
3890 "test_faker"
3891 "test_faker_fixture"
3892 "test_it_runs_before_stepwise"
3893 "test_model_bakery"
3894 "test_numpy"
3895 "test_numpy_doesnt_crash_with_large_seed"
3896 "test_xdist")
3897 " and not "))))
3898 (native-inputs
3899 (list python-pytest-bootstrap
3900 python-setuptools))
3901 (home-page "https://github.com/pytest-dev/pytest-randomly")
3902 (synopsis "Pytest plugin to randomly order tests")
3903 (description
3904 "This is a Pytest plugin to randomly order tests and control Python's
3905@code{random.seed}.")
3906 (license license:expat)))
3907
3908
3909(define-public python-pytest-recording
3910 (package
3911 (name "python-pytest-recording")
3912 (version "0.13.4")
3913 (source
3914 (origin
3915 (method url-fetch)
3916 (uri (pypi-uri "pytest_recording" version))
3917 (sha256
3918 (base32 "133nj8vha63gv226f0gvqn16gnazbn2rqh8amv2fx4jrm2r693an"))))
3919 (build-system pyproject-build-system)
3920 (arguments
3921 (list #:tests? #f)) ;XXX: more than 50% tets failed
3922 (native-inputs
3923 (list python-pytest-bootstrap
3924 python-hatchling))
3925 (propagated-inputs
3926 (list python-vcrpy))
3927 (home-page "https://github.com/kiwicom/pytest-recording")
3928 (synopsis "Pytest support for recording and replaying HTTP traffic")
3929 (description
3930 "This package provides a Pytest plugin powered by
3931@url{https://vcrpy.readthedocs.io/en/latest/, VCR.py} to record and replay
3932HTTP traffic.")
3933 (license license:expat)))
3934
3935(define-public python-pytest-regressions
3936 (package
3937 (name "python-pytest-regressions")
3938 (version "2.8.3")
3939 (source
3940 (origin
3941 (method url-fetch)
3942 (uri (pypi-uri "pytest_regressions" version))
3943 (sha256
3944 (base32 "08fjzhsp4akdzn08d0nx2b9k16iad7wvdw4fqwv3sap0pq40gn8s"))))
3945 (build-system pyproject-build-system)
3946 (arguments
3947 (list
3948 #:test-flags
3949 ;; To reduce closure size it prevents including python-numpy,
3950 ;; python-pandas and python-matplotlib.
3951 #~(list "--ignore=tests/test_dataframe_regression.py"
3952 "--ignore=tests/test_ndarrays_regression.py"
3953 "--ignore=tests/test_num_regression.py"
3954 "--deselect=tests/test_filenames.py::test_foo"
3955 "--deselect=tests/test_filenames.py::TestClass::test_foo"
3956 "--deselect=tests/test_filenames.py::TestClassWithIgnoredName::test_foo"
3957 "--deselect=tests/test_image_regression.py::test_image_regression"
3958 "--deselect=tests/test_image_regression.py::test_image_regression_workflow")))
3959 (native-inputs
3960 (list python-pytest-bootstrap
3961 python-setuptools
3962 python-setuptools-scm))
3963 (propagated-inputs
3964 (list python-pytest-datadir
3965 python-pyyaml))
3966 (home-page "https://github.com/ESSS/pytest-regressions")
3967 (synopsis "Easy to use fixtures to write regression tests")
3968 (description
3969 "This plugin makes it simple to test general data, images, files, and
3970numeric tables by saving expected data in a data directory (courtesy of
3971pytest-datadir) that can be used to verify that future runs produce the same
3972data.")
3973 (license license:expat)))
3974
3975(define-public python-pytest-remotedata
3976 (package
3977 (name "python-pytest-remotedata")
3978 (version "0.4.1")
3979 (source
3980 (origin
3981 (method url-fetch)
3982 (uri (pypi-uri "pytest-remotedata" version))
3983 (sha256
3984 (base32 "0ndvnj9zghfj17haphrygiri9iy38wb8lwq1xdkfvlfd73v8ph05"))))
3985 (build-system pyproject-build-system)
3986 (arguments
3987 (list
3988 #:test-flags
3989 #~(list "--numprocesses" (number->string (parallel-job-count))
3990 "-k" (string-join
3991 ;; Network access is required.
3992 (list "not test_internet_access"
3993 ;; Failed with assertion error.
3994 "test_default_behavior"
3995 "test_strict_with_decorator")
3996 " and not "))))
3997 (native-inputs
3998 (list python-pytest
3999 python-pytest-xdist
4000 python-setuptools
4001 python-setuptools-scm
4002 python-wheel))
4003 (propagated-inputs
4004 (list python-packaging))
4005 (home-page "https://github.com/astropy/pytest-remotedata")
4006 (synopsis "Pytest plugin for controlling remote data access")
4007 (description
4008 "This package provides a plugin for the Pytest framework that allows
4009developers to control unit tests that require access to data from the
4010internet.")
4011 (license license:bsd-3)))
4012
4013(define-public python-pytest-repeat
4014 (package
4015 (name "python-pytest-repeat")
4016 (version "0.9.4")
4017 (source
4018 (origin
4019 (method url-fetch)
4020 (uri (pypi-uri "pytest_repeat" version))
4021 (sha256
4022 (base32 "11a449zn7lhjyjjw40sv2c63i0mwr7q1cpbyj7kczzx6z96w2anr"))))
4023 (build-system pyproject-build-system)
4024 (native-inputs
4025 (list python-hatchling
4026 python-pytest-bootstrap))
4027 (home-page "https://github.com/pytest-dev/pytest-repeat")
4028 (synopsis "Pytest plugin for repeating tests")
4029 (description "@code{pytest-repeat} is a plugin for Pytest that makes it
4030enables repeating a single test, or multiple tests, a specific number of
4031times.")
4032 (license license:mpl2.0)))
4033
4034(define-public python-pytest-reportlog
4035 (package
4036 (name "python-pytest-reportlog")
4037 (version "1.0.0")
4038 (source
4039 (origin
4040 (method git-fetch)
4041 (uri (git-reference
4042 (url "https://github.com/pytest-dev/pytest-reportlog")
4043 (commit (string-append "v" version))))
4044 (file-name (git-file-name name version))
4045 (sha256
4046 (base32 "19h1kmwas42qmirdfaw0ffq3g7ibsdd46xfia71i6l8z1qswxwb1"))))
4047 (build-system pyproject-build-system)
4048 (propagated-inputs (list python-pytest))
4049 (native-inputs (list python-hatch-vcs python-hatchling))
4050 (home-page "https://github.com/pytest-dev/pytest-reportlog")
4051 (synopsis "Replacement for the --resultlog pytest option")
4052 (description
4053 "This package provides a replacement for the @code{--resultlog} option,
4054focused in simplicity and extensibility.")
4055 (license license:expat)))
4056
4057(define-public python-pytest-rerunfailures
4058 (package
4059 (name "python-pytest-rerunfailures")
4060 (version "15.1")
4061 (source
4062 (origin
4063 (method url-fetch)
4064 (uri (pypi-uri "pytest_rerunfailures" version))
4065 (sha256
4066 (base32 "106fiqn3d86xcl2cwmc76svi2mkfgphqna37bf617f6pmdl06166"))))
4067 (build-system pyproject-build-system)
4068 (native-inputs
4069 (list python-pytest-bootstrap
4070 python-setuptools))
4071 (propagated-inputs
4072 (list python-packaging))
4073 (home-page "https://github.com/pytest-dev/pytest-rerunfailures")
4074 (synopsis "Pytest plugin to re-run flaky tests")
4075 (description "This package provides a pytest plugin to re-run tests to
4076eliminate flaky failures.")
4077 (license license:mpl2.0)))
4078
4079(define-public python-pytest-retry
4080 (package
4081 (name "python-pytest-retry")
4082 (version "1.7.0")
4083 (source
4084 (origin
4085 (method url-fetch)
4086 (uri (pypi-uri "pytest_retry" version))
4087 (sha256
4088 (base32 "03zqgl2y16pcf0w0sn7z9n1gaqmkspl9xfhigks9v50yy0wj7mgq"))))
4089 (build-system pyproject-build-system)
4090 (native-inputs
4091 (list python-pytest-bootstrap
4092 python-setuptools))
4093 (home-page "https://github.com/str0zzapreti/pytest-retry")
4094 (synopsis "Pytest plugin to retry flaky tests in CI environments")
4095 (description
4096 "This package provides a plugin for Pytest which adds the ability to retry
4097flaky tests, thereby improving the consistency of the test suite results.")
4098 (license license:expat)))
4099
4100(define-public python-pytest-run-parallel
4101 (package
4102 (name "python-pytest-run-parallel")
4103 (version "0.8.0")
4104 (source
4105 (origin
4106 (method url-fetch)
4107 (uri (pypi-uri "pytest_run_parallel" version))
4108 (sha256
4109 (base32 "1qiz0kpjzqad9s5kr1rx4zxncy4zfghzb85cl7hjzca0j34agbji"))))
4110 (build-system pyproject-build-system)
4111 (native-inputs
4112 (list python-pytest-bootstrap
4113 python-pytest-order
4114 python-pytest-xdist
4115 python-setuptools))
4116 (home-page "https://github.com/Quansight-Labs/pytest-run-parallel")
4117 (synopsis "Pytest plugin to run tests concurrently")
4118 (description
4119 "This package provides a simple pytest plugin to run tests concurrently.
4120 The main goal of pytest-run-parallel is to discover thread-safety issues that
4121could exist when using C libraries, this is of vital importance after
4122@url{https://peps.python.org/pep-0703/, PEP703}, which provides a path for a
4123CPython implementation without depending on the Global Interpreter Lock (GIL),
4124thus allowing for proper parallelism in programs that make use of the CPython
4125interpreter.")
4126 (license license:expat)))
4127
4128;; This is only used by python-sanic
4129(define-public python-pytest-sanic
4130 (package
4131 (name "python-pytest-sanic")
4132 (version "1.9.1")
4133 (source (origin
4134 (method url-fetch)
4135 (uri (pypi-uri "pytest-sanic" version))
4136 (sha256
4137 (base32
4138 "0shq1bqnydj0l3ipb73j1qh5kqcjvzkps30zk8grq3dwmh3wmnkr"))))
4139 (build-system pyproject-build-system)
4140 (arguments
4141 ;; Tests depend on python-sanic.
4142 (list
4143 #:tests? #f
4144 #:phases
4145 #~(modify-phases %standard-phases
4146 (add-after 'unpack 'use-poetry-core
4147 (lambda _
4148 ;; Patch to use the core poetry API.
4149 (substitute* "pyproject.toml"
4150 (("poetry.masonry.api") "poetry.core.masonry.api")))))))
4151 (native-inputs
4152 (list python-poetry-core))
4153 (propagated-inputs
4154 (list python-httpx python-async-generator python-pytest
4155 python-websockets))
4156 (home-page "https://github.com/yunstanford/pytest-sanic")
4157 (synopsis "Pytest plugin for Sanic")
4158 (description "This package provides a pytest plugin for Sanic. It helps
4159you to test your code asynchronously.")
4160 (license license:expat)))
4161
4162(define-public python-pytest-services
4163 (package
4164 (name "python-pytest-services")
4165 (version "1.3.1")
4166 (source
4167 (origin
4168 (method git-fetch)
4169 (uri (git-reference
4170 (url "https://github.com/pytest-dev/pytest-services")
4171 (commit version)))
4172 (file-name (git-file-name name version))
4173 (sha256
4174 (base32 "123s2vd3h5knfs6lz7b83z0wl2miqsbya3w71cm8xk6hgyb10nmv"))))
4175 (build-system pyproject-build-system)
4176 (arguments
4177 ;; XXX: Tests require running memcached, mysql and X servers.
4178 (list #:tests? #f))
4179 (propagated-inputs (list python-psutil python-requests))
4180 (native-inputs (list python-pytest python-setuptools python-wheel))
4181 (home-page "https://github.com/pytest-dev/pytest-services")
4182 (synopsis "Services plugin for pytest testing framework")
4183 (description
4184 "This plugin provides a set of fixtures and utility functions to start
4185service processes for your tests with pytest.")
4186 (license license:expat)))
4187
4188(define-public python-pytest-shard
4189 (let ((commit "64610a08dac6b0511b6d51cf895d0e1040d162ad")
4190 (revision "0"))
4191 (package
4192 (name "python-pytest-shard")
4193 (version (git-version "0.1.2" revision commit))
4194 (source
4195 (origin
4196 (method git-fetch)
4197 (uri (git-reference
4198 (url "https://github.com/AdamGleave/pytest-shard")
4199 (commit commit)))
4200 (file-name (git-file-name name version))
4201 (sha256
4202 (base32 "1h31m68igz670bzl307hazjrfbr8pk14mxflllar18ydmlrnl677"))))
4203 (build-system pyproject-build-system)
4204 (native-inputs (list python-setuptools python-wheel))
4205 (propagated-inputs (list python-pytest))
4206 (home-page "https://github.com/AdamGleave/pytest-shard")
4207 (synopsis "Pytest plugin for sharding tests")
4208 (description "This package provides a Pytest extension for sharding
4209tests at the granularity of individual test cases, which can be run in
4210parallel and on multiple machines.")
4211 (license license:expat))))
4212
4213(define-public python-pytest-shutil
4214 (package
4215 (name "python-pytest-shutil")
4216 (version "1.8.0")
4217 (source
4218 (origin
4219 (method url-fetch)
4220 (uri (pypi-uri "pytest-shutil" version))
4221 (sha256
4222 (base32
4223 "18283zgs3z61paymzf0pp5x3di3hg3m91pvb3v7bmz3fggphdl5a"))))
4224 (build-system pyproject-build-system)
4225 (arguments
4226 (list
4227 #:phases
4228 #~(modify-phases %standard-phases
4229 (add-after 'unpack 'patch-tests
4230 (lambda _
4231 (mkdir "/tmp/bin")
4232 (substitute* "tests/integration/test_cmdline_integration.py"
4233 (("dirname = '/bin'")
4234 "dirname = '/tmp/bin'")
4235 (("bindir = os.path.realpath\\('/bin'\\)")
4236 "bindir = os.path.realpath('/tmp/bin')")))))))
4237 (native-inputs
4238 (list python-pytest
4239 python-setuptools
4240 python-setuptools-git
4241 python-wheel))
4242 (propagated-inputs
4243 (list python-execnet
4244 python-mock
4245 python-path
4246 python-six
4247 python-termcolor))
4248 (home-page "https://github.com/manahl/pytest-plugins")
4249 (synopsis "Assorted shell and environment tools for py.test")
4250 (description
4251 "This package provides assorted shell and environment tools for the
4252py.test testing framework.")
4253 (license license:expat)))
4254
4255(define-public python-pytest-snapshot
4256 (package
4257 (name "python-pytest-snapshot")
4258 (version "0.9.0")
4259 (source
4260 (origin
4261 (method url-fetch)
4262 (uri (pypi-uri "pytest-snapshot" version))
4263 (sha256
4264 (base32 "1wxp9pv5yqpj3fk450ld1mjhhdxyvssgi6gqxyghz1iyphx3q0f7"))))
4265 (build-system pyproject-build-system)
4266 (arguments
4267 (list
4268 ;; Skip failing test. Related upstream issue:
4269 ;; <https://github.com/joseph-roitman/pytest-snapshot/issues/71>.
4270 #:test-flags #~(list "-k" "not test_assert_match_failure_bytes")))
4271 (native-inputs
4272 (list python-setuptools
4273 python-setuptools-scm
4274 python-wheel))
4275 (propagated-inputs
4276 (list python-pytest))
4277 (home-page "https://github.com/joseph-roitman/pytest-snapshot")
4278 (synopsis "Pytest plugin for snapshot testing")
4279 (description
4280 "This package provides a plugin for snapshot testing with pytest. It can
4281be used to test that the value of an expression does not change
4282unexpectedly.")
4283 (license license:expat)))
4284
4285(define-public python-pytest-socket
4286 (package
4287 (name "python-pytest-socket")
4288 (version "0.7.0")
4289 (source
4290 (origin
4291 ;; There are no tests in the PyPI tarball.
4292 (method git-fetch)
4293 (uri (git-reference
4294 (url "https://github.com/miketheman/pytest-socket")
4295 (commit version)))
4296 (file-name (git-file-name name version))
4297 (sha256
4298 (base32 "1m6s07gvljq82hiajzy1v123kpkciziiqdjqfnas169rmzg0bmnp"))))
4299 (build-system pyproject-build-system)
4300 (arguments
4301 (list
4302 #:test-flags
4303 #~(list "-k" (string-append
4304 ;; Disable test requiring network access.
4305 "not test_disable_socket_urllib"
4306 " and not test_parametrize_with_socket_enabled_and_allow_hosts"
4307 " and not test_global_disable_and_allow_host"
4308 " and not test_asynctest"
4309 " and not test_httpx_fails"
4310 " and not test_disabled_urllib_fails"
4311 " and not test_urllib_succeeds_by_default"
4312 " and not test_enabled_urllib_succeeds"
4313 " and not test_single_cli_arg_connect_disabled_hostname_resolved"))
4314 #:phases
4315 #~(modify-phases %standard-phases
4316 ;; See <https://github.com/miketheman/pytest-socket/issues/308>
4317 (add-after 'unpack 'fix-tests
4318 (lambda _
4319 (substitute* (list "tests/test_async.py"
4320 "tests/test_socket.py"
4321 "tests/test_precedence.py")
4322 (("from tests.common import assert_socket_blocked")
4323 "from common import assert_socket_blocked")))))))
4324 (native-inputs (list python-httpx
4325 python-poetry-core
4326 python-pypa-build
4327 python-pytest
4328 python-pytest-httpbin
4329 python-pytest-randomly
4330 python-starlette))
4331 (home-page "https://pypi.org/project/pytest-socket/")
4332 (synopsis "Pytest plugin to disable socket calls during tests")
4333 (description
4334 "This package provides Pytest extension which disables all network calls flowing
4335through Python's socket interface")
4336 (license license:expat)))
4337
4338(define-public python-pytest-split
4339 (package
4340 (name "python-pytest-split")
4341 (version "0.10.0")
4342 (source
4343 (origin
4344 (method git-fetch)
4345 (uri (git-reference
4346 (url "https://github.com/jerry-git/pytest-split")
4347 (commit version)))
4348 (file-name (git-file-name name version))
4349 (sha256
4350 (base32 "1w42zkw22h0ydfhbjdjp93frbrzi1rlkr17ifb9kavcbv7kfqxfl"))))
4351 (build-system pyproject-build-system)
4352 (arguments
4353 (list
4354 #:test-flags
4355 ;; XXX: Unclear why this test fails.
4356 #~(list "--deselect=tests/test_plugin.py::TestRaisesUsageErrors::\
4357test_returns_nonzero_when_invalid_algorithm_name")))
4358 (native-inputs
4359 (list python-packaging
4360 python-poetry-core
4361 python-pytest-8))
4362 (home-page "https://jerry-git.github.io/pytest-split/")
4363 (synopsis "Pytest plugin to split the test suite to equally sized sub sutes")
4364 (description
4365 "This package provides Pytest plugin which splits the test suite to equally
4366sized sub suites based on
4367test execution time.")
4368 (license license:expat)))
4369
4370(define-public python-pytest-steps
4371 (package
4372 (name "python-pytest-steps")
4373 (version "1.8.0")
4374 (source
4375 (origin
4376 (method url-fetch)
4377 (uri (pypi-uri "pytest-steps" version))
4378 (sha256
4379 (base32 "05r2ch7191saj7sw6d47bfa5vnyyj157dl8hvlcc78xx6jyxy46j"))))
4380 (build-system pyproject-build-system)
4381 (arguments
4382 (list #:tests? #f)) ;XXX: cycles with python-pytest-harvest
4383 (native-inputs
4384 (list python-pytest-bootstrap
4385 python-setuptools
4386 python-setuptools-scm))
4387 (propagated-inputs
4388 (list python-makefun
4389 python-wrapt))
4390 (home-page "https://github.com/smarie/python-pytest-steps")
4391 (synopsis "Pytest plugin to create step-wise / incremental tests")
4392 (description
4393 "This package implements a functionality to share a state / intermediate
4394 results across test steps.")
4395 (license license:bsd-3)))
4396
4397(define-public python-pytest-subprocess
4398 (package
4399 (name "python-pytest-subprocess")
4400 (version "1.5.3")
4401 (source
4402 (origin
4403 (method git-fetch) ;no tests in PyPI archive
4404 (uri (git-reference
4405 (url "https://github.com/aklajnert/pytest-subprocess")
4406 (commit version)))
4407 (file-name (git-file-name name version))
4408 (sha256
4409 (base32
4410 "1yb5y6dqzf6k5a07yzdpw8w50bm7zbsdvv06ii7c7vyg9wx5iw6y"))))
4411 (build-system pyproject-build-system)
4412 (arguments
4413 (list
4414 ;; 134 passed, 4 skipped, 4 deselected
4415 #:test-flags
4416 ;; XXX: Skip tests fixed on master in
4417 ;; be30d9a94ba45afb600717e3fcd95b8b2ff2c60e commit, not critical,
4418 ;; re-chech in the next refresh cycle.
4419 #~(list "--deselect=tests/test_examples.py::test_documentation[README.rst]"
4420 "--deselect=tests/test_examples.py::test_documentation[docs/index.rst]"
4421 "--deselect=tests/test_subprocess.py::test_text[False]"
4422 "--deselect=tests/test_subprocess.py::test_universal_newlines[False]")))
4423 (native-inputs
4424 (list python-anyio
4425 python-docutils
4426 python-pygments
4427 python-pytest
4428 python-pytest-asyncio
4429 python-pytest-rerunfailures
4430 python-setuptools))
4431 (home-page "https://github.com/aklajnert/pytest-subprocess")
4432 (synopsis "Fake subprocess for Pytest")
4433 (description
4434 "This package provides a plugin to fake subprocess for Pytest.")
4435 (license license:expat)))
4436
4437;; XXX: This project was archived by the owner on Nov 11, 2025. It is now
4438;; read-only.
4439(define-public python-pytest-subtests
4440 (package
4441 (name "python-pytest-subtests")
4442 (version "0.15.0")
4443 (source
4444 (origin
4445 (method url-fetch)
4446 (uri (pypi-uri "pytest_subtests" version))
4447 (sha256
4448 (base32 "0z487yinp3gxh2dk6z52d4a17d7d4ymdz2hbix5ph6sm0pg5njfb"))))
4449 (build-system pyproject-build-system)
4450 (native-inputs
4451 (list python-pytest-8
4452 python-setuptools
4453 python-setuptools-scm))
4454 (propagated-inputs
4455 (list python-attrs))
4456 (home-page "https://github.com/pytest-dev/pytest-subtests")
4457 (synopsis "Unittest subTest() support and subtests fixture")
4458 (description "This Pytest plugin provides unittest @code{subTest()}
4459support and @code{subtests} fixture.")
4460 (license license:expat)))
4461
4462(define-public python-pytest-testmon
4463 (package
4464 (name "python-pytest-testmon")
4465 (version "2.2.0")
4466 (source
4467 (origin
4468 (method git-fetch)
4469 (uri (git-reference
4470 (url "https://github.com/tarpas/pytest-testmon")
4471 (commit (string-append "v" version))))
4472 (file-name (git-file-name name version))
4473 (sha256
4474 (base32 "0f3rz17w6pb3gi8c1bc4sjfmdxpdqzhm371fsh36svdc9fn3nm05"))))
4475 (build-system pyproject-build-system)
4476 (arguments (list #:tests? #false)) ;there are none
4477 (native-inputs
4478 (list python-coverage
4479 python-pytest
4480 python-setuptools
4481 python-wheel))
4482 (home-page "https://github.com/tarpas/pytest-testmon")
4483 (synopsis "Selects tests affected by changed files and methods")
4484 (description
4485 "This plug-in auto-selects and reruns tests impacted by recent changes.")
4486 (license license:expat)))
4487
4488(define-public python-pytest-textual-snapshot
4489 (package
4490 (name "python-pytest-textual-snapshot")
4491 (version "1.1.0")
4492 (source
4493 (origin
4494 (method git-fetch)
4495 (uri (git-reference
4496 (url "https://github.com/Textualize/pytest-textual-snapshot")
4497 (commit (string-append "v" version))))
4498 (file-name (git-file-name name version))
4499 (sha256
4500 (base32 "16zwybmjw16pxcm9qdql14xh3fj4iwry8r219yzjd5z7w1l31p12"))))
4501 (build-system pyproject-build-system)
4502 (arguments
4503 (list
4504 #:tests? #f ; no tests in PyPI or Git
4505 #:phases
4506 #~(modify-phases %standard-phases
4507 (add-after 'unpack 'relax-requirements
4508 (lambda _
4509 (substitute* "pyproject.toml"
4510 (("syrupy = .*")
4511 "syrupy = \"*\"\n"))))
4512 (add-after 'unpack 'patch-path
4513 (lambda _
4514 ;; Taken from NixOS package definition.
4515 (substitute* "pytest_textual_snapshot.py"
4516 (("this_file_path.parent")
4517 (string-append "Path('" #$output
4518 "/share/pytest-textual-snapshot/')")))))
4519 (add-after 'install 'post-install
4520 (lambda _
4521 (install-file "./resources/snapshot_report_template.jinja2"
4522 (string-append #$output
4523 "/share/pytest-textual-snapshot/resources/")))))))
4524 (native-inputs
4525 (list python-pytest
4526 python-poetry-core))
4527 (propagated-inputs
4528 (list python-jinja2
4529 python-rich
4530 python-syrupy
4531 python-textual))
4532 (home-page "https://github.com/Textualize/pytest-textual-snapshot")
4533 (synopsis "Pytest plugin for snapshot testing Textual applications")
4534 (description
4535 "This package implements a functionality to save an SVG screenshot of a
4536running Textual app to disk. The next time the test runs, it takes another
4537screenshot and compares it to the saved one. If the new screenshot differs
4538from the old one, the test fails. This is a convenient way to quickly and
4539automatically detect visual regressions in your applications.")
4540 (license license:expat)))
4541
4542(define-public python-pytest-tornado
4543 (package
4544 (name "python-pytest-tornado")
4545 (version "0.8.1")
4546 (source
4547 (origin
4548 (method git-fetch) ;no tests in pypi archive
4549 (uri (git-reference
4550 (url "https://github.com/eugeniy/pytest-tornado")
4551 (commit (string-append "v" version))))
4552 (file-name (git-file-name name version))
4553 (sha256
4554 (base32 "05hgq1m9g35kpc01im7ci1wd85xi1rdxnyms9izjg65c9976zn6x"))))
4555 (build-system pyproject-build-system)
4556 (native-inputs
4557 (list python-wheel))
4558 (propagated-inputs
4559 (list python-pytest
4560 python-setuptools
4561 python-tornado))
4562 (home-page "https://github.com/eugeniy/pytest-tornado")
4563 (synopsis "Pytest plugin to ease testing tornado applications")
4564 (description
4565 "This package provides a py.test plugin providing fixtures and markers to
4566simplify testing of asynchronous tornado applications.")
4567 (license license:asl2.0)))
4568
4569(define-public python-pytest-tornasync
4570 (package
4571 (name "python-pytest-tornasync")
4572 (version "0.6.0.post2")
4573 (source
4574 (origin
4575 (method git-fetch)
4576 (uri (git-reference
4577 (url "https://github.com/eukaryote/pytest-tornasync")
4578 (commit version)))
4579 (file-name (git-file-name name version))
4580 (sha256
4581 (base32 "0iwaxvaxx9v0s1sx4kh90kpf1krzwqh73sg6lv3f2gvh0wjym85f"))))
4582 (build-system pyproject-build-system)
4583 (native-inputs
4584 (list python-pytest-bootstrap
4585 python-setuptools))
4586 (propagated-inputs
4587 (list python-tornado))
4588 (home-page "https://github.com/eukaryote/pytest-tornasync")
4589 (synopsis "Pytest plugin for testing Tornado code")
4590 (description
4591 "This package provides a simple pytest plugin that provides some helpful
4592fixtures for testing Tornado (version 5.0 or newer) apps and easy handling of
4593plain (undecoratored) native coroutine tests.")
4594 (license license:expat)))
4595
4596(define-public python-pytest-trio
4597 (package
4598 (name "python-pytest-trio")
4599 (version "0.8.0")
4600 (source
4601 (origin
4602 (method url-fetch)
4603 (uri (pypi-uri "pytest-trio" version))
4604 (sha256
4605 (base32 "0bmmdyjqj5v4a637i4rzm55crv6v3nj268as6x9nr7m76rixnqw3"))))
4606 (build-system pyproject-build-system)
4607 (arguments
4608 (list
4609 ;; Tests are broken, see
4610 ;; <https://github.com/python-trio/pytest-trio/issues/84>.
4611 #:tests? #f))
4612 (native-inputs
4613 (list python-hypothesis
4614 python-pytest
4615 python-setuptools
4616 python-wheel))
4617 (propagated-inputs
4618 (list python-async-generator
4619 python-outcome
4620 python-pytest
4621 python-trio))
4622 (home-page "https://github.com/python-trio/pytest-trio")
4623 (synopsis "Pytest plugin for trio")
4624 (description
4625 "This is a pytest plugin to help you test projects that use Trio, a
4626friendly library for concurrency and async I/O in Python.")
4627 ;; Either license applies.
4628 (license (list license:expat license:asl2.0))))
4629
4630(define-public python-pytest-twisted
4631 (package
4632 (name "python-pytest-twisted")
4633 (version "1.14.3")
4634 (source
4635 (origin
4636 (method url-fetch)
4637 (uri (pypi-uri "pytest_twisted" version))
4638 (sha256
4639 (base32 "0gkz7ybdj45v4mmfyyryx6lz75hizi23zi9n5mcsdnqfpk5m1q9p"))))
4640 (build-system pyproject-build-system)
4641 (arguments
4642 (list
4643 #:test-flags
4644 #~(list "-k" (string-append
4645 ;; AssertionError
4646 "not test_sigint_for_regular_tests"
4647 ;; TimeoutExpired
4648 " and not test_sigint_for_inline_callbacks_tests"))))
4649 (propagated-inputs (list python-decorator python-greenlet))
4650 (native-inputs (list python-pytest
4651 python-setuptools
4652 python-twisted
4653 python-wheel))
4654 (home-page "https://github.com/pytest-dev/pytest-twisted")
4655 (synopsis "Twisted plugin for Pytest")
4656 (description "This package provides a Twisted plugin for Pytest.")
4657 (license license:bsd-3)))
4658
4659(define-public python-pytest-vcr
4660 ;; This commit fixes integration with pytest-5
4661 (let ((commit "4d6c7b3e379a6a7cba0b8f9d20b704dc976e9f05")
4662 (revision "1"))
4663 (package
4664 (name "python-pytest-vcr")
4665 (version (git-version "1.0.2" revision commit))
4666 (source
4667 (origin
4668 (method git-fetch)
4669 (uri (git-reference
4670 (url "https://github.com/ktosiek/pytest-vcr")
4671 (commit commit)))
4672 (file-name (git-file-name name version))
4673 (sha256
4674 (base32 "1yk988zi0la6zpcm3fff0mxf942di2jiymrfqas19nyngj5ygaqs"))))
4675 (build-system pyproject-build-system)
4676 (native-inputs (list python-urllib3 python-setuptools python-wheel))
4677 (propagated-inputs (list python-pytest python-vcrpy))
4678 (home-page "https://github.com/ktosiek/pytest-vcr")
4679 (synopsis "Plugin for managing VCR.py cassettes")
4680 (description
4681 "This package is a pytest plugin for managing VCR.py cassettes.")
4682 (license license:expat))))
4683
4684(define-public python-pytest-virtualenv
4685 (package
4686 (name "python-pytest-virtualenv")
4687 (version "1.8.0")
4688 (source
4689 (origin
4690 (method url-fetch)
4691 (uri (pypi-uri "pytest-virtualenv" version))
4692 (sha256
4693 (base32
4694 "1ig1jwgs89r9vxdr12fgxvv9r05bnf5d18lxyn13xciivwwi16al"))))
4695 (build-system pyproject-build-system)
4696 (arguments
4697 (list
4698 #:test-flags #~(list "--ignore=tests/integration/")
4699 #:phases
4700 #~(modify-phases %standard-phases
4701 ;; Reference the virtualenv executable directly, to avoid the need
4702 ;; for PYTHONPATH, which gets cleared when instantiating a new
4703 ;; virtualenv with pytest-virtualenv.
4704 (add-after 'unpack 'patch-virtualenv-executable
4705 (lambda* (#:key inputs #:allow-other-keys)
4706 (let* ((virtualenv #$(this-package-input "python-virtualenv"))
4707 (virtualenv-bin (string-append virtualenv
4708 "/bin/virtualenv")))
4709 (substitute* "pytest_virtualenv.py"
4710 (("^DEFAULT_VIRTUALENV_FIXTURE_EXECUTABLE.*$")
4711 (format #f "DEFAULT_VIRTUALENV_FIXTURE_EXECUTABLE = '~a'"
4712 virtualenv-bin)))))))))
4713 (native-inputs
4714 (list python-pytest
4715 python-setuptools
4716 python-setuptools-git
4717 python-wheel))
4718 (propagated-inputs
4719 (list python-importlib-metadata
4720 python-pytest-shutil
4721 python-pytest-fixture-config
4722 python-virtualenv))
4723 (home-page "https://github.com/man-group/pytest-plugins")
4724 (synopsis "Virtualenv fixture for py.test")
4725 (description "This package provides a virtualenv fixture for the py.test
4726framework.")
4727 (license license:expat)))
4728
4729(define-public python-pytest-xvfb
4730 (package
4731 (name "python-pytest-xvfb")
4732 (version "3.1.1")
4733 (source
4734 (origin
4735 (method git-fetch)
4736 (uri (git-reference
4737 (url "https://github.com/The-Compiler/pytest-xvfb")
4738 (commit (string-append "v" version))))
4739 (file-name (git-file-name name version))
4740 (sha256
4741 (base32 "0p27h1idqja2lz2xnk4fsb9c8kafvgy1zpa84lg9d1hlamr221ja"))))
4742 (build-system pyproject-build-system)
4743 (arguments
4744 (list
4745 #:phases
4746 #~(modify-phases %standard-phases
4747 (add-before 'build 'prepare-tests
4748 (lambda _
4749 (system "Xvfb &")
4750 (setenv "DISPLAY" ":0")
4751 ;; This test is meant to run on Windows.
4752 (delete-file "tests/test_xvfb_windows.py"))))))
4753 (native-inputs
4754 (list python-pytest
4755 python-setuptools
4756 xorg-server-for-tests))
4757 (propagated-inputs
4758 (list python-pyvirtualdisplay))
4759 (home-page "https://github.com/The-Compiler/pytest-xvfb")
4760 (synopsis "Pytest plugin to run Xvfb for tests")
4761 (description
4762 "This package provides a Pytest plugin to run Xvfb for tests.")
4763 (license license:expat)))
4764
4765(define-public python-re-assert
4766 (package
4767 (name "python-re-assert")
4768 (version "1.1.0")
4769 (source
4770 (origin
4771 ;; There are no tests in the PyPI tarball.
4772 (method git-fetch)
4773 (uri (git-reference
4774 (url "https://github.com/asottile/re-assert")
4775 (commit (string-append "v" version))))
4776 (file-name (git-file-name name version))
4777 (sha256
4778 (base32 "1rssq4wpqmx1c17hjfx5l3sn3zmnlz9jffddiqrs4f6h7m6cadai"))))
4779 (build-system pyproject-build-system)
4780 (native-inputs
4781 (list python-pytest python-setuptools))
4782 (propagated-inputs
4783 (list python-regex))
4784 (home-page "https://github.com/asottile/re-assert")
4785 (synopsis "Show where your regex match assertion failed")
4786 (description
4787 "@code{re-assert} provides a helper class to make assertions of regexes
4788simpler.")
4789 (license license:expat)))
4790
4791(define-public python-respx
4792 (package
4793 (name "python-respx")
4794 (version "0.22.0")
4795 (source
4796 (origin
4797 ;; There are no tests in the PyPI tarball.
4798 (method git-fetch)
4799 (uri (git-reference
4800 (url "https://github.com/lundberg/respx/")
4801 (commit version)))
4802 (file-name (git-file-name name version))
4803 (sha256
4804 (base32 "0pl6vlyva837bnz3cy9mwmvvh8fq943rkrbq3mzj34bjf8swnw2g"))))
4805 (build-system pyproject-build-system)
4806 (propagated-inputs (list python-httpx))
4807 (native-inputs (list nss-certs-for-test
4808 python-starlette
4809 python-flask
4810 python-pytest
4811 python-pytest-asyncio
4812 python-setuptools
4813 python-wheel))
4814 (home-page "https://lundberg.github.io/respx/")
4815 (synopsis "Mocking for Python libraries HTTPX and HTTPCore")
4816 (description
4817 "This package provides a utility for mocking out the Python libraries HTTPX and
4818HTTPCore.")
4819 (license license:bsd-3)))
4820
4821(define-public python-robber
4822 (package
4823 (name "python-robber")
4824 (version "1.1.5")
4825 (source
4826 (origin
4827 (method url-fetch)
4828 (uri (pypi-uri "robber" version))
4829 (sha256
4830 (base32 "0xp5csgv2g9q38hscml6bc5i1nm4xy5lzqqiimm2drxsf0hw2nq5"))))
4831 (build-system pyproject-build-system)
4832 ;; There are no tests in the tarball downloaded from PyPI.
4833 ;; The last version tagged in Github (0.1.0) is older than the one on PyPI.
4834 ;; Reported upstream: <https://github.com/vesln/robber.py/issues/20>.
4835 (arguments
4836 '(#:tests? #f))
4837 (native-inputs (list python-setuptools python-wheel))
4838 (propagated-inputs (list python-mock python-termcolor))
4839 ;; URL of the fork used to generate the package available on PyPI.
4840 (home-page "https://github.com/EastAgile/robber.py")
4841 (synopsis "Test-driven development (TDD) assertion library for Python")
4842 (description "Robber is a Python assertion library for test-driven and
4843behavior-driven development (TDD and BDD).")
4844 (license license:expat)))
4845
4846(define-public python-robotframework-jsonlibrary
4847 (package
4848 (name "python-robotframework-jsonlibrary")
4849 (version "0.5")
4850 (source
4851 (origin
4852 (method git-fetch) ; no tests data in PyPi package
4853 (uri (git-reference
4854 (url (string-append "https://github.com/robotframework-thailand/"
4855 "robotframework-jsonlibrary"))
4856 (commit version)))
4857 (file-name (git-file-name name version))
4858 (sha256
4859 (base32 "1zkhcmwlp9gy9a0262ylykr9pljq9mpkaa69340hhfkzygzi30dc"))))
4860 (build-system pyproject-build-system)
4861 (native-inputs
4862 (list python-pytest
4863 python-setuptools
4864 python-wheel))
4865 (propagated-inputs
4866 (list python-jsonpath-ng
4867 python-jsonschema
4868 python-robotframework))
4869 (home-page "https://github.com/robotframework-thailand/robotframework-jsonlibrary")
4870 (synopsis "Robot Framework test library for manipulating JSON Object")
4871 (description
4872 "@code{robotframework-jsonlibrary} is a Robot Framework test library for
4873manipulating JSON Object. You can manipulate your JSON object using JSONPath")
4874 ;; This is free and unencumbered software released into the public domain.
4875 (license license:unlicense)))
4876
4877(define-public python-scspell3k
4878 (let ((commit "df550351f255c572c1a74852d233c83bbfbd49fb")
4879 (revision "0"))
4880 (package
4881 (name "python-scspell3k")
4882 (version (git-version "2.3.0" revision commit))
4883 (source
4884 (origin
4885 (method git-fetch)
4886 (uri (git-reference
4887 (url "https://github.com/myint/scspell")
4888 (commit commit)))
4889 (sha256
4890 (base32 "0d7yhja9hrw4w7vm10h56hm1dqyhrnwia7wzc3ap9f15ldkkp9cs"))
4891 (file-name (git-file-name name version))))
4892 (build-system pyproject-build-system)
4893 (arguments
4894 (list
4895 #:phases
4896 #~(modify-phases %standard-phases
4897 (add-after 'unpack 'fix-project-license
4898 (lambda _
4899 (substitute* "pyproject.toml"
4900 (("\"GPL-2.0-only\"")
4901 "{ text = \"GPL-2.0-only\" }"))))
4902 (add-before 'check 'pre-check
4903 (lambda _
4904 (setenv "HOME" "/tmp")))
4905 (add-after 'check 'run-cram-tests
4906 (lambda _
4907 (invoke "cram" "--indent=4" "--verbose" "./test.cram"))))))
4908 (native-inputs
4909 (list python-cram
4910 python-pytest
4911 python-setuptools
4912 python-wheel))
4913 (home-page "https://github.com/myint/scspell")
4914 (synopsis "Conservative interactive spell checker for source code")
4915 (description
4916 "This package implements a spell checker for source code that does not
4917try to be particularly smart and instead does the simplest thing that can
4918possibly work.")
4919 (license license:gpl2))))
4920
4921(define-public python-slotscheck
4922 (package
4923 (name "python-slotscheck")
4924 (version "0.19.0")
4925 (source
4926 (origin
4927 (method git-fetch)
4928 (uri (git-reference
4929 (url "https://github.com/ariebovenberg/slotscheck")
4930 (commit (string-append "v" version))))
4931 (file-name (git-file-name name version))
4932 (sha256
4933 (base32 "1lakwgk20aq92sqdwsswnll2w3y6p42x8abb9q8fc2qvw3xhw2vh"))))
4934 (build-system pyproject-build-system)
4935 (arguments
4936 (list
4937 ;; Optional: ModuleNotFoundError: No module named 'mypyc'
4938 #:test-flags #~(list "-k" "not test_extension_package")))
4939 (native-inputs
4940 (list python-poetry-core
4941 python-pytest
4942 python-pytest-mock
4943 python-ujson))
4944 (propagated-inputs
4945 (list python-click
4946 python-tomli))
4947 (home-page "https://github.com/ariebovenberg/slotscheck")
4948 (synopsis "Ensure @code{__slots__} are working properly")
4949 (description
4950 "@code{slotscheck} is a tool to validate Python class @code{__slots__}.")
4951 (license license:expat)))
4952
4953(define-public python-stestr
4954 (package
4955 (name "python-stestr")
4956 (version "4.2.0")
4957 (source
4958 (origin
4959 (method url-fetch)
4960 (uri (pypi-uri "stestr" version))
4961 (sha256
4962 (base32 "17623fqkg3a0z7rx8jcxwvgx6afg6wzvj4q6cgip5hqw5ngn7v25"))))
4963 (build-system pyproject-build-system)
4964 (arguments
4965 (list
4966 #:test-flags
4967 #~(list "--test-path" "stestr/tests"
4968 "--exclude-regex" (string-join
4969 (list "test_pass"
4970 "test_pass_list"
4971 "test_unexpected_pass"
4972 "test_load_from_stdin_quiet"
4973 "test_trace_with_all_skips")
4974 "|"))
4975 #:phases
4976 #~(modify-phases %standard-phases
4977 (add-before 'check 'configure-check
4978 (lambda _
4979 (setenv "HOME" (getcwd)))))))
4980 (native-inputs
4981 (list python-ddt
4982 python-iso8601
4983 python-flit-core
4984 python-setuptools))
4985 (propagated-inputs
4986 (list python-cliff-bootstrap
4987 python-fixtures
4988 python-pyyaml
4989 python-subunit
4990 python-testtools
4991 python-tomlkit
4992 python-voluptuous))
4993 (home-page "https://stestr.readthedocs.io/en/latest/")
4994 (synopsis "Parallel Python test runner")
4995 (description
4996 "This package provides the @command{stestr} command, a parallel Python
4997test runner built around @code{subunit}. It is designed to execute
4998@code{unittest} test suites using multiple processes to split up execution of
4999a test suite. It will also store a history of all test runs to help in
5000debugging failures and optimizing the scheduler to improve speed.")
5001 (license license:asl2.0)))
5002
5003(define-public python-sure
5004 ;; No release for 2y but the master branch has fresh changes, use the latest
5005 ;; commit for now, see <https://github.com/gabrielfalcao/sure/issues/184>,
5006 ;; <https://github.com/gabrielfalcao/sure/issues/182>.
5007 (let ((commit "acf823a2e240a2efe93360316d3816e90366439a")
5008 (revision "0"))
5009 (package
5010 (name "python-sure")
5011 (version (git-version "2.0.1" revision commit))
5012 (source
5013 (origin
5014 (method git-fetch)
5015 (uri (git-reference
5016 (url "https://github.com/gabrielfalcao/sure")
5017 (commit commit)))
5018 (file-name (git-file-name name version))
5019 (sha256
5020 (base32 "12qd3as4ixhwvf8ppx1dwhghda2kcb85ygd4x3ci9mbvkh25fs01"))))
5021 (build-system pyproject-build-system)
5022 (native-inputs
5023 (list python-mock
5024 python-pytest
5025 python-setuptools
5026 python-wheel))
5027 (propagated-inputs
5028 (list python-couleur))
5029 (home-page "https://github.com/gabrielfalcao/sure")
5030 (synopsis "Automated testing library in python for python")
5031 (description
5032 "Sure is a python library that leverages a DSL for writing
5033assertions. Sure is heavily inspired by @code{RSpec Expectations} and
5034@code{should.js}.")
5035 (license license:gpl3+))))
5036
5037(define-public python-sybil
5038 (package
5039 (name "python-sybil")
5040 (version "9.0.0")
5041 (source
5042 (origin
5043 (method git-fetch)
5044 (uri (git-reference
5045 (url "https://github.com/simplistix/sybil")
5046 (commit version)))
5047 (sha256
5048 (base32 "0r491k91fi2nb0kdd6di8cb2kxcvsk1xzw3sgwsxhhg4qynsp3bi"))))
5049 (build-system pyproject-build-system)
5050 (native-inputs (list python-myst-parser
5051 python-pytest
5052 python-pyyaml
5053 python-seedir
5054 python-setuptools
5055 python-testfixtures))
5056 (home-page "https://github.com/simplistix/sybil")
5057 (synopsis "Automated testing for examples in code and documentation")
5058 (description
5059 "This library provides a way to check examples in your code and
5060documentation by parsing them from their source and evaluating the
5061parsed examples as part of your normal test run. Integration is
5062provided for the main Python test runners.")
5063 (license license:expat)))
5064
5065(define-public python-syrupy
5066 (package
5067 (name "python-syrupy")
5068 (version "5.0.0")
5069 (source
5070 (origin
5071 (method git-fetch)
5072 (uri (git-reference
5073 (url "https://github.com/syrupy-project/syrupy")
5074 (commit (string-append "v" version))))
5075 (file-name (git-file-name name version))
5076 (sha256
5077 (base32 "1ysm42an2pf4ppd1i5yzh11bq1rfydhg6rmmh5v91gcixpvi872d"))))
5078 (build-system pyproject-build-system)
5079 (arguments
5080 (list
5081 #:test-flags
5082 ;; XXX: This test is incompatible with running with xdist.
5083 #~(list "-k" "not test_update_failure_shows_snapshot_diff[xdist_two]")))
5084 (native-inputs
5085 (list python-poetry-core
5086 python-pytest-bootstrap
5087 python-pytest-xdist
5088 python-setuptools-scm))
5089 (home-page "https://github.com/syrupy-project/syrupy")
5090 (synopsis "Pytest Snapshot Test Utility")
5091 (description
5092 "This package implements a functionality to write tests which assert
5093immutability of computed results.")
5094 (license license:asl2.0)))
5095
5096(define-public python-tappy
5097 (package
5098 (name "python-tappy")
5099 (version "3.2.1")
5100 (source
5101 (origin
5102 (method url-fetch)
5103 (uri (pypi-uri "tap_py" version))
5104 (sha256
5105 (base32 "026n47b46z07yh5z5vpffcfq2xp6850g2s8w9ycssvx5y1m9wg6h"))))
5106 (build-system pyproject-build-system)
5107 (arguments (list #:test-backend #~'custom
5108 #:test-flags #~(list "tests/run.py")))
5109 (native-inputs (list python-hatchling))
5110 (home-page "https://github.com/python-tap/tappy")
5111 (synopsis "Tools for Test Anything Protocol")
5112 (description "Tappy is a set of tools for working with the Test Anything
5113Protocol (TAP) in Python. TAP is a line based test protocol for recording test
5114data in a standard way.")
5115 (license license:bsd-3)))
5116
5117(define-public python-test-utils
5118 (package
5119 (name "python-test-utils")
5120 (version "0.1.0")
5121 (source
5122 (origin
5123 (method url-fetch)
5124 (uri (pypi-uri "test-utils" version))
5125 (sha256
5126 (base32 "0cs0gyihnkj8ya4yg3ld3ly73mpxrkn2gq9acamclhqvhxsv7zd6"))))
5127 (build-system pyproject-build-system)
5128 (arguments
5129 (list #:tests? #f)) ; No tests, neither on pypi nor upstream.
5130 (native-inputs (list python-setuptools))
5131 (home-page "https://github.com/Kami/python-test-utils/")
5132 (synopsis "Utilities for functional and integration tests")
5133 (description
5134 "This package provides a collection of utility functions and classes
5135which make writing and running functional and integration tests easier.")
5136 (license license:asl2.0)))
5137
5138(define-public python-test2ref
5139 (package
5140 (name "python-test2ref")
5141 (version "1.1.1")
5142 (source
5143 (origin
5144 (method url-fetch)
5145 (uri (pypi-uri "test2ref" version))
5146 (sha256
5147 (base32 "1jx7cdqwpyq3gs9czvz0fwijkqhvmbny5h3zgdqlbrw8y3miv4gq"))))
5148 (build-system pyproject-build-system)
5149 (native-inputs
5150 (list python-pdm-backend python-pytest))
5151 (propagated-inputs
5152 (list python-binaryornot))
5153 (home-page "https://github.com/nbiotcloud/test2ref")
5154 (synopsis "Testing Against Learned Reference Data")
5155 (description
5156 "This package provides a unit tests framework backed by ML features and
5157working in two modes:
5158
5159@itemize
5160@item Testing: Test result in @code{tmp_path} is compared against a known
5161reference. Any deviation in the files, causes a fail.
5162@item Learning: The test result in @code{tmp_path} is taken as reference and
5163is copied to the reference folder, which should be committed to version
5164control and kept as reference.
5165@end itemize")
5166 (license license:expat)))
5167
5168(define-public python-testfixtures
5169 (package
5170 (name "python-testfixtures")
5171 (version "9.1.0")
5172 (source
5173 (origin
5174 (method url-fetch)
5175 (uri (pypi-uri "testfixtures" version))
5176 (sha256
5177 (base32 "10hlw2y1rjzmfm87dlisbiwf0zyjbnj0q471799j69wlagrrqzji"))))
5178 (build-system pyproject-build-system)
5179 (arguments
5180 `(#:tests? #f)) ; PyTest-Django fails to build in master
5181 (native-inputs
5182 (list python-setuptools))
5183 (home-page "https://testfixtures.readthedocs.io/en/latest/")
5184 (synopsis "Tests components for Python")
5185 (description
5186 "Testfixtures is a collection of helpers and mock objects that are useful
5187when writing automated tests in Python.")
5188 (license license:expat)))
5189
5190(define-public python-time-machine
5191 (package
5192 (name "python-time-machine")
5193 (version "2.16.0")
5194 (source
5195 (origin
5196 (method url-fetch)
5197 (uri (pypi-uri "time_machine" version))
5198 (sha256
5199 (base32 "1qn7cj9lx3m7pwa8ak1106f9c54yvpa996x84gfqmyfjfg1ar6aa"))))
5200 (build-system pyproject-build-system)
5201 (arguments
5202 `(#:tests? #f)) ;no tests in PyPI archive
5203 (propagated-inputs (list python-dateutil))
5204 (native-inputs (list python-setuptools python-wheel))
5205 (home-page "https://github.com/adamchainz/time-machine")
5206 (synopsis "Travel through time in your tests.")
5207 (description "This package lets you set a different time for your tests.")
5208 (license license:expat)))
5209
5210(define-public python-tox
5211 ;; NOTE: Try to avoid including it in inputs, it's for the local development
5212 ;; only.
5213 (package
5214 (name "python-tox")
5215 (version "4.27.0")
5216 (source
5217 (origin
5218 (method git-fetch)
5219 (uri (git-reference
5220 (url "https://github.com/tox-dev/tox")
5221 (commit version)))
5222 (file-name (git-file-name name version))
5223 (sha256
5224 (base32 "1z8bc37sbzzrssw426v5xr94ywk5l3i6dy4hfppv6y9mihmr8yk7"))))
5225 (build-system pyproject-build-system)
5226 (arguments
5227 (list
5228 ;; tests: 1867 passed, 11 skipped, 2 warnings
5229 #:test-flags
5230 #~(list "--numprocesses" (number->string (parallel-job-count))
5231 #$@(map (lambda (ls) (string-append "--deselect=tests/"
5232 (string-join ls "")))
5233 '(("plugin/test_plugin.py"
5234 "::test_plugin_hooks_and_order")
5235 ("session/cmd/test_devenv.py"
5236 "::test_devenv_fail_multiple_target")
5237 ("session/cmd/test_parallel.py"
5238 "::test_keyboard_interrupt")
5239 ("session/cmd/test_sequential.py"
5240 "::test_skip_pkg_install")
5241 ("session/cmd/test_show_config.py"
5242 "::test_show_config_cli_flag")
5243 ("session/cmd/test_show_config.py"
5244 "::test_show_config_pkg_env_once")
5245 ("session/cmd/test_show_config.py"
5246 "::test_show_config_pkg_env_skip")
5247 ("session/cmd/test_show_config.py"
5248 "::test_show_config_py_ver_impl_constants")
5249 ("test_call_modes.py"
5250 "::test_call_as_exe")
5251 ("tox_env/python/test_python_api.py"
5252 "::test_python_disable_hash_seed")
5253 ("tox_env/python/test_python_api.py"
5254 "::test_python_generate_hash_seed")
5255 ("tox_env/python/test_python_api.py"
5256 "::test_python_hash_seed_from_env_and_disable")
5257 ("tox_env/python/test_python_api.py"
5258 "::test_python_hash_seed_from_env_and_override")
5259 ("tox_env/python/test_python_api.py"
5260 "::test_python_keep_hash_seed")
5261 ("tox_env/python/test_python_api.py"
5262 "::test_python_set_hash_seed")
5263 ("tox_env/python/virtual_env/package/"
5264 "test_package_cmd_builder.py"
5265 "::test_build_wheel_external")
5266 ("tox_env/python/virtual_env/package/"
5267 "test_package_cmd_builder.py"
5268 "::test_run_installpkg_targz"))))))
5269 (propagated-inputs
5270 (list python-cachetools
5271 python-chardet
5272 python-colorama
5273 python-filelock
5274 python-packaging
5275 python-platformdirs
5276 python-pluggy
5277 python-pyproject-api
5278 python-virtualenv))
5279 (native-inputs
5280 (list python-devpi-process
5281 python-docutils
5282 python-flaky
5283 python-hatch-vcs
5284 python-hatchling
5285 python-psutil
5286 python-pytest
5287 python-pytest-mock
5288 python-pytest-xdist
5289 python-re-assert
5290 python-time-machine))
5291 (home-page "https://tox.readthedocs.io")
5292 (synopsis "Virtualenv-based automation of test activities")
5293 (description "Tox is a generic virtualenv management and test command line
5294tool. It can be used to check that a package installs correctly with
5295different Python versions and interpreters, or run tests in each type of
5296supported environment, or act as a frontend to continuous integration
5297servers.")
5298 (license license:expat)))
5299
5300(define-public python-validate-pyproject
5301 (package
5302 (name "python-validate-pyproject")
5303 (version "0.24.1")
5304 (source
5305 (origin
5306 (method url-fetch)
5307 (uri (pypi-uri "validate_pyproject" version))
5308 (sha256
5309 (base32 "0wbbksrfaxc2c7y305wjinkk4y1jxdnc0vzfbf79ipaa6m8zr0p1"))))
5310 (build-system pyproject-build-system)
5311 (arguments
5312 (list
5313 #:test-flags
5314 ;; TODO: Full test suite requires schemas from
5315 ;; <https://json.schemastore.org/pyproject.json> and obtained during CI
5316 ;; just before running tests, figure out how to get schema files to
5317 ;; cover all test cases, see <tools/cache_urls_for_tests.py> and
5318 ;; <.github/workflows/ci.yml>.
5319 #~(list "--ignore=tests/test_examples.py"
5320 "--ignore=tests/test_pre_compile.py"
5321 "-k" (string-join
5322 (list "not test_downloaded"
5323 "test_valid_download_only_once"
5324 "test_cache_open_url")
5325 " and not "))))
5326 (native-inputs
5327 (list python-pytest
5328 python-packaging
5329 python-setuptools
5330 python-setuptools-scm
5331 python-trove-classifiers
5332 python-wheel))
5333 (propagated-inputs
5334 (list python-fastjsonschema))
5335 (home-page "https://github.com/abravalheri/validate-pyproject/")
5336 (synopsis "Validation library for simple check on @code{pyproject.toml}")
5337 (description
5338 "Validation library and CLI tool for checking on @code{pyproject.toml}
5339files using JSON Schema.")
5340 (license (list license:mpl2.0
5341 license:expat
5342 license:bsd-3))))
5343
5344(define-public python-vcrpy
5345 (package
5346 (name "python-vcrpy")
5347 (version "7.0.0")
5348 (source
5349 (origin
5350 (method url-fetch)
5351 (uri (pypi-uri "vcrpy" version))
5352 (sha256
5353 (base32 "0l1sdfc51024jclqv9104nagpirxx8w0gcn5h0bdxv950jnr2qqp"))))
5354 (build-system pyproject-build-system)
5355 (arguments
5356 (list
5357 #:test-flags
5358 #~(list "--ignore=tests/integration"
5359 "-k" (string-join
5360 ;; These tests require network access.
5361 (list "not testing_connect"
5362 "test_get_vcr_with_matcher"
5363 "test_testcase_playback")
5364 " and not "))))
5365 (native-inputs
5366 (list python-aiohttp
5367 python-boto3
5368 python-httplib2
5369 python-httpx
5370 python-pytest
5371 python-pytest-aiohttp
5372 python-pytest-asyncio
5373 python-pytest-httpbin
5374 python-requests
5375 python-setuptools
5376 python-tornado
5377 python-urllib3
5378 python-werkzeug
5379 python-wheel))
5380 (propagated-inputs
5381 (list python-pyyaml python-wrapt python-yarl))
5382 (home-page "https://github.com/kevin1024/vcrpy")
5383 (synopsis "Automatically mock your HTTP interactions")
5384 (description
5385 "VCR.py simplifies and speeds up tests that make HTTP requests. The first
5386time you run code that is inside a VCR.py context manager or decorated function,
5387VCR.py records all HTTP interactions that take place through the libraries it
5388supports and serializes and writes them to a flat file (in yaml format by
5389default). This flat file is called a cassette. When the relevant piece of code
5390is executed again, VCR.py will read the serialized requests and responses from
5391the aforementioned cassette file, and intercept any HTTP requests that it
5392recognizes from the original test run and return the responses that corresponded
5393to those requests. This means that the requests will not actually result in
5394HTTP traffic, which confers several benefits including:
5395@enumerate
5396@item The ability to work offline
5397@item Completely deterministic tests
5398@item Increased test execution speed
5399@end enumerate
5400If the server you are testing against ever changes its API, all you need to do
5401is delete your existing cassette files, and run your tests again. VCR.py will
5402detect the absence of a cassette file and once again record all HTTP
5403interactions, which will update them to correspond to the new API.")
5404 (license license:expat)))
5405
5406(define-public python-vulture
5407 (package
5408 (name "python-vulture")
5409 (version "2.16")
5410 (source
5411 (origin
5412 (method url-fetch)
5413 (uri (pypi-uri "vulture" version))
5414 (sha256
5415 (base32 "05zpb79nhskdrbfmy4yk2wlkjgsvfv4l1hn6ldj1c083mzigdngq"))))
5416 (build-system pyproject-build-system)
5417 (arguments
5418 (list
5419 #:test-flags
5420 #~(list "-k" (string-join
5421 (list
5422 ;; Skip test that uses python-pint pint has many
5423 ;; dependencies.
5424 "not test_whitelists_with_python"
5425 ;; FileNotFoundError: [Errno 2] No such file or
5426 ;; directory: 'pytype'
5427 "test_pytype")
5428 " and not "))))
5429 (native-inputs
5430 (list python-pytest
5431 python-pytest-cov
5432 python-setuptools))
5433 (propagated-inputs
5434 (list python-tomli))
5435 (home-page "https://github.com/jendrikseipp/vulture")
5436 (synopsis "Find dead Python code")
5437 (description
5438 "Vulture finds unused code in Python programs. This is useful for
5439cleaning up and finding errors in large code bases. If you run Vulture on
5440both your library and test suite you can find untested code. Due to Python's
5441dynamic nature, static code analyzers like Vulture are likely to miss some
5442dead code. Also, code that is only called implicitly may be reported as
5443unused.")
5444 (license license:expat)))
5445
5446(define-public python-xdoctest
5447 (package
5448 (name "python-xdoctest")
5449 (version "1.3.0")
5450 (source
5451 (origin
5452 (method url-fetch)
5453 (uri (pypi-uri "xdoctest" version))
5454 (sha256
5455 (base32 "1m69yvc3bl9jj5av89p9jl08w9lsn0k3lqclpdbiq0g67fdbjb7r"))))
5456 (build-system pyproject-build-system)
5457 (arguments
5458 (list
5459 #:phases
5460 #~(modify-phases %standard-phases
5461 (add-before 'check 'pre-check
5462 (lambda _
5463 ;; A writable HOME is needed by the 'import_module_from_path'
5464 ;; test.
5465 (setenv "HOME" "/tmp"))))))
5466 (native-inputs
5467 (list cmake-minimal
5468 ninja
5469 pybind11-2
5470 python-pytest-bootstrap
5471 python-scikit-build
5472 python-setuptools))
5473 (home-page "https://github.com/Erotemic/xdoctest")
5474 (synopsis "Rewrite of the Python builtin doctest module")
5475 (description
5476 "This package provides a rewrite of the builtin doctest module which
5477 leverages the Python @acronym{AST, Abstract Syntax Tree} instead of
5478@acronym{REGEXPs, regular expressions}.")
5479 (license license:asl2.0)))
5480
5481(define-public ruff
5482 (package
5483 (name "ruff")
5484 (version "0.13.1")
5485 (source
5486 (origin
5487 (method git-fetch)
5488 (uri (git-reference
5489 (url "https://github.com/astral-sh/ruff")
5490 (commit version)))
5491 (file-name (git-file-name name version))
5492 (sha256
5493 (base32
5494 "1svf9kgzbl20wbz77kzbhxaisb5cz3i28hycmkgsinn6jaj44b3l"))))
5495 (build-system cargo-build-system)
5496 (arguments
5497 (list
5498 #:cargo-install-paths ''("crates/ruff")
5499 #:install-source? #f
5500 #:modules
5501 '((guix build cargo-build-system)
5502 (guix build utils)
5503 (ice-9 match))
5504 #:phases
5505 #~(modify-phases %standard-phases
5506 (add-after 'unpack 'use-guix-vendored-dependencies
5507 (lambda _
5508 (substitute* '("Cargo.toml" "fuzz/Cargo.toml")
5509 (("git = \"[^\"]+\", ")
5510 "")
5511 (("rev = \"[^\"]+\"")
5512 "version = \"*\""))))
5513 (add-after 'patch-generated-file-shebangs 'adjust-shebangs-for-tests
5514 (lambda _
5515 ;; Because of the Guix shebangs patching phases, the
5516 ;; path_new_exe003_py_expects test fails to match its expected
5517 ;; FHS shebang. Adjust it.
5518 (substitute* "crates/ruff_linter/resources/test/fixtures\
5519/flake8_executable/EXE003.py"
5520 (("#!/gnu/.*bash")
5521 "#!/usr/bin/bash"))))
5522 (add-before 'build 'override-jemalloc
5523 (lambda* (#:key inputs #:allow-other-keys) ;Copied from uv
5524 (let ((jemalloc (assoc-ref inputs "jemalloc")))
5525 ;; This flag is needed when not using the bundled jemalloc.
5526 ;; https://github.com/tikv/jemallocator/issues/19
5527 (setenv
5528 "CARGO_FEATURE_UNPREFIXED_MALLOC_ON_SUPPORTED_PLATFORMS" "1")
5529 (setenv "JEMALLOC_OVERRIDE"
5530 (string-append jemalloc "/lib/libjemalloc.so")))))
5531 (add-after 'install 'install-completions
5532 (lambda* (#:key native-inputs #:allow-other-keys)
5533 (for-each
5534 (match-lambda
5535 ((shell . path)
5536 (mkdir-p (in-vicinity #$output (dirname path)))
5537 (let ((binary
5538 (if #$(%current-target-system)
5539 (search-input-file native-inputs "bin/ruff")
5540 (in-vicinity #$output "bin/ruff"))))
5541 (with-output-to-file (in-vicinity #$output path)
5542 (lambda _
5543 (invoke binary "generate-shell-completion" shell))))))
5544 '(("bash" . "share/bash-completion/completions/ruff")
5545 ("elvish" . "share/elvish/lib/ruff")
5546 ("fish" . "share/fish/vendor_completions.d/ruff.fish")
5547 ("zsh" . "share/zsh/site-functions/_ruff"))))))))
5548 (native-inputs
5549 (append (if (%current-target-system)
5550 (list this-package)
5551 '())
5552 (list pkg-config)))
5553 (inputs
5554 (cons* jemalloc
5555 `(,zstd "lib")
5556 (cargo-inputs 'ruff)))
5557 (home-page "https://docs.astral.sh/ruff")
5558 (synopsis "Extremely fast Python linter and code formatter")
5559 (description "Ruff aims to be orders of magnitude faster than alternative
5560tools while integrating more functionality behind a single, common interface.
5561Ruff can be used to replace Flake8 (plus dozens of plugins), Black, isort,
5562pydocstyle, pyupgrade, autoflake, and more, all while executing tens or
5563hundreds of times faster than any individual tool.")
5564 (license license:expat)))
5565
5566(define-public tms
5567 (package
5568 (name "tms")
5569 (version "0.1.2")
5570 (source
5571 (origin
5572 (method hg-fetch)
5573 (uri (hg-reference
5574 (url "https://hg.sr.ht/~olly/tms")
5575 (changeset (string-append "v" version))))
5576 (file-name (string-append name "-" version "-checkout"))
5577 (sha256
5578 (base32 "1k8v8vx0klz3zfj81g9d1rancn819sv51lgs5j94x69kqzgn3fsw"))))
5579 (build-system pyproject-build-system)
5580 (arguments
5581 (list #:test-backend #~'custom
5582 #:test-flags #~(list "tests.py")))
5583 (native-inputs (list python-setuptools))
5584 (home-page "https://hg.sr.ht/~olly/tms")
5585 (synopsis "Test Match Special for test assertions")
5586 (description
5587 "This package provides match data structures and types in test code.")
5588 (license license:bsd-2)))