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 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>
9 ;;; This file is part of GNU Guix.
11 ;;; GNU Guix is free software; you can redistribute it and/or modify it
12 ;;; under the terms of the GNU General Public License as published by
13 ;;; the Free Software Foundation; either version 3 of the License, or (at
14 ;;; your option) any later version.
16 ;;; GNU Guix is distributed in the hope that it will be useful, but
17 ;;; WITHOUT ANY WARRANTY; without even the implied warranty of
18 ;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
19 ;;; GNU General Public License for more details.
21 ;;; You should have received a copy of the GNU General Public License
22 ;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>.
24 (define-module (gnu packages python-check)
25 #:use-module (gnu packages)
26 #:use-module (gnu packages check)
27 #:use-module (gnu packages python-web)
28 #:use-module (gnu packages python-xyz)
29 #:use-module (gnu packages web)
30 #:use-module (guix utils)
31 #:use-module ((guix licenses) #:prefix license:)
32 #:use-module (guix packages)
33 #:use-module (guix download)
34 #:use-module (guix build-system python))
36 (define-public python-coveralls
38 (name "python-coveralls")
43 (uri (pypi-uri "coveralls" version))
46 "1dswhd2q2412wrldi97hdwlsymj9pm79v7pvjx53z5wh2d33w8bg"))))
47 (build-system python-build-system)
49 `(("python-coverage" ,python-coverage)
50 ("python-docopt" ,python-docopt)
51 ("python-pyyaml" ,python-pyyaml)
52 ("python-requests" ,python-requests)
53 ("python-sh" ,python-sh)
54 ("python-urllib3" ,python-urllib3)))
56 `(("python-mock" ,python-mock)
57 ("python-pytest" ,python-pytest)))
58 (home-page "https://github.com/coveralls-clients/coveralls-python")
59 (synopsis "Show coverage stats online via coveralls.io")
61 "Coveralls.io is a service for publishing code coverage statistics online.
62 This package provides seamless integration with coverage.py (and thus pytest,
63 nosetests, etc...) in Python projects.")
64 (license license:expat)))
66 (define-public python-vcrpy
73 (uri (pypi-uri "vcrpy" version))
76 "0kws7l3hci1dvjv01nxw3805q9v2mwldw58bgl8s90wqism69gjp"))))
77 (build-system python-build-system)
78 (arguments `(#:tests? #f)) ; tests require more packages for python-pytest-httpbin
80 `(("python-pyyaml" ,python-pyyaml)
81 ("python-six" ,python-six)
82 ("python-wrapt" ,python-wrapt)
83 ("python-yarl" ,python-yarl)))
85 `(("python-mock" ,python-mock)
86 ("python-pytest" ,python-pytest)
87 ("python-pytest-httpbin" ,python-pytest-httpbin)))
88 (home-page "https://github.com/kevin1024/vcrpy")
89 (synopsis "Automatically mock your HTTP interactions")
91 "VCR.py simplifies and speeds up tests that make HTTP requests. The first
92 time you run code that is inside a VCR.py context manager or decorated function,
93 VCR.py records all HTTP interactions that take place through the libraries it
94 supports and serializes and writes them to a flat file (in yaml format by
95 default). This flat file is called a cassette. When the relevant piece of code
96 is executed again, VCR.py will read the serialized requests and responses from
97 the aforementioned cassette file, and intercept any HTTP requests that it
98 recognizes from the original test run and return the responses that corresponded
99 to those requests. This means that the requests will not actually result in
100 HTTP traffic, which confers several benefits including:
102 @item The ability to work offline
103 @item Completely deterministic tests
104 @item Increased test execution speed
106 If the server you are testing against ever changes its API, all you need to do
107 is delete your existing cassette files, and run your tests again. VCR.py will
108 detect the absence of a cassette file and once again record all HTTP
109 interactions, which will update them to correspond to the new API.")
110 (license license:expat)))
112 (define-public python-pytest-checkdocs
114 (name "python-pytest-checkdocs")
119 (uri (pypi-uri "pytest-checkdocs" version))
121 (base32 "0j6j1gvj6x451y3qsx4xbaq9p1w9gg3mwk7n0w80cy8vdyjkngb0"))))
122 (build-system python-build-system)
124 `(("python-docutils" ,python-docutils)
125 ("python-importlib-metadata" ,python-importlib-metadata)
126 ("python-more-itertools" ,python-more-itertools)))
128 `(("python-setuptools-scm" ,python-setuptools-scm)))
129 (home-page "https://github.com/jaraco/pytest-checkdocs")
130 (synopsis "Check the README when running tests")
132 "This package provides a pytest plugin that checks the long description
133 of the project to ensure it renders properly.")
134 (license license:expat)))
136 (define-public python-pytest-flake8
138 (name "python-pytest-flake8")
143 (uri (pypi-uri "pytest-flake8" version))
146 "1h30gd21fjsafqxwclf25sdh89vrdz7rsh4lzw11aiw7ww9mq8jd"))))
147 (build-system python-build-system)
149 `(("python-flake8" ,python-flake8)))
151 `(("python-pytest" ,python-pytest)))
152 (home-page "https://github.com/tholo/pytest-flake8")
153 (synopsis "Pytest plugin to check FLAKE8 requirements")
155 "This package provides a pytest plugin for efficiently checking PEP8
157 (license license:bsd-3)))
159 (define-public python-pytest-isort
161 (name "python-pytest-isort")
166 (uri (pypi-uri "pytest-isort" version))
168 (base32 "06myn5hhxs5yp8dqr1yjsgcnnxnsrvsqannm00bvaw0qml6ydzjb"))))
169 (build-system python-build-system)
172 (modify-phases %standard-phases
176 (string-append (getcwd) ":"
177 (getenv "PYTHONPATH")))
178 (invoke "pytest"))))))
180 `(("python-isort" ,python-isort)
181 ("python-pytest" ,python-pytest)))
182 (home-page "https://github.com/moccu/pytest-isort/")
183 (synopsis "Pytest plugin to check import ordering using isort")
185 "This package provides a pytest plugin to check import ordering using
187 (license license:bsd-3)))
189 (define-public python-pytest-shutil
191 (name "python-pytest-shutil")
196 (uri (pypi-uri "pytest-shutil" version))
199 "0q8j0ayzmnvlraml6i977ybdq4xi096djhf30n2m1rvnvrhm45nq"))))
200 (build-system python-build-system)
203 (modify-phases %standard-phases
204 (add-after 'unpack 'patch-tests
207 (substitute* "tests/integration/test_cmdline_integration.py"
208 (("dirname = '/bin'")
209 "dirname = '/tmp/bin'")
210 (("bindir = os.path.realpath\\('/bin'\\)")
211 "bindir = os.path.realpath('/tmp/bin')"))
214 `(("python-contextlib2" ,python-contextlib2)
215 ("python-execnet" ,python-execnet)
216 ("python-pathpy" ,python-pathpy)
217 ("python-termcolor" ,python-termcolor)))
219 `(("python-mock" ,python-mock)
220 ("python-pytest" ,python-pytest)
221 ("python-setuptools-git" ,python-setuptools-git)))
222 (home-page "https://github.com/manahl/pytest-plugins")
223 (synopsis "Assorted shell and environment tools for py.test")
225 "This package provides assorted shell and environment tools for the
226 py.test testing framework.")
227 (license license:expat)))
229 (define-public python-pytest-fixture-config
231 (name "python-pytest-fixture-config")
236 (uri (pypi-uri "pytest-fixture-config" version))
239 "13i1qpz22w3x4dmw8vih5jdnbqfqvl7jiqs0dg764s0zf8bp98a1"))))
240 (build-system python-build-system)
242 `(("python-pytest" ,python-pytest)
243 ("python-setuptools-git" ,python-setuptools-git)))
244 (home-page "https://github.com/manahl/pytest-plugins")
245 (synopsis "Fixture configuration utils for py.test")
247 "This package provides fixture configuration utilities for the py.test
249 (license license:expat)))
251 (define-public python-pytest-virtualenv
253 (name "python-pytest-virtualenv")
258 (uri (pypi-uri "pytest-virtualenv" version))
261 "03w2zz3crblj1p6i8nq17946hbn3zqp9z7cfnifw47hi4a4fww12"))))
262 (build-system python-build-system)
265 (modify-phases %standard-phases
266 ;; Reference the virtualenv executable directly, to avoid the need
267 ;; for PYTHONPATH, which gets cleared when instantiating a new
268 ;; virtualenv with pytest-virtualenv.
269 (add-after 'unpack 'patch-virtualenv-executable
270 (lambda* (#:key inputs #:allow-other-keys)
271 (let* ((virtualenv (assoc-ref inputs "python-virtualenv"))
272 (virtualenv-bin (string-append virtualenv
274 (substitute* "pytest_virtualenv.py"
275 (("^DEFAULT_VIRTUALENV_FIXTURE_EXECUTABLE.*$")
276 (format #f "DEFAULT_VIRTUALENV_FIXTURE_EXECUTABLE = '~a'"
280 `(("python-pytest-shutil" ,python-pytest-shutil)
281 ("python-pytest-fixture-config" ,python-pytest-fixture-config)))
283 `(("python-virtualenv" ,python-virtualenv)))
285 `(("python-mock" ,python-mock)
286 ("python-pytest" ,python-pytest)
287 ("python-setuptools-git" ,python-setuptools-git)))
288 (home-page "https://github.com/manahl/pytest-plugins")
289 (synopsis "Virtualenv fixture for py.test")
290 (description "This package provides a virtualenv fixture for the py.test
292 (license license:expat)))
294 (define-public python-codacy-coverage
296 (name "python-codacy-coverage")
301 (uri (pypi-uri "codacy-coverage" version))
304 "1g0c0w56xdkmqb8slacyw5qhzrkp814ng3ddh2lkiij58y9m2imr"))))
305 (build-system python-build-system)
307 `(#:tests? #f)); no tests
309 `(("python-check-manifest" ,python-check-manifest)))
310 (home-page "https://github.com/codacy/python-codacy-coverage")
311 (synopsis "Codacy coverage reporter for Python")
312 (description "This package analyses Python test suites and reports how much
313 of the code is covered by them. This tool is part of the Codacy suite for
314 analysing code quality.")
315 (license license:expat)))
317 (define-public python-httmock
319 (name "python-httmock")
324 (uri (pypi-uri "httmock" version))
327 "1zj1fcm0n6f0wr9mr0hmlqz9430fnr5cdwd5jkcvq9j44bnsrfz0"))))
328 (build-system python-build-system)
330 `(#:tests? #f)); no tests
332 `(("python-requests" ,python-requests)))
333 (home-page "https://github.com/patrys/httmock")
334 (synopsis "Mocking library for requests.")
335 (description "This package provides a library for replying fake data to
336 Python software under test, when they make an HTTP query.")
337 (license license:asl2.0)))