gnu: facter: Update to 4.0.33.
[jackhill/guix/guix.git] / gnu / packages / python-check.scm
CommitLineData
e253b94d
RW
1;;; GNU Guix --- Functional package management for GNU
2;;; Copyright © 2019 Ricardo Wurmus <rekado@elephly.net>
5bcb2f0f 3;;; Copyright © 2019 Tobias Geerinckx-Rice <me@tobias.gr>
6e003bd4 4;;; Copyright © 2019, 2020 Efraim Flashner <efraim@flashner.co.il>
e2fb29b7 5;;; Copyright © 2019 Maxim Cournoyer <maxim.cournoyer@gmail.com>
c1ff9072 6;;; Copyright © 2019 Hartmut Goebel <h.goebel@crazy-compilers.com>
9532c0bb 7;;; Copyright © 2020 Julien Lepiller <julien@lepiller.eu>
5d9d9383 8;;; Copyright © 2020 Marius Bakke <mbakke@fastmail.com>
d79c917f 9;;; Copyright © 2020 Edouard Klein <edk@beaver-labs.com>
c0f52c41 10;;; Copyright © 2020 Vinicius Monego <monego@posteo.net>
f755bb01 11;;; Copyright © 2020 Tanguy Le Carrour <tanguy@bioneland.org>
e253b94d
RW
12;;;
13;;; This file is part of GNU Guix.
14;;;
15;;; GNU Guix is free software; you can redistribute it and/or modify it
16;;; under the terms of the GNU General Public License as published by
17;;; the Free Software Foundation; either version 3 of the License, or (at
18;;; your option) any later version.
19;;;
20;;; GNU Guix is distributed in the hope that it will be useful, but
21;;; WITHOUT ANY WARRANTY; without even the implied warranty of
22;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
23;;; GNU General Public License for more details.
24;;;
25;;; You should have received a copy of the GNU General Public License
26;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>.
27
28(define-module (gnu packages python-check)
29 #:use-module (gnu packages)
30 #:use-module (gnu packages check)
31 #:use-module (gnu packages python-web)
32 #:use-module (gnu packages python-xyz)
9569db37 33 #:use-module (gnu packages web)
4fae4f9a 34 #:use-module (gnu packages xml)
e253b94d
RW
35 #:use-module (guix utils)
36 #:use-module ((guix licenses) #:prefix license:)
37 #:use-module (guix packages)
6e003bd4 38 #:use-module (guix git-download)
e253b94d
RW
39 #:use-module (guix download)
40 #:use-module (guix build-system python))
41
42(define-public python-coveralls
43 (package
44 (name "python-coveralls")
5d9d9383
MB
45 (version "1.11.1")
46 (home-page "https://github.com/coveralls-clients/coveralls-python")
e253b94d
RW
47 (source
48 (origin
5d9d9383
MB
49 ;; The PyPI release lacks tests, so we pull from git instead.
50 (method git-fetch)
51 (uri (git-reference (url home-page) (commit version)))
52 (file-name (git-file-name name version))
e253b94d
RW
53 (sha256
54 (base32
5d9d9383 55 "1zr1lqdjcfwj6wcx2449mzzjq8bbhwnqcm5vdif5s8hlz35bjxkp"))))
e253b94d 56 (build-system python-build-system)
5d9d9383
MB
57 (arguments
58 '(#:phases (modify-phases %standard-phases
59 (add-before 'check 'disable-git-test
60 (lambda _
61 ;; Remove test that requires 'git' and the full checkout.
62 (delete-file "tests/git_test.py")
63 #t))
64 (replace 'check
65 (lambda* (#:key tests? #:allow-other-keys)
66 (if tests?
67 (invoke "pytest" "-vv")
68 (format #t "test suite not run~%"))
69 #t)))))
e253b94d
RW
70 (propagated-inputs
71 `(("python-coverage" ,python-coverage)
72 ("python-docopt" ,python-docopt)
73 ("python-pyyaml" ,python-pyyaml)
5d9d9383 74 ("python-requests" ,python-requests)))
e253b94d
RW
75 (native-inputs
76 `(("python-mock" ,python-mock)
77 ("python-pytest" ,python-pytest)))
e253b94d
RW
78 (synopsis "Show coverage stats online via coveralls.io")
79 (description
80 "Coveralls.io is a service for publishing code coverage statistics online.
81This package provides seamless integration with coverage.py (and thus pytest,
82nosetests, etc...) in Python projects.")
83 (license license:expat)))
9569db37
EF
84
85(define-public python-vcrpy
86 (package
87 (name "python-vcrpy")
88 (version "2.0.1")
89 (source
90 (origin
91 (method url-fetch)
92 (uri (pypi-uri "vcrpy" version))
93 (sha256
94 (base32
95 "0kws7l3hci1dvjv01nxw3805q9v2mwldw58bgl8s90wqism69gjp"))))
96 (build-system python-build-system)
97 (arguments `(#:tests? #f)) ; tests require more packages for python-pytest-httpbin
98 (propagated-inputs
99 `(("python-pyyaml" ,python-pyyaml)
100 ("python-six" ,python-six)
101 ("python-wrapt" ,python-wrapt)
102 ("python-yarl" ,python-yarl)))
103 (native-inputs
104 `(("python-mock" ,python-mock)
105 ("python-pytest" ,python-pytest)
106 ("python-pytest-httpbin" ,python-pytest-httpbin)))
107 (home-page "https://github.com/kevin1024/vcrpy")
108 (synopsis "Automatically mock your HTTP interactions")
109 (description
110 "VCR.py simplifies and speeds up tests that make HTTP requests. The first
111time you run code that is inside a VCR.py context manager or decorated function,
112VCR.py records all HTTP interactions that take place through the libraries it
113supports and serializes and writes them to a flat file (in yaml format by
114default). This flat file is called a cassette. When the relevant piece of code
115is executed again, VCR.py will read the serialized requests and responses from
116the aforementioned cassette file, and intercept any HTTP requests that it
117recognizes from the original test run and return the responses that corresponded
118to those requests. This means that the requests will not actually result in
119HTTP traffic, which confers several benefits including:
120@enumerate
121@item The ability to work offline
122@item Completely deterministic tests
123@item Increased test execution speed
124@end enumerate
125If the server you are testing against ever changes its API, all you need to do
126is delete your existing cassette files, and run your tests again. VCR.py will
127detect the absence of a cassette file and once again record all HTTP
128interactions, which will update them to correspond to the new API.")
129 (license license:expat)))
85bf6798 130
63646101
VM
131(define-public python-pytest-ordering
132 (package
133 (name "python-pytest-ordering")
134 (version "0.6")
135 (source
136 (origin
137 ;; No tests in the PyPI tarball.
138 (method git-fetch)
139 (uri (git-reference
140 (url "https://github.com/ftobia/pytest-ordering")
141 (commit version)))
142 (file-name (git-file-name name version))
143 (sha256
144 (base32 "14msj5gyqza0gk3x7h1ivmjrwza82v84cj7jx3ks0fw9lpin7pjq"))))
145 (build-system python-build-system)
146 (arguments
147 '(#:phases
148 (modify-phases %standard-phases
149 (replace 'check
150 (lambda* (#:key inputs outputs #:allow-other-keys)
151 (add-installed-pythonpath inputs outputs)
152 (invoke "pytest" "-vv" "-k"
153 ;; This test fails because of a type mismatch of an
154 ;; argument passed to @code{pytest.main}.
155 "not test_run_marker_registered"))))))
156 (native-inputs
157 `(("python-pytest" ,python-pytest)))
158 (home-page "https://github.com/ftobia/pytest-ordering")
159 (synopsis "Pytest plugin to run your tests in a specific order")
160 (description
161 "This plugin defines Pytest markers to ensure that some tests, or groups
162of tests run in a specific order.")
163 (license license:expat)))
164
c0f52c41
VM
165(define-public python-pytest-arraydiff
166 (package
167 (name "python-pytest-arraydiff")
168 (version "0.3")
169 (source
170 (origin
171 (method url-fetch)
172 (uri (pypi-uri "pytest-arraydiff" version))
173 (sha256
174 (base32 "05bcvhh2ycxa35znl8b3l9vkcmx7vwm5c3fpakbpw46c7vsn4bfy"))))
175 (build-system python-build-system)
176 (arguments
177 ;; Tests require python-astropy, which itself requires this package.
178 ;; Disable tests to avoid the circular dependency problem.
179 '(#:tests? #f))
180 (propagated-inputs
181 `(("python-numpy" ,python-numpy)
182 ("python-six" ,python-six)))
183 (home-page "https://github.com/astropy/pytest-arraydiff")
184 (synopsis "Pytest plugin to help with comparing array output from tests")
185 (description
186 "This is a py.test plugin to facilitate the generation and comparison of
187data arrays produced during tests, in particular in cases where the arrays
188are too large to conveniently hard-code them in the tests.")
189 (license license:bsd-3)))
190
5bec698d
VM
191(define-public python-pytest-doctestplus
192 (package
193 (name "python-pytest-doctestplus")
194 (version "0.7.0")
195 (source
196 (origin
197 (method url-fetch)
198 (uri (pypi-uri "pytest-doctestplus" version))
199 (sha256
200 (base32 "1ai9kvd7xbq2jg2h8gmkb8lqzyrxvdh4zg3vxndg149iwd1hyi7d"))))
201 (build-system python-build-system)
202 (arguments
203 '(#:phases
204 (modify-phases %standard-phases
205 (replace 'check
206 (lambda* (#:key inputs outputs #:allow-other-keys)
207 ;; Make the installed plugin discoverable by Pytest.
208 (add-installed-pythonpath inputs outputs)
209 (invoke "pytest" "-vv"))))))
210 (native-inputs
211 `(("python-pytest" ,python-pytest)))
212 (home-page "https://github.com/astropy/pytest-doctestplus")
213 (synopsis "Pytest plugin with advanced doctest features")
214 (description
215 "This package contains a plugin for the Pytest framework that provides
216advanced doctest support and enables the testing of reStructuredText files.")
217 (license license:bsd-3)))
218
4202af69
VM
219(define-public python-pytest-filter-subpackage
220 (package
221 (name "python-pytest-filter-subpackage")
222 (version "0.1.1")
223 (source
224 (origin
225 (method url-fetch)
226 (uri (pypi-uri "pytest-filter-subpackage" version))
227 (sha256
228 (base32 "1s4s2kd31yc65rfvl4xhy8xx806xhy59kc7668h6b6wq88xgrn5p"))))
229 (build-system python-build-system)
230 (arguments
231 '(;; One test is failing. There's an issue reported upstream. See
232 ;; https://github.com/astropy/pytest-filter-subpackage/issues/3.
233 ;; Disable it for now.
234 #:phases
235 (modify-phases %standard-phases
236 (replace 'check
237 (lambda* (#:key inputs outputs #:allow-other-keys)
238 ;; Make the installed plugin discoverable by Pytest.
239 (add-installed-pythonpath inputs outputs)
240 (invoke "pytest" "-vv" "-k" "not test_with_rst"))))))
241 (native-inputs
242 `(("python-pytest" ,python-pytest)
243 ("python-pytest-cov" ,python-pytest-cov)
244 ("python-pytest-doctestplus"
245 ,python-pytest-doctestplus)))
246 (home-page "https://github.com/astropy/pytest-filter-subpackage")
247 (synopsis "Pytest plugin for filtering based on sub-packages")
248 (description
249 "This package contains a simple plugin for the pytest framework that
250provides a shortcut to testing all code and documentation for a given
251sub-package.")
252 (license license:bsd-3)))
253
8974f7d0
VM
254(define-public python-pytest-openfiles
255 (package
256 (name "python-pytest-openfiles")
257 (version "0.5.0")
258 (source
259 (origin
260 (method url-fetch)
261 (uri (pypi-uri "pytest-openfiles" version))
262 (sha256
263 (base32 "0n0a7fdc9m86360y96l23fvdmd6rw04bl6h5xqgl9qxfv08jk70p"))))
264 (build-system python-build-system)
265 (arguments
266 '(#:phases
267 (modify-phases %standard-phases
268 (replace 'check
269 (lambda* (#:key inputs outputs #:allow-other-keys)
270 ;; Make the installed plugin discoverable by Pytest.
271 (add-installed-pythonpath inputs outputs)
272 (invoke "pytest" "-vv"))))))
273 (native-inputs
274 `(("python-setuptools-scm" ,python-setuptools-scm)
275 ("python-pytest" ,python-pytest)))
276 (propagated-inputs
277 `(("python-psutil" ,python-psutil)))
278 (home-page "https://github.com/astropy/pytest-openfiles")
279 (synopsis "Pytest plugin for detecting inadvertent open file handles")
280 (description
281 "This package provides a plugin for the pytest framework that allows
282developers to detect whether any file handles or other file-like objects
283were inadvertently left open at the end of a unit test.")
284 (license license:bsd-3)))
285
04a3cb99
VM
286(define-public python-pytest-remotedata
287 (package
288 (name "python-pytest-remotedata")
289 (version "0.3.2")
290 (source
291 (origin
292 (method url-fetch)
293 (uri (pypi-uri "pytest-remotedata" version))
294 (sha256
295 (base32 "1h6g6shib6z07azf12rnsa053470ggbd7hy3bnbw8nf3nza5h372"))))
296 (build-system python-build-system)
297 (arguments
298 '(#:phases
299 (modify-phases %standard-phases
300 (replace 'check
301 (lambda* (#:key inputs outputs #:allow-other-keys)
302 ;; Make the installed plugin discoverable by Pytest.
303 (add-installed-pythonpath inputs outputs)
304 (invoke "pytest" "-vv" "-k"
305 (string-append
306 ;; These tests require internet access. Disable them.
307 "not test_default_behavior"
308 " and not test_strict_with_decorator")))))))
309 (native-inputs
310 `(("python-pytest" ,python-pytest)))
311 (propagated-inputs
312 `(("python-six" ,python-six)))
313 (home-page "https://github.com/astropy/pytest-remotedata")
314 (synopsis "Pytest plugin for controlling remote data access")
315 (description
316 "This package provides a plugin for the Pytest framework that allows
317developers to control unit tests that require access to data from the
318internet.")
319 (license license:bsd-3)))
320
8ea5d35e
VM
321(define-public python-pytest-mpl
322 (package
323 (name "python-pytest-mpl")
324 (version "0.11")
325 (source
326 (origin
327 (method url-fetch)
328 (uri (pypi-uri "pytest-mpl" version))
329 (sha256
330 (base32 "1km202c1s5kcn52fx0266p06qb34va3warcby594dh6vixxa9i96"))))
331 (build-system python-build-system)
332 (arguments
333 '(#:phases
334 (modify-phases %standard-phases
335 (replace 'check
336 (lambda _
337 (invoke "pytest" "-vv"))))))
338 (native-inputs
339 `(("python-pytest" ,python-pytest)))
340 (propagated-inputs
341 `(("python-matplotlib" ,python-matplotlib)
342 ("python-pillow" ,python-pillow)))
343 (home-page "https://github.com/matplotlib/pytest-mpl")
344 (synopsis "Pytest plugin to help with testing figures output from Matplotlib")
345 (description
346 "This is a plugin to facilitate image comparison for Matplotlib figures
347in Pytest.")
348 (license license:bsd-3)))
349
ea4972e6
VM
350(define-public python-covdefaults
351 (package
352 (name "python-covdefaults")
353 (version "1.1.0")
354 (source
355 (origin
356 ;; The PyPI tarball does not include tests.
357 (method git-fetch)
358 (uri (git-reference
359 (url "https://github.com/asottile/covdefaults")
360 (commit (string-append "v" version))))
361 (file-name (git-file-name name version))
362 (sha256
363 (base32 "11a24c0wzv01n55fy4kdpnyqna4m9k0mp58kmhiaks34xw4k37hq"))))
364 (build-system python-build-system)
365 (arguments
366 `(#:phases
367 (modify-phases %standard-phases
368 (replace 'check
369 (lambda _
370 (invoke "pytest" "-vv"))))))
371 (native-inputs
372 `(("python-coverage" ,python-coverage)
373 ("python-pytest" ,python-pytest)))
374 (home-page "https://github.com/asottile/covdefaults")
375 (synopsis "Coverage plugin to provide opinionated default settings")
376 (description
377 "Covdefaults is a coverage plugin to provide opinionated default
378 settings.")
379 (license license:expat)))
380
6e003bd4 381(define-public python-pytest-vcr
d6fedf6b
EF
382 ;; This commit fixes integration with pytest-5
383 (let ((commit "4d6c7b3e379a6a7cba0b8f9d20b704dc976e9f05")
384 (revision "1"))
385 (package
386 (name "python-pytest-vcr")
387 (version (git-version "1.0.2" revision commit))
388 (source
389 (origin
390 (method git-fetch)
391 (uri (git-reference
392 (url "https://github.com/ktosiek/pytest-vcr")
393 (commit commit)))
394 (file-name (git-file-name name version))
395 (sha256
396 (base32
397 "1yk988zi0la6zpcm3fff0mxf942di2jiymrfqas19nyngj5ygaqs"))))
398 (build-system python-build-system)
399 (arguments
400 `(#:phases
401 (modify-phases %standard-phases
402 (replace 'check
403 (lambda* (#:key inputs outputs #:allow-other-keys)
404 (add-installed-pythonpath inputs outputs)
405 (invoke "pytest" "tests/"))))))
406 (propagated-inputs
407 `(("python-pytest" ,python-pytest)
408 ("python-vcrpy" ,python-vcrpy)))
409 (home-page "https://github.com/ktosiek/pytest-vcr")
410 (synopsis "Plugin for managing VCR.py cassettes")
411 (description
412 "Plugin for managing VCR.py cassettes.")
413 (license license:expat))))
6e003bd4 414
85bf6798
RW
415(define-public python-pytest-checkdocs
416 (package
417 (name "python-pytest-checkdocs")
4d755996 418 (version "1.2.2")
85bf6798
RW
419 (source
420 (origin
421 (method url-fetch)
422 (uri (pypi-uri "pytest-checkdocs" version))
423 (sha256
4d755996 424 (base32 "0j6j1gvj6x451y3qsx4xbaq9p1w9gg3mwk7n0w80cy8vdyjkngb0"))))
85bf6798
RW
425 (build-system python-build-system)
426 (propagated-inputs
59fa08d6
MB
427 `(("python-docutils" ,python-docutils)
428 ("python-importlib-metadata" ,python-importlib-metadata)
4d755996 429 ("python-more-itertools" ,python-more-itertools)))
85bf6798
RW
430 (native-inputs
431 `(("python-setuptools-scm" ,python-setuptools-scm)))
432 (home-page "https://github.com/jaraco/pytest-checkdocs")
433 (synopsis "Check the README when running tests")
434 (description
435 "This package provides a pytest plugin that checks the long description
436of the project to ensure it renders properly.")
437 (license license:expat)))
3b89476b 438
51431f0b
VM
439(define-public python-pytest-trio
440 (package
441 (name "python-pytest-trio")
442 (version "0.6.0")
443 (source
444 (origin
445 (method url-fetch)
446 (uri (pypi-uri "pytest-trio" version))
447 (sha256
448 (base32 "1zm8didm9h5jkqhghl9bvqs7kr7sjci282c7grhk6yhpzn8a9w4v"))))
449 (build-system python-build-system)
450 (arguments
451 `(#:phases
452 (modify-phases %standard-phases
453 (replace 'check
454 (lambda* (#:key inputs outputs #:allow-other-keys)
455 (add-installed-pythonpath inputs outputs)
456 (invoke "pytest" "-W" "error" "-ra" "-v" "--pyargs"
457 "pytest_trio" "--verbose" "--cov"))))))
458 (native-inputs
459 `(("python-hypothesis" ,python-hypothesis)
460 ("python-pytest" ,python-pytest)
461 ("python-pytest-cov" ,python-pytest-cov)))
462 (propagated-inputs
463 `(("python-trio" ,python-trio)))
464 (home-page "https://github.com/python-trio/pytest-trio")
465 (synopsis "Pytest plugin for trio")
466 (description
467 "This is a pytest plugin to help you test projects that use Trio, a
468friendly library for concurrency and async I/O in Python.")
469 ;; Either license applies.
470 (license (list license:expat license:asl2.0))))
471
3b89476b
RW
472(define-public python-pytest-flake8
473 (package
474 (name "python-pytest-flake8")
484255f7 475 (version "1.0.6")
3b89476b
RW
476 (source
477 (origin
478 (method url-fetch)
479 (uri (pypi-uri "pytest-flake8" version))
480 (sha256
481 (base32
484255f7 482 "09vhn7r77s1yiqnlwfvh5585f904zpyd6620a90dpccfr1cbp0hv"))))
3b89476b
RW
483 (build-system python-build-system)
484 (propagated-inputs
485 `(("python-flake8" ,python-flake8)))
486 (native-inputs
487 `(("python-pytest" ,python-pytest)))
488 (home-page "https://github.com/tholo/pytest-flake8")
489 (synopsis "Pytest plugin to check FLAKE8 requirements")
490 (description
491 "This package provides a pytest plugin for efficiently checking PEP8
492compliance.")
493 (license license:bsd-3)))
21e2c559 494
c1ff9072
HG
495(define-public python-pytest-isort
496 (package
497 (name "python-pytest-isort")
498 (version "0.3.1")
499 (source
500 (origin
501 (method url-fetch)
502 (uri (pypi-uri "pytest-isort" version))
503 (sha256
504 (base32 "06myn5hhxs5yp8dqr1yjsgcnnxnsrvsqannm00bvaw0qml6ydzjb"))))
505 (build-system python-build-system)
506 (arguments
507 `(#:phases
508 (modify-phases %standard-phases
509 (replace 'check
510 (lambda _
511 (setenv "PYTHONPATH"
512 (string-append (getcwd) ":"
513 (getenv "PYTHONPATH")))
514 (invoke "pytest"))))))
515 (propagated-inputs
516 `(("python-isort" ,python-isort)
517 ("python-pytest" ,python-pytest)))
518 (home-page "https://github.com/moccu/pytest-isort/")
519 (synopsis "Pytest plugin to check import ordering using isort")
520 (description
521 "This package provides a pytest plugin to check import ordering using
522isort.")
523 (license license:bsd-3)))
524
21e2c559
RW
525(define-public python-pytest-shutil
526 (package
527 (name "python-pytest-shutil")
528 (version "1.7.0")
529 (source
530 (origin
531 (method url-fetch)
532 (uri (pypi-uri "pytest-shutil" version))
533 (sha256
534 (base32
535 "0q8j0ayzmnvlraml6i977ybdq4xi096djhf30n2m1rvnvrhm45nq"))))
536 (build-system python-build-system)
537 (arguments
538 `(#:phases
539 (modify-phases %standard-phases
540 (add-after 'unpack 'patch-tests
541 (lambda _
542 (mkdir "/tmp/bin")
543 (substitute* "tests/integration/test_cmdline_integration.py"
544 (("dirname = '/bin'")
545 "dirname = '/tmp/bin'")
546 (("bindir = os.path.realpath\\('/bin'\\)")
547 "bindir = os.path.realpath('/tmp/bin')"))
548 #t)))))
549 (propagated-inputs
550 `(("python-contextlib2" ,python-contextlib2)
551 ("python-execnet" ,python-execnet)
552 ("python-pathpy" ,python-pathpy)
553 ("python-termcolor" ,python-termcolor)))
554 (native-inputs
555 `(("python-mock" ,python-mock)
556 ("python-pytest" ,python-pytest)
557 ("python-setuptools-git" ,python-setuptools-git)))
558 (home-page "https://github.com/manahl/pytest-plugins")
559 (synopsis "Assorted shell and environment tools for py.test")
560 (description
561 "This package provides assorted shell and environment tools for the
562py.test testing framework.")
563 (license license:expat)))
7d5ffecb
RW
564
565(define-public python-pytest-fixture-config
566 (package
567 (name "python-pytest-fixture-config")
568 (version "1.7.0")
569 (source
570 (origin
571 (method url-fetch)
572 (uri (pypi-uri "pytest-fixture-config" version))
573 (sha256
574 (base32
575 "13i1qpz22w3x4dmw8vih5jdnbqfqvl7jiqs0dg764s0zf8bp98a1"))))
576 (build-system python-build-system)
577 (native-inputs
578 `(("python-pytest" ,python-pytest)
579 ("python-setuptools-git" ,python-setuptools-git)))
580 (home-page "https://github.com/manahl/pytest-plugins")
581 (synopsis "Fixture configuration utils for py.test")
582 (description
583 "This package provides fixture configuration utilities for the py.test
584testing framework.")
585 (license license:expat)))
05b3dcbe
RW
586
587(define-public python-pytest-virtualenv
588 (package
589 (name "python-pytest-virtualenv")
590 (version "1.7.0")
591 (source
592 (origin
593 (method url-fetch)
594 (uri (pypi-uri "pytest-virtualenv" version))
595 (sha256
596 (base32
597 "03w2zz3crblj1p6i8nq17946hbn3zqp9z7cfnifw47hi4a4fww12"))))
598 (build-system python-build-system)
e2fb29b7
MC
599 (arguments
600 `(#:phases
601 (modify-phases %standard-phases
602 ;; Reference the virtualenv executable directly, to avoid the need
603 ;; for PYTHONPATH, which gets cleared when instantiating a new
604 ;; virtualenv with pytest-virtualenv.
605 (add-after 'unpack 'patch-virtualenv-executable
606 (lambda* (#:key inputs #:allow-other-keys)
607 (let* ((virtualenv (assoc-ref inputs "python-virtualenv"))
608 (virtualenv-bin (string-append virtualenv
609 "/bin/virtualenv")))
610 (substitute* "pytest_virtualenv.py"
611 (("^DEFAULT_VIRTUALENV_FIXTURE_EXECUTABLE.*$")
612 (format #f "DEFAULT_VIRTUALENV_FIXTURE_EXECUTABLE = '~a'"
613 virtualenv-bin)))
614 #t))))))
05b3dcbe 615 (propagated-inputs
e2fb29b7 616 `(("python-pytest-shutil" ,python-pytest-shutil)
05b3dcbe 617 ("python-pytest-fixture-config" ,python-pytest-fixture-config)))
e2fb29b7
MC
618 (inputs
619 `(("python-virtualenv" ,python-virtualenv)))
05b3dcbe
RW
620 (native-inputs
621 `(("python-mock" ,python-mock)
622 ("python-pytest" ,python-pytest)
623 ("python-setuptools-git" ,python-setuptools-git)))
624 (home-page "https://github.com/manahl/pytest-plugins")
625 (synopsis "Virtualenv fixture for py.test")
626 (description "This package provides a virtualenv fixture for the py.test
627framework.")
628 (license license:expat)))
9532c0bb 629
d79c917f
EK
630(define-public python-pytest-pycodestyle
631 (package
632 (name "python-pytest-pycodestyle")
633 (version "2.0.0") ;later versions require python-pytest~=5.4
634 (source
635 (origin
636 (method url-fetch)
637 (uri (pypi-uri "pytest-pycodestyle" version))
638 (sha256
639 (base32
640 "02i5gl7pm9cwxk15sn29inz3n8flpj1r3p1l110h43f2na5w8h7z"))))
641 (build-system python-build-system)
642 (propagated-inputs
643 `(("python-pycodestyle" ,python-pycodestyle)))
644 (native-inputs
645 `(("python-pytest" ,python-pytest)))
646 (home-page "https://github.com/henry0312/pytest-pycodestyle")
647 (synopsis "Pytest plugin to run pycodestyle")
648 (description "This package provides a plugin to run @code{pycodestyle}
649for the @code{pytest} framework.")
650 (license license:expat)))
651
857c63fe
EK
652(define-public python-pytest-benchmark
653 (package
654 (name "python-pytest-benchmark")
655 (version "3.2.3")
656 (source
657 (origin
658 (method url-fetch)
659 (uri (pypi-uri "pytest-benchmark" version))
660 (sha256
661 (base32
662 "0a4mpb4j73dsyk47hd1prrjpfk4r458s102cn80rf253jg818hxd"))))
663 (build-system python-build-system)
664 (propagated-inputs
665 `(("python-py-cpuinfo" ,python-py-cpuinfo)))
666 (native-inputs
667 `(("python-pathlib2" ,python-pathlib2)
668 ("python-pytest" ,python-pytest)))
669 (home-page "https://github.com/ionelmc/pytest-benchmark")
670 (synopsis "Pytest fixture for benchmarking code")
671 (description
672 "This package provides a pytest fixture that will group the tests into
673rounds that are calibrated to the chosen timer.")
674 (license license:bsd-2)))
675
0449f4eb
EF
676(define-public python-pytest-services
677 (package
678 (name "python-pytest-services")
679 (version "1.3.1")
680 (source
681 (origin
682 (method url-fetch)
683 (uri (pypi-uri "pytest-services" version))
684 (sha256
685 (base32
686 "0b2zfv04w6m3gp2v44ifdhx22vcji069qnn95ry3zcyxib7cjnq3"))))
687 (build-system python-build-system)
688 (arguments '(#:tests? #f)) ; Tests not included in release tarball.
689 (propagated-inputs
690 `(("python-psutil" ,python-psutil)
691 ("python-requests" ,python-requests)))
692 (native-inputs
693 `(("python-pytest" ,python-pytest)))
694 (home-page "https://github.com/pytest-dev/pytest-services")
695 (synopsis "Services plugin for pytest testing framework")
696 (description
697 "This plugin provides a set of fixtures and utility functions to start
698service processes for your tests with pytest.")
699 (license license:expat)))
700
3f4bfc38
EF
701(define-public python-pytest-aiohttp
702 (package
703 (name "python-pytest-aiohttp")
704 (version "0.3.0")
705 (source
706 (origin
707 (method url-fetch)
708 (uri (pypi-uri "pytest-aiohttp" version))
709 (sha256
710 (base32
711 "0kx4mbs9bflycd8x9af0idcjhdgnzri3nw1qb0vpfyb3751qaaf9"))))
712 (build-system python-build-system)
713 (native-inputs
714 `(("python-pytest" ,python-pytest)))
715 (propagated-inputs
716 `(("python-aiohttp" ,python-aiohttp)))
717 (home-page "https://github.com/aio-libs/pytest-aiohttp/")
718 (synopsis "Pytest plugin for aiohttp support")
719 (description "This package provides a pytest plugin for aiohttp support.")
720 (license license:asl2.0)))
721
e86b6ef0
VM
722(define-public python-nbval
723 (package
724 (name "python-nbval")
725 (version "0.9.5")
726 (source
727 (origin
728 (method url-fetch)
729 (uri (pypi-uri "nbval" version))
730 (sha256
731 (base32 "1xh2p7g5s5g06caaraf3dsz69bpj7dgw2h3ss67kci789aspnwp8"))))
732 (build-system python-build-system)
733 (arguments
734 `(#:phases
735 (modify-phases %standard-phases
736 (add-before 'check 'fix-test
737 (lambda _
738 ;; This test fails because of a mismatch in the output of LaTeX
739 ;; equation environments. Seems OK to skip.
740 (delete-file "tests/ipynb-test-samples/test-latex-pass-correctouput.ipynb")
741 #t))
742 (replace 'check
743 (lambda* (#:key inputs outputs #:allow-other-keys)
744 (add-installed-pythonpath inputs outputs)
745 (invoke "pytest" "-vv" "-k"
746 (string-append
747 ;; This only works with Pytest < 5.
748 "not nbdime_reporter"
749 ;; https://github.com/computationalmodelling/nbval/pull/148.
750 " and not test_timeouts")))))))
751 (native-inputs
752 `(("python-pytest" ,python-pytest)
753 ("python-pytest-cov" ,python-pytest-cov)
754 ("python-sympy" ,python-sympy)))
755 (propagated-inputs
756 `(("python-ipykernel" ,python-ipykernel)
757 ("python-jupyter-client" ,python-jupyter-client)
758 ("python-nbformat" ,python-nbformat)
759 ("python-six" ,python-six)))
760 (home-page "https://github.com/computationalmodelling/nbval")
761 (synopsis "Pytest plugin to validate Jupyter notebooks")
762 (description
763 "This plugin adds functionality to Pytest to recognise and collect Jupyter
764notebooks. The intended purpose of the tests is to determine whether execution
765of the stored inputs match the stored outputs of the @file{.ipynb} file. Whilst
766also ensuring that the notebooks are running without errors.")
767 (license license:bsd-3)))
768
85acb5f5
EK
769(define-public python-pytest-flask
770 (package
771 (name "python-pytest-flask")
772 (version "1.0.0")
773 (source
774 (origin
775 (method url-fetch)
776 (uri (pypi-uri "pytest-flask" version))
777 (sha256
778 (base32
779 "1hln7mwgdzfi5ma0kqfsi768l7p24jhkw8l0imhifwy08nh7hmjd"))))
780 (build-system python-build-system)
781 (native-inputs
782 `(("python-flask" ,python-flask)
783 ("python-pytest" ,python-pytest)
784 ("python-setuptools-scm" ,python-setuptools-scm)
785 ("python-werkzeug" ,python-werkzeug)))
786 (home-page "https://github.com/pytest-dev/pytest-flask")
787 (synopsis "Pytest fixtures to test Flask applications")
788 (description
789 "This pytest plugin provides fixtures to simplify Flask app testing.")
790 (license license:expat)))
791
a5d27dbe
VM
792(define-public python-pytest-env
793 (package
794 (name "python-pytest-env")
795 (version "0.6.2")
796 (source
797 (origin
798 (method url-fetch)
799 (uri (pypi-uri "pytest-env" version))
800 (sha256
801 (base32 "1hl0ln0cicdid4qjk7mv90lw9xkb0v71dlj7q7rn89vzxxm9b53y"))))
802 (build-system python-build-system)
803 (native-inputs
804 `(("python-pytest" ,python-pytest)))
805 (home-page "https://github.com/MobileDynasty/pytest-env")
806 (synopsis "Pytest plugin that allows you to add environment variables")
807 (description
808 "This is a @code{py.test} plugin that enables you to set environment
809variables in the @file{pytest.ini} file.")
810 (license license:expat)))
811
9532c0bb
JL
812(define-public python-codacy-coverage
813 (package
814 (name "python-codacy-coverage")
815 (version "1.3.11")
816 (source
817 (origin
818 (method url-fetch)
819 (uri (pypi-uri "codacy-coverage" version))
820 (sha256
821 (base32
822 "1g0c0w56xdkmqb8slacyw5qhzrkp814ng3ddh2lkiij58y9m2imr"))))
823 (build-system python-build-system)
824 (arguments
825 `(#:tests? #f)); no tests
826 (propagated-inputs
827 `(("python-check-manifest" ,python-check-manifest)))
828 (home-page "https://github.com/codacy/python-codacy-coverage")
829 (synopsis "Codacy coverage reporter for Python")
830 (description "This package analyses Python test suites and reports how much
831of the code is covered by them. This tool is part of the Codacy suite for
832analysing code quality.")
833 (license license:expat)))
63f76ab2
JL
834
835(define-public python-httmock
836 (package
837 (name "python-httmock")
838 (version "1.3.0")
839 (source
840 (origin
841 (method url-fetch)
842 (uri (pypi-uri "httmock" version))
843 (sha256
844 (base32
845 "1zj1fcm0n6f0wr9mr0hmlqz9430fnr5cdwd5jkcvq9j44bnsrfz0"))))
846 (build-system python-build-system)
847 (arguments
848 `(#:tests? #f)); no tests
849 (propagated-inputs
850 `(("python-requests" ,python-requests)))
851 (home-page "https://github.com/patrys/httmock")
852 (synopsis "Mocking library for requests.")
853 (description "This package provides a library for replying fake data to
854Python software under test, when they make an HTTP query.")
855 (license license:asl2.0)))
a8f9b938
EF
856
857(define-public python-atpublic
858 (package
859 (name "python-atpublic")
860 (version "1.0")
861 (source
862 (origin
863 (method url-fetch)
864 (uri (pypi-uri "atpublic" version))
865 (sha256
866 (base32
867 "0i3sbxkdlbb4560rrlmwwd5y4ps7k73lp4d8wnmd7ag9k426gjkx"))))
868 (build-system python-build-system)
869 (arguments
870 '(#:phases
871 (modify-phases %standard-phases
872 (add-before 'build 'enable-c-implementation
873 (lambda _
874 (setenv "ATPUBLIC_BUILD_EXTENSION" "yes")
875 #t))
876 (replace 'check
877 (lambda _
878 (invoke "python" "-m" "nose2" "-v"))))))
879 (native-inputs
880 `(("python-nose2" ,python-nose2)))
881 (home-page "https://public.readthedocs.io/")
882 (synopsis "@code{@@public} decorator for populating @code{__all__}")
883 (description
884 "This Python module adds a @code{@@public} decorator and function which
885populates a module's @code{__all__} and optionally the module globals. With
886it, the declaration of a name's public export semantics are not separated from
887the implementation of that name.")
888 (license (list license:asl2.0
889 license:lgpl3)))) ; only for setup_helpers.py
f755bb01
TLC
890
891(define-public python-mypy-extensions
892 (package
893 (name "python-mypy-extensions")
894 (version "0.4.3")
895 (source
896 (origin
897 (method url-fetch)
898 (uri (pypi-uri "mypy_extensions" version))
899 (sha256
900 (base32
901 "1a04qsk8hd1lqns8w1j7cr0vmvbhg450di5k1i16kqxkbf7q30id"))))
902 (build-system python-build-system)
903 (arguments `(#:tests? #f)); no tests
904 (home-page "https://github.com/python/mypy_extensions")
905 (synopsis "Experimental extensions for MyPy")
906 (description "The @code{python-mypy-extensions} module defines
907experimental extensions to the standard @code{typing} module that are
908supported by the MyPy typechecker.")
909 (license license:expat)))
4fae4f9a
TLC
910
911(define-public python-mypy
912 (package
913 (name "python-mypy")
914 (version "0.782")
915 (source
916 (origin
917 (method url-fetch)
918 (uri (pypi-uri "mypy" version))
919 (sha256
920 (base32
921 "030kn709515452n6gy2i1d9fg6fyrkmdz228lfpmbslybsld9xzg"))))
922 (build-system python-build-system)
923 (arguments
924 `(#:phases
925 (modify-phases %standard-phases
926 (replace 'check
927 (lambda _
928 (invoke "./runtests.py")
929 #t)))))
930 (native-inputs
931 `(("python-attrs" ,python-attrs)
932 ("python-flake8" ,python-flake8)
933 ("python-flake8-bugbear" ,python-flake8-bugbear)
934 ("python-flake8-pyi" ,python-flake8-pyi)
935 ("python-importlib-metadata" ,python-importlib-metadata)
936 ("python-lxml" ,python-lxml)
937 ("python-psutil" ,python-psutil)
938 ("python-py" ,python-py)
939 ("python-pytest" ,python-pytest)
940 ("python-pytest-cov" ,python-pytest-cov)
941 ("python-pytest-forked" ,python-pytest-forked)
942 ("python-pytest-xdist" ,python-pytest-xdist)
943 ("python-virtualenv" ,python-virtualenv)))
944 (propagated-inputs
945 `(("python-mypy-extensions" ,python-mypy-extensions)
946 ("python-typing-extensions" ,python-typing-extensions)
947 ("python-typed-ast" ,python-typed-ast)))
948 (home-page "http://www.mypy-lang.org/")
949 (synopsis "Static type checker for Python")
950 (description "Mypy is an optional static type checker for Python that aims
951to combine the benefits of dynamic (or 'duck') typing and static typing. Mypy combines
952the expressive power and convenience of Python with a powerful type system and
953compile-time type checking. Mypy type checks standard Python programs; run them using
954any Python VM with basically no runtime overhead.")
955 ;; Most of the code is under MIT license; Some files are under Python Software
956 ;; Foundation License version 2: stdlib-samples/*, mypyc/lib-rt/pythonsupport.h and
957 ;; mypyc/lib-rt/getargs.c
958 (license (list license:expat license:psfl))))