projects/guix·blob python-team · refs

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