me
/
guix
Archived
1
0
Fork 0

gnu: python-uvloop: Update to 0.16.0.

Version 0.14.0 is not compatible with Python 3.9[1]. Additionally unvendor the
copy of libuv, which was unused, but retained in the source tarball,
fix subprocess spawning and enable tests, so we know when future updates
break it.

[1] https://github.com/MagicStack/uvloop/issues/349

* gnu/packages/python-web.scm (python-uvloop): Update to 0.16.0.
[source]: Add snippet to remove pre-built loop.c and vendored libuv.
[arguments]<#:phases>: Substitute /bin/sh in 'preparations phase, override
'check phase and disable failing tests.
[native-inputs]: Remove python-flake8, because it causes test failures
and add python-pytest-timeout.
master
Lars-Dominik Braun 2022-01-25 11:00:19 +01:00
parent f3655d32a4
commit 605cb7b4be
No known key found for this signature in database
GPG Key ID: F663943E08D8092A
1 changed files with 32 additions and 7 deletions

View File

@ -4602,31 +4602,56 @@ hard or impossible to fix in cssselect.")
(define-public python-uvloop (define-public python-uvloop
(package (package
(name "python-uvloop") (name "python-uvloop")
(version "0.14.0") (version "0.16.0")
(source (source
(origin (origin
(method url-fetch) (method url-fetch)
(uri (pypi-uri "uvloop" version)) (uri (pypi-uri "uvloop" version))
(sha256 (sha256
(base32 "07j678z9gf41j98w72ysrnb5sa41pl5yxd7ib17lcwfxqz0cjfhj")))) (base32 "0a0jzwrhkszknh14alflrp1db6dyjp7ph730f9yc5lb7gc6c4jzp"))
(modules '((guix build utils)))
(snippet
'(begin (delete-file-recursively "vendor")
(delete-file "uvloop/loop.c")))))
(build-system python-build-system) (build-system python-build-system)
(arguments (arguments
'(#:tests? #f ;FIXME: tests hang and with some errors in the way `(#:phases
#:phases
(modify-phases %standard-phases (modify-phases %standard-phases
(add-after 'unpack 'preparations (add-after 'unpack 'preparations
(lambda _ (lambda _
;; Use packaged libuv. ;; Use packaged libuv.
(substitute* "setup.py" (("self.use_system_libuv = False") (substitute* "setup.py" (("self.use_system_libuv = False")
"self.use_system_libuv = True")) "self.use_system_libuv = True"))
#t))))) ;; Replace hardcoded shell command.
(substitute* "uvloop/loop.pyx"
(("b'/bin/sh'") (string-append "b'" (which "sh") "'")))
#t))
(replace 'check
(lambda* (#:key tests? #:allow-other-keys)
(when tests?
;; Remove Python module, which conflicts with the installed version,
;; but lacks the built C module.
(delete-file-recursively "uvloop")
;; The tests are prone to get stuck. Use pytest-timeouts --timeout
;; flag to get a meaningful idea about where.
(invoke "pytest" "-vv" "--timeout=300"
"-k" ,(string-append
;; Timeout, because SIGINT cannot be sent to child.
"not test_signals_sigint_pycode_continue "
"and not test_signals_sigint_pycode_stop "
"and not test_signals_sigint_uvcode "
"and not test_signals_sigint_uvcode_two_loop_runs "
;; It looks like pytest is preventing
;; custom stdout/stderr redirection,
;; even with -s.
"and not test_process_streams_redirect "))))))))
(native-inputs (native-inputs
(list python-aiohttp (list python-aiohttp
python-cython python-cython
python-flake8
python-psutil python-psutil
python-pyopenssl python-pyopenssl
python-twine)) python-pytest
python-pytest-timeout))
(inputs (inputs
(list libuv)) (list libuv))
(home-page "https://github.com/MagicStack/uvloop") (home-page "https://github.com/MagicStack/uvloop")