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>
8 ;;; This file is part of GNU Guix.
10 ;;; GNU Guix is free software; you can redistribute it and/or modify it
11 ;;; under the terms of the GNU General Public License as published by
12 ;;; the Free Software Foundation; either version 3 of the License, or (at
13 ;;; your option) any later version.
15 ;;; GNU Guix is distributed in the hope that it will be useful, but
16 ;;; WITHOUT ANY WARRANTY; without even the implied warranty of
17 ;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18 ;;; GNU General Public License for more details.
20 ;;; You should have received a copy of the GNU General Public License
21 ;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>.
23 (define-module (gnu packages python-check)
24 #:use-module (gnu packages)
25 #:use-module (gnu packages check)
26 #:use-module (gnu packages python-web)
27 #:use-module (gnu packages python-xyz)
28 #:use-module (gnu packages web)
29 #:use-module (guix utils)
30 #:use-module ((guix licenses) #:prefix license:)
31 #:use-module (guix packages)
32 #:use-module (guix download)
33 #:use-module (guix build-system python))
35 (define-public python-coveralls
37 (name "python-coveralls")
42 (uri (pypi-uri "coveralls" version))
45 "1dswhd2q2412wrldi97hdwlsymj9pm79v7pvjx53z5wh2d33w8bg"))))
46 (build-system python-build-system)
48 `(("python-coverage" ,python-coverage)
49 ("python-docopt" ,python-docopt)
50 ("python-pyyaml" ,python-pyyaml)
51 ("python-requests" ,python-requests)
52 ("python-sh" ,python-sh)
53 ("python-urllib3" ,python-urllib3)))
55 `(("python-mock" ,python-mock)
56 ("python-pytest" ,python-pytest)))
57 (home-page "https://github.com/coveralls-clients/coveralls-python")
58 (synopsis "Show coverage stats online via coveralls.io")
60 "Coveralls.io is a service for publishing code coverage statistics online.
61 This package provides seamless integration with coverage.py (and thus pytest,
62 nosetests, etc...) in Python projects.")
63 (license license:expat)))
65 (define-public python-vcrpy
72 (uri (pypi-uri "vcrpy" version))
75 "0kws7l3hci1dvjv01nxw3805q9v2mwldw58bgl8s90wqism69gjp"))))
76 (build-system python-build-system)
77 (arguments `(#:tests? #f)) ; tests require more packages for python-pytest-httpbin
79 `(("python-pyyaml" ,python-pyyaml)
80 ("python-six" ,python-six)
81 ("python-wrapt" ,python-wrapt)
82 ("python-yarl" ,python-yarl)))
84 `(("python-mock" ,python-mock)
85 ("python-pytest" ,python-pytest)
86 ("python-pytest-httpbin" ,python-pytest-httpbin)))
87 (home-page "https://github.com/kevin1024/vcrpy")
88 (synopsis "Automatically mock your HTTP interactions")
90 "VCR.py simplifies and speeds up tests that make HTTP requests. The first
91 time you run code that is inside a VCR.py context manager or decorated function,
92 VCR.py records all HTTP interactions that take place through the libraries it
93 supports and serializes and writes them to a flat file (in yaml format by
94 default). This flat file is called a cassette. When the relevant piece of code
95 is executed again, VCR.py will read the serialized requests and responses from
96 the aforementioned cassette file, and intercept any HTTP requests that it
97 recognizes from the original test run and return the responses that corresponded
98 to those requests. This means that the requests will not actually result in
99 HTTP traffic, which confers several benefits including:
101 @item The ability to work offline
102 @item Completely deterministic tests
103 @item Increased test execution speed
105 If the server you are testing against ever changes its API, all you need to do
106 is delete your existing cassette files, and run your tests again. VCR.py will
107 detect the absence of a cassette file and once again record all HTTP
108 interactions, which will update them to correspond to the new API.")
109 (license license:expat)))
111 (define-public python-pytest-checkdocs
113 (name "python-pytest-checkdocs")
118 (uri (pypi-uri "pytest-checkdocs" version))
120 (base32 "0j6j1gvj6x451y3qsx4xbaq9p1w9gg3mwk7n0w80cy8vdyjkngb0"))))
121 (build-system python-build-system)
123 `(("python-importlib-metadata" ,python-importlib-metadata)
124 ("python-more-itertools" ,python-more-itertools)))
126 `(("python-setuptools-scm" ,python-setuptools-scm)))
127 (home-page "https://github.com/jaraco/pytest-checkdocs")
128 (synopsis "Check the README when running tests")
130 "This package provides a pytest plugin that checks the long description
131 of the project to ensure it renders properly.")
132 (license license:expat)))
134 (define-public python-pytest-flake8
136 (name "python-pytest-flake8")
141 (uri (pypi-uri "pytest-flake8" version))
144 "1h30gd21fjsafqxwclf25sdh89vrdz7rsh4lzw11aiw7ww9mq8jd"))))
145 (build-system python-build-system)
147 `(("python-flake8" ,python-flake8)))
149 `(("python-pytest" ,python-pytest)))
150 (home-page "https://github.com/tholo/pytest-flake8")
151 (synopsis "Pytest plugin to check FLAKE8 requirements")
153 "This package provides a pytest plugin for efficiently checking PEP8
155 (license license:bsd-3)))
157 (define-public python-pytest-isort
159 (name "python-pytest-isort")
164 (uri (pypi-uri "pytest-isort" version))
166 (base32 "06myn5hhxs5yp8dqr1yjsgcnnxnsrvsqannm00bvaw0qml6ydzjb"))))
167 (build-system python-build-system)
170 (modify-phases %standard-phases
174 (string-append (getcwd) ":"
175 (getenv "PYTHONPATH")))
176 (invoke "pytest"))))))
178 `(("python-isort" ,python-isort)
179 ("python-pytest" ,python-pytest)))
180 (home-page "https://github.com/moccu/pytest-isort/")
181 (synopsis "Pytest plugin to check import ordering using isort")
183 "This package provides a pytest plugin to check import ordering using
185 (license license:bsd-3)))
187 (define-public python-pytest-shutil
189 (name "python-pytest-shutil")
194 (uri (pypi-uri "pytest-shutil" version))
197 "0q8j0ayzmnvlraml6i977ybdq4xi096djhf30n2m1rvnvrhm45nq"))))
198 (build-system python-build-system)
201 (modify-phases %standard-phases
202 (add-after 'unpack 'patch-tests
205 (substitute* "tests/integration/test_cmdline_integration.py"
206 (("dirname = '/bin'")
207 "dirname = '/tmp/bin'")
208 (("bindir = os.path.realpath\\('/bin'\\)")
209 "bindir = os.path.realpath('/tmp/bin')"))
212 `(("python-contextlib2" ,python-contextlib2)
213 ("python-execnet" ,python-execnet)
214 ("python-pathpy" ,python-pathpy)
215 ("python-termcolor" ,python-termcolor)))
217 `(("python-mock" ,python-mock)
218 ("python-pytest" ,python-pytest)
219 ("python-setuptools-git" ,python-setuptools-git)))
220 (home-page "https://github.com/manahl/pytest-plugins")
221 (synopsis "Assorted shell and environment tools for py.test")
223 "This package provides assorted shell and environment tools for the
224 py.test testing framework.")
225 (license license:expat)))
227 (define-public python-pytest-fixture-config
229 (name "python-pytest-fixture-config")
234 (uri (pypi-uri "pytest-fixture-config" version))
237 "13i1qpz22w3x4dmw8vih5jdnbqfqvl7jiqs0dg764s0zf8bp98a1"))))
238 (build-system python-build-system)
240 `(("python-pytest" ,python-pytest)
241 ("python-setuptools-git" ,python-setuptools-git)))
242 (home-page "https://github.com/manahl/pytest-plugins")
243 (synopsis "Fixture configuration utils for py.test")
245 "This package provides fixture configuration utilities for the py.test
247 (license license:expat)))
249 (define-public python-pytest-virtualenv
251 (name "python-pytest-virtualenv")
256 (uri (pypi-uri "pytest-virtualenv" version))
259 "03w2zz3crblj1p6i8nq17946hbn3zqp9z7cfnifw47hi4a4fww12"))))
260 (build-system python-build-system)
263 (modify-phases %standard-phases
264 ;; Reference the virtualenv executable directly, to avoid the need
265 ;; for PYTHONPATH, which gets cleared when instantiating a new
266 ;; virtualenv with pytest-virtualenv.
267 (add-after 'unpack 'patch-virtualenv-executable
268 (lambda* (#:key inputs #:allow-other-keys)
269 (let* ((virtualenv (assoc-ref inputs "python-virtualenv"))
270 (virtualenv-bin (string-append virtualenv
272 (substitute* "pytest_virtualenv.py"
273 (("^DEFAULT_VIRTUALENV_FIXTURE_EXECUTABLE.*$")
274 (format #f "DEFAULT_VIRTUALENV_FIXTURE_EXECUTABLE = '~a'"
278 `(("python-pytest-shutil" ,python-pytest-shutil)
279 ("python-pytest-fixture-config" ,python-pytest-fixture-config)))
281 `(("python-virtualenv" ,python-virtualenv)))
283 `(("python-mock" ,python-mock)
284 ("python-pytest" ,python-pytest)
285 ("python-setuptools-git" ,python-setuptools-git)))
286 (home-page "https://github.com/manahl/pytest-plugins")
287 (synopsis "Virtualenv fixture for py.test")
288 (description "This package provides a virtualenv fixture for the py.test
290 (license license:expat)))