diff options
| author | Efraim Flashner <efraim@flashner.co.il> | 2021-10-26 11:06:23 +0300 |
|---|---|---|
| committer | Efraim Flashner <efraim@flashner.co.il> | 2021-10-27 23:01:32 +0300 |
| commit | dac8d013bd1fc7f57b8ba3582eef6e0e01b23dfd (patch) | |
| tree | 13764f2ec813ea8f26b73335adeca6b2a43a762b | |
| parent | fb995ff5107b9320a3d320a45a61f5dfddafca74 (diff) | |
gnu: python-aiohttp: Remove cythonized files.
* gnu/packages/python-web.scm (python-aiohttp)[source]: Add snippet to
remove generated cythonized files.
[arguments]: Add phase to generate cythonized files.
[native-inputs]: Add python-cython.
| -rw-r--r-- | gnu/packages/python-web.scm | 21 |
1 files changed, 20 insertions, 1 deletions
diff --git a/gnu/packages/python-web.scm b/gnu/packages/python-web.scm index 05b1c99daf4..8783c750374 100644 --- a/gnu/packages/python-web.scm +++ b/gnu/packages/python-web.scm | |||
| @@ -172,7 +172,16 @@ API rules.") | |||
| 172 | (method url-fetch) | 172 | (method url-fetch) |
| 173 | (uri (pypi-uri "aiohttp" version)) | 173 | (uri (pypi-uri "aiohttp" version)) |
| 174 | (sha256 | 174 | (sha256 |
| 175 | (base32 "1pn79h8fng4xi5gl1f6saw31nxgmgyxl41yf3vba1l21673yr12x")))) | 175 | (base32 "1pn79h8fng4xi5gl1f6saw31nxgmgyxl41yf3vba1l21673yr12x")) |
| 176 | (modules '((guix build utils))) | ||
| 177 | (snippet | ||
| 178 | '(begin | ||
| 179 | (for-each delete-file | ||
| 180 | '("aiohttp/_frozenlist.c" | ||
| 181 | "aiohttp/_helpers.c" | ||
| 182 | "aiohttp/_http_parser.c" | ||
| 183 | "aiohttp/_http_writer.c" | ||
| 184 | "aiohttp/_websocket.c")))))) | ||
| 176 | (build-system python-build-system) | 185 | (build-system python-build-system) |
| 177 | (arguments | 186 | (arguments |
| 178 | '(#:phases | 187 | '(#:phases |
| @@ -195,6 +204,15 @@ API rules.") | |||
| 195 | 204 | ||
| 196 | ;; Don't test the aiohttp pytest plugin to avoid a dependency loop. | 205 | ;; Don't test the aiohttp pytest plugin to avoid a dependency loop. |
| 197 | (delete-file "tests/test_pytest_plugin.py"))) | 206 | (delete-file "tests/test_pytest_plugin.py"))) |
| 207 | (add-before 'build 'cythonize | ||
| 208 | (lambda _ | ||
| 209 | ;; Adapted from the Makefile. | ||
| 210 | (with-directory-excursion "aiohttp" | ||
| 211 | (for-each | ||
| 212 | (lambda (file) | ||
| 213 | (invoke "cython" "-3" | ||
| 214 | file "-I" ".")) | ||
| 215 | (find-files "." "_.*\\.pyx$"))))) | ||
| 198 | (replace 'check | 216 | (replace 'check |
| 199 | (lambda* (#:key tests? #:allow-other-keys) | 217 | (lambda* (#:key tests? #:allow-other-keys) |
| 200 | (if tests? | 218 | (if tests? |
| @@ -216,6 +234,7 @@ API rules.") | |||
| 216 | (native-inputs | 234 | (native-inputs |
| 217 | `(("gunicorn" ,gunicorn-bootstrap) | 235 | `(("gunicorn" ,gunicorn-bootstrap) |
| 218 | ("python-async-generator" ,python-async-generator) | 236 | ("python-async-generator" ,python-async-generator) |
| 237 | ("python-cython" ,python-cython) | ||
| 219 | ("python-freezegun" ,python-freezegun) | 238 | ("python-freezegun" ,python-freezegun) |
| 220 | ("python-pytest" ,python-pytest-6.1) | 239 | ("python-pytest" ,python-pytest-6.1) |
| 221 | ("python-pytest-mock" ,python-pytest-mock) | 240 | ("python-pytest-mock" ,python-pytest-mock) |
