Commit | Line | Data |
---|---|---|
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> |
9569db37 | 4 | ;;; Copyright © 2019 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> |
e253b94d RW |
8 | ;;; |
9 | ;;; This file is part of GNU Guix. | |
10 | ;;; | |
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. | |
15 | ;;; | |
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. | |
20 | ;;; | |
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/>. | |
23 | ||
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) | |
9569db37 | 29 | #:use-module (gnu packages web) |
e253b94d RW |
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)) | |
35 | ||
36 | (define-public python-coveralls | |
37 | (package | |
38 | (name "python-coveralls") | |
5bcb2f0f | 39 | (version "1.6.0") |
e253b94d RW |
40 | (source |
41 | (origin | |
42 | (method url-fetch) | |
43 | (uri (pypi-uri "coveralls" version)) | |
44 | (sha256 | |
45 | (base32 | |
5bcb2f0f | 46 | "1dswhd2q2412wrldi97hdwlsymj9pm79v7pvjx53z5wh2d33w8bg")))) |
e253b94d RW |
47 | (build-system python-build-system) |
48 | (propagated-inputs | |
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))) | |
55 | (native-inputs | |
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") | |
60 | (description | |
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))) | |
9569db37 EF |
65 | |
66 | (define-public python-vcrpy | |
67 | (package | |
68 | (name "python-vcrpy") | |
69 | (version "2.0.1") | |
70 | (source | |
71 | (origin | |
72 | (method url-fetch) | |
73 | (uri (pypi-uri "vcrpy" version)) | |
74 | (sha256 | |
75 | (base32 | |
76 | "0kws7l3hci1dvjv01nxw3805q9v2mwldw58bgl8s90wqism69gjp")))) | |
77 | (build-system python-build-system) | |
78 | (arguments `(#:tests? #f)) ; tests require more packages for python-pytest-httpbin | |
79 | (propagated-inputs | |
80 | `(("python-pyyaml" ,python-pyyaml) | |
81 | ("python-six" ,python-six) | |
82 | ("python-wrapt" ,python-wrapt) | |
83 | ("python-yarl" ,python-yarl))) | |
84 | (native-inputs | |
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") | |
90 | (description | |
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: | |
101 | @enumerate | |
102 | @item The ability to work offline | |
103 | @item Completely deterministic tests | |
104 | @item Increased test execution speed | |
105 | @end enumerate | |
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))) | |
85bf6798 RW |
111 | |
112 | (define-public python-pytest-checkdocs | |
113 | (package | |
114 | (name "python-pytest-checkdocs") | |
4d755996 | 115 | (version "1.2.2") |
85bf6798 RW |
116 | (source |
117 | (origin | |
118 | (method url-fetch) | |
119 | (uri (pypi-uri "pytest-checkdocs" version)) | |
120 | (sha256 | |
4d755996 | 121 | (base32 "0j6j1gvj6x451y3qsx4xbaq9p1w9gg3mwk7n0w80cy8vdyjkngb0")))) |
85bf6798 RW |
122 | (build-system python-build-system) |
123 | (propagated-inputs | |
59fa08d6 MB |
124 | `(("python-docutils" ,python-docutils) |
125 | ("python-importlib-metadata" ,python-importlib-metadata) | |
4d755996 | 126 | ("python-more-itertools" ,python-more-itertools))) |
85bf6798 RW |
127 | (native-inputs |
128 | `(("python-setuptools-scm" ,python-setuptools-scm))) | |
129 | (home-page "https://github.com/jaraco/pytest-checkdocs") | |
130 | (synopsis "Check the README when running tests") | |
131 | (description | |
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))) | |
3b89476b RW |
135 | |
136 | (define-public python-pytest-flake8 | |
137 | (package | |
138 | (name "python-pytest-flake8") | |
139 | (version "1.0.4") | |
140 | (source | |
141 | (origin | |
142 | (method url-fetch) | |
143 | (uri (pypi-uri "pytest-flake8" version)) | |
144 | (sha256 | |
145 | (base32 | |
146 | "1h30gd21fjsafqxwclf25sdh89vrdz7rsh4lzw11aiw7ww9mq8jd")))) | |
147 | (build-system python-build-system) | |
148 | (propagated-inputs | |
149 | `(("python-flake8" ,python-flake8))) | |
150 | (native-inputs | |
151 | `(("python-pytest" ,python-pytest))) | |
152 | (home-page "https://github.com/tholo/pytest-flake8") | |
153 | (synopsis "Pytest plugin to check FLAKE8 requirements") | |
154 | (description | |
155 | "This package provides a pytest plugin for efficiently checking PEP8 | |
156 | compliance.") | |
157 | (license license:bsd-3))) | |
21e2c559 | 158 | |
c1ff9072 HG |
159 | (define-public python-pytest-isort |
160 | (package | |
161 | (name "python-pytest-isort") | |
162 | (version "0.3.1") | |
163 | (source | |
164 | (origin | |
165 | (method url-fetch) | |
166 | (uri (pypi-uri "pytest-isort" version)) | |
167 | (sha256 | |
168 | (base32 "06myn5hhxs5yp8dqr1yjsgcnnxnsrvsqannm00bvaw0qml6ydzjb")))) | |
169 | (build-system python-build-system) | |
170 | (arguments | |
171 | `(#:phases | |
172 | (modify-phases %standard-phases | |
173 | (replace 'check | |
174 | (lambda _ | |
175 | (setenv "PYTHONPATH" | |
176 | (string-append (getcwd) ":" | |
177 | (getenv "PYTHONPATH"))) | |
178 | (invoke "pytest")))))) | |
179 | (propagated-inputs | |
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") | |
184 | (description | |
185 | "This package provides a pytest plugin to check import ordering using | |
186 | isort.") | |
187 | (license license:bsd-3))) | |
188 | ||
21e2c559 RW |
189 | (define-public python-pytest-shutil |
190 | (package | |
191 | (name "python-pytest-shutil") | |
192 | (version "1.7.0") | |
193 | (source | |
194 | (origin | |
195 | (method url-fetch) | |
196 | (uri (pypi-uri "pytest-shutil" version)) | |
197 | (sha256 | |
198 | (base32 | |
199 | "0q8j0ayzmnvlraml6i977ybdq4xi096djhf30n2m1rvnvrhm45nq")))) | |
200 | (build-system python-build-system) | |
201 | (arguments | |
202 | `(#:phases | |
203 | (modify-phases %standard-phases | |
204 | (add-after 'unpack 'patch-tests | |
205 | (lambda _ | |
206 | (mkdir "/tmp/bin") | |
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')")) | |
212 | #t))))) | |
213 | (propagated-inputs | |
214 | `(("python-contextlib2" ,python-contextlib2) | |
215 | ("python-execnet" ,python-execnet) | |
216 | ("python-pathpy" ,python-pathpy) | |
217 | ("python-termcolor" ,python-termcolor))) | |
218 | (native-inputs | |
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") | |
224 | (description | |
225 | "This package provides assorted shell and environment tools for the | |
226 | py.test testing framework.") | |
227 | (license license:expat))) | |
7d5ffecb RW |
228 | |
229 | (define-public python-pytest-fixture-config | |
230 | (package | |
231 | (name "python-pytest-fixture-config") | |
232 | (version "1.7.0") | |
233 | (source | |
234 | (origin | |
235 | (method url-fetch) | |
236 | (uri (pypi-uri "pytest-fixture-config" version)) | |
237 | (sha256 | |
238 | (base32 | |
239 | "13i1qpz22w3x4dmw8vih5jdnbqfqvl7jiqs0dg764s0zf8bp98a1")))) | |
240 | (build-system python-build-system) | |
241 | (native-inputs | |
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") | |
246 | (description | |
247 | "This package provides fixture configuration utilities for the py.test | |
248 | testing framework.") | |
249 | (license license:expat))) | |
05b3dcbe RW |
250 | |
251 | (define-public python-pytest-virtualenv | |
252 | (package | |
253 | (name "python-pytest-virtualenv") | |
254 | (version "1.7.0") | |
255 | (source | |
256 | (origin | |
257 | (method url-fetch) | |
258 | (uri (pypi-uri "pytest-virtualenv" version)) | |
259 | (sha256 | |
260 | (base32 | |
261 | "03w2zz3crblj1p6i8nq17946hbn3zqp9z7cfnifw47hi4a4fww12")))) | |
262 | (build-system python-build-system) | |
e2fb29b7 MC |
263 | (arguments |
264 | `(#:phases | |
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 | |
273 | "/bin/virtualenv"))) | |
274 | (substitute* "pytest_virtualenv.py" | |
275 | (("^DEFAULT_VIRTUALENV_FIXTURE_EXECUTABLE.*$") | |
276 | (format #f "DEFAULT_VIRTUALENV_FIXTURE_EXECUTABLE = '~a'" | |
277 | virtualenv-bin))) | |
278 | #t)))))) | |
05b3dcbe | 279 | (propagated-inputs |
e2fb29b7 | 280 | `(("python-pytest-shutil" ,python-pytest-shutil) |
05b3dcbe | 281 | ("python-pytest-fixture-config" ,python-pytest-fixture-config))) |
e2fb29b7 MC |
282 | (inputs |
283 | `(("python-virtualenv" ,python-virtualenv))) | |
05b3dcbe RW |
284 | (native-inputs |
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 | |
291 | framework.") | |
292 | (license license:expat))) | |
9532c0bb JL |
293 | |
294 | (define-public python-codacy-coverage | |
295 | (package | |
296 | (name "python-codacy-coverage") | |
297 | (version "1.3.11") | |
298 | (source | |
299 | (origin | |
300 | (method url-fetch) | |
301 | (uri (pypi-uri "codacy-coverage" version)) | |
302 | (sha256 | |
303 | (base32 | |
304 | "1g0c0w56xdkmqb8slacyw5qhzrkp814ng3ddh2lkiij58y9m2imr")))) | |
305 | (build-system python-build-system) | |
306 | (arguments | |
307 | `(#:tests? #f)); no tests | |
308 | (propagated-inputs | |
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))) | |
63f76ab2 JL |
316 | |
317 | (define-public python-httmock | |
318 | (package | |
319 | (name "python-httmock") | |
320 | (version "1.3.0") | |
321 | (source | |
322 | (origin | |
323 | (method url-fetch) | |
324 | (uri (pypi-uri "httmock" version)) | |
325 | (sha256 | |
326 | (base32 | |
327 | "1zj1fcm0n6f0wr9mr0hmlqz9430fnr5cdwd5jkcvq9j44bnsrfz0")))) | |
328 | (build-system python-build-system) | |
329 | (arguments | |
330 | `(#:tests? #f)); no tests | |
331 | (propagated-inputs | |
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))) |