gnu: r-zoo: Update to 1.8-7.
[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 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 ;;;
8 ;;; This file is part of GNU Guix.
9 ;;;
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.
14 ;;;
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.
19 ;;;
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/>.
22
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))
34
35 (define-public python-coveralls
36 (package
37 (name "python-coveralls")
38 (version "1.6.0")
39 (source
40 (origin
41 (method url-fetch)
42 (uri (pypi-uri "coveralls" version))
43 (sha256
44 (base32
45 "1dswhd2q2412wrldi97hdwlsymj9pm79v7pvjx53z5wh2d33w8bg"))))
46 (build-system python-build-system)
47 (propagated-inputs
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)))
54 (native-inputs
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")
59 (description
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)))
64
65 (define-public python-vcrpy
66 (package
67 (name "python-vcrpy")
68 (version "2.0.1")
69 (source
70 (origin
71 (method url-fetch)
72 (uri (pypi-uri "vcrpy" version))
73 (sha256
74 (base32
75 "0kws7l3hci1dvjv01nxw3805q9v2mwldw58bgl8s90wqism69gjp"))))
76 (build-system python-build-system)
77 (arguments `(#:tests? #f)) ; tests require more packages for python-pytest-httpbin
78 (propagated-inputs
79 `(("python-pyyaml" ,python-pyyaml)
80 ("python-six" ,python-six)
81 ("python-wrapt" ,python-wrapt)
82 ("python-yarl" ,python-yarl)))
83 (native-inputs
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")
89 (description
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:
100 @enumerate
101 @item The ability to work offline
102 @item Completely deterministic tests
103 @item Increased test execution speed
104 @end enumerate
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)))
110
111 (define-public python-pytest-checkdocs
112 (package
113 (name "python-pytest-checkdocs")
114 (version "1.2.2")
115 (source
116 (origin
117 (method url-fetch)
118 (uri (pypi-uri "pytest-checkdocs" version))
119 (sha256
120 (base32 "0j6j1gvj6x451y3qsx4xbaq9p1w9gg3mwk7n0w80cy8vdyjkngb0"))))
121 (build-system python-build-system)
122 (propagated-inputs
123 `(("python-docutils" ,python-docutils)
124 ("python-importlib-metadata" ,python-importlib-metadata)
125 ("python-more-itertools" ,python-more-itertools)))
126 (native-inputs
127 `(("python-setuptools-scm" ,python-setuptools-scm)))
128 (home-page "https://github.com/jaraco/pytest-checkdocs")
129 (synopsis "Check the README when running tests")
130 (description
131 "This package provides a pytest plugin that checks the long description
132 of the project to ensure it renders properly.")
133 (license license:expat)))
134
135 (define-public python-pytest-flake8
136 (package
137 (name "python-pytest-flake8")
138 (version "1.0.4")
139 (source
140 (origin
141 (method url-fetch)
142 (uri (pypi-uri "pytest-flake8" version))
143 (sha256
144 (base32
145 "1h30gd21fjsafqxwclf25sdh89vrdz7rsh4lzw11aiw7ww9mq8jd"))))
146 (build-system python-build-system)
147 (propagated-inputs
148 `(("python-flake8" ,python-flake8)))
149 (native-inputs
150 `(("python-pytest" ,python-pytest)))
151 (home-page "https://github.com/tholo/pytest-flake8")
152 (synopsis "Pytest plugin to check FLAKE8 requirements")
153 (description
154 "This package provides a pytest plugin for efficiently checking PEP8
155 compliance.")
156 (license license:bsd-3)))
157
158 (define-public python-pytest-isort
159 (package
160 (name "python-pytest-isort")
161 (version "0.3.1")
162 (source
163 (origin
164 (method url-fetch)
165 (uri (pypi-uri "pytest-isort" version))
166 (sha256
167 (base32 "06myn5hhxs5yp8dqr1yjsgcnnxnsrvsqannm00bvaw0qml6ydzjb"))))
168 (build-system python-build-system)
169 (arguments
170 `(#:phases
171 (modify-phases %standard-phases
172 (replace 'check
173 (lambda _
174 (setenv "PYTHONPATH"
175 (string-append (getcwd) ":"
176 (getenv "PYTHONPATH")))
177 (invoke "pytest"))))))
178 (propagated-inputs
179 `(("python-isort" ,python-isort)
180 ("python-pytest" ,python-pytest)))
181 (home-page "https://github.com/moccu/pytest-isort/")
182 (synopsis "Pytest plugin to check import ordering using isort")
183 (description
184 "This package provides a pytest plugin to check import ordering using
185 isort.")
186 (license license:bsd-3)))
187
188 (define-public python-pytest-shutil
189 (package
190 (name "python-pytest-shutil")
191 (version "1.7.0")
192 (source
193 (origin
194 (method url-fetch)
195 (uri (pypi-uri "pytest-shutil" version))
196 (sha256
197 (base32
198 "0q8j0ayzmnvlraml6i977ybdq4xi096djhf30n2m1rvnvrhm45nq"))))
199 (build-system python-build-system)
200 (arguments
201 `(#:phases
202 (modify-phases %standard-phases
203 (add-after 'unpack 'patch-tests
204 (lambda _
205 (mkdir "/tmp/bin")
206 (substitute* "tests/integration/test_cmdline_integration.py"
207 (("dirname = '/bin'")
208 "dirname = '/tmp/bin'")
209 (("bindir = os.path.realpath\\('/bin'\\)")
210 "bindir = os.path.realpath('/tmp/bin')"))
211 #t)))))
212 (propagated-inputs
213 `(("python-contextlib2" ,python-contextlib2)
214 ("python-execnet" ,python-execnet)
215 ("python-pathpy" ,python-pathpy)
216 ("python-termcolor" ,python-termcolor)))
217 (native-inputs
218 `(("python-mock" ,python-mock)
219 ("python-pytest" ,python-pytest)
220 ("python-setuptools-git" ,python-setuptools-git)))
221 (home-page "https://github.com/manahl/pytest-plugins")
222 (synopsis "Assorted shell and environment tools for py.test")
223 (description
224 "This package provides assorted shell and environment tools for the
225 py.test testing framework.")
226 (license license:expat)))
227
228 (define-public python-pytest-fixture-config
229 (package
230 (name "python-pytest-fixture-config")
231 (version "1.7.0")
232 (source
233 (origin
234 (method url-fetch)
235 (uri (pypi-uri "pytest-fixture-config" version))
236 (sha256
237 (base32
238 "13i1qpz22w3x4dmw8vih5jdnbqfqvl7jiqs0dg764s0zf8bp98a1"))))
239 (build-system python-build-system)
240 (native-inputs
241 `(("python-pytest" ,python-pytest)
242 ("python-setuptools-git" ,python-setuptools-git)))
243 (home-page "https://github.com/manahl/pytest-plugins")
244 (synopsis "Fixture configuration utils for py.test")
245 (description
246 "This package provides fixture configuration utilities for the py.test
247 testing framework.")
248 (license license:expat)))
249
250 (define-public python-pytest-virtualenv
251 (package
252 (name "python-pytest-virtualenv")
253 (version "1.7.0")
254 (source
255 (origin
256 (method url-fetch)
257 (uri (pypi-uri "pytest-virtualenv" version))
258 (sha256
259 (base32
260 "03w2zz3crblj1p6i8nq17946hbn3zqp9z7cfnifw47hi4a4fww12"))))
261 (build-system python-build-system)
262 (arguments
263 `(#:phases
264 (modify-phases %standard-phases
265 ;; Reference the virtualenv executable directly, to avoid the need
266 ;; for PYTHONPATH, which gets cleared when instantiating a new
267 ;; virtualenv with pytest-virtualenv.
268 (add-after 'unpack 'patch-virtualenv-executable
269 (lambda* (#:key inputs #:allow-other-keys)
270 (let* ((virtualenv (assoc-ref inputs "python-virtualenv"))
271 (virtualenv-bin (string-append virtualenv
272 "/bin/virtualenv")))
273 (substitute* "pytest_virtualenv.py"
274 (("^DEFAULT_VIRTUALENV_FIXTURE_EXECUTABLE.*$")
275 (format #f "DEFAULT_VIRTUALENV_FIXTURE_EXECUTABLE = '~a'"
276 virtualenv-bin)))
277 #t))))))
278 (propagated-inputs
279 `(("python-pytest-shutil" ,python-pytest-shutil)
280 ("python-pytest-fixture-config" ,python-pytest-fixture-config)))
281 (inputs
282 `(("python-virtualenv" ,python-virtualenv)))
283 (native-inputs
284 `(("python-mock" ,python-mock)
285 ("python-pytest" ,python-pytest)
286 ("python-setuptools-git" ,python-setuptools-git)))
287 (home-page "https://github.com/manahl/pytest-plugins")
288 (synopsis "Virtualenv fixture for py.test")
289 (description "This package provides a virtualenv fixture for the py.test
290 framework.")
291 (license license:expat)))