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