3
5
Fork 0
mirror of git://git.savannah.gnu.org/guix.git synced 2023-12-14 03:33:07 +01:00

gnu: python-aiohttp: Update to 3.7.3.

* gnu/packages/patches/python-aiohttp-3.6.2-no-warning-fail.patch: Delete file.
* gnu/local.mk (dist_patch_DATA): Adjust accordingly.
* gnu/packages/python-web.scm (python-aiohttp)[source](patches): Remove.
[arguments]: Use UTIME instead of calling out to 'touch'.  Don't delete
now-working tests; but disable some new ones.  Replace the 'check' phase.
[propagated-inputs]: Add PYTHON-TYPING-EXTENSIONS.
[native-inputs]: Remove PYTHON-PYTEST-RUNNER, PYTHON-PYTEST-XDIST,
PYTHON-PYTEST-TIMEOUT, and PYTHON-PYTEST-FORKED.  Add PYTHON-PYTEST and
PYTHON-RE-ASSERT.
This commit is contained in:
Marius Bakke 2020-11-26 18:59:27 +01:00
parent 47f95d3f16
commit 00a85828b0
No known key found for this signature in database
GPG key ID: A2A06DF2A33A54FA
3 changed files with 27 additions and 55 deletions

View file

@ -1511,7 +1511,6 @@ dist_patch_DATA = \
%D%/packages/patches/python-3-fix-tests.patch \
%D%/packages/patches/python-3.8-fix-tests.patch \
%D%/packages/patches/python-CVE-2018-14647.patch \
%D%/packages/patches/python-aiohttp-3.6.2-no-warning-fail.patch \
%D%/packages/patches/python-aionotify-0.2.0-py3.8.patch \
%D%/packages/patches/python-argcomplete-1.11.1-fish31.patch \
%D%/packages/patches/python-axolotl-AES-fix.patch \

View file

@ -1,34 +0,0 @@
Do not fail test on runtime warning like: RuntimeWarning: coroutine 'noop2' was
never awaited. This could be related to
https://github.com/aio-libs/aiohttp/commit/60f01cca36b9f9d8d35dd351384eaae2f8fd0d4b,
which does not fix this issue though.
--- a/aiohttp/pytest_plugin.py 2019-10-09 18:52:31.000000000 +0200
+++ b/aiohttp/pytest_plugin.py 2020-03-05 08:35:48.230396025 +0100
@@ -120,15 +120,6 @@
"""
with warnings.catch_warnings(record=True) as _warnings:
yield
- rw = ['{w.filename}:{w.lineno}:{w.message}'.format(w=w)
- for w in _warnings # type: ignore
- if w.category == RuntimeWarning]
- if rw:
- raise RuntimeError('{} Runtime Warning{},\n{}'.format(
- len(rw),
- '' if len(rw) == 1 else 's',
- '\n'.join(rw)
- ))
@contextlib.contextmanager
--- a/tests/test_pytest_plugin.py 2020-03-05 09:26:58.502284893 +0100
+++ a/tests/test_pytest_plugin.py 2020-03-05 09:27:06.074284619 +0100
@@ -170,7 +170,7 @@
expected_outcomes = (
{'failed': 0, 'passed': 2}
if IS_PYPY and bool(os.environ.get('PYTHONASYNCIODEBUG'))
- else {'failed': 1, 'passed': 1}
+ else {'failed': 0, 'passed': 2}
)
"""Under PyPy "coroutine 'foobar' was never awaited" does not happen."""
result.assert_outcomes(**expected_outcomes)

View file

@ -92,14 +92,13 @@
(define-public python-aiohttp
(package
(name "python-aiohttp")
(version "3.6.3")
(version "3.7.3")
(source
(origin
(method url-fetch)
(uri (pypi-uri "aiohttp" version))
(sha256
(base32 "0i9n7h8n06m2d8ryqyk4fv1si1m44ibq7blbfaxq46vx7jydg339"))
(patches (search-patches "python-aiohttp-3.6.2-no-warning-fail.patch"))))
(base32 "1i3p4yrfgrf1zpbgnywqmb33ps4k51wylcxykhf2cwky0spq26lw"))))
(build-system python-build-system)
(arguments
'(#:phases
@ -112,33 +111,41 @@
" @pytest.mark.xfail\n async def test_feed_eof_no_err_brotli"))
;; make sure the timestamp of this file is > 1990, because a few
;; tests like test_static_file_if_modified_since_past_date depend on it
(invoke "touch" "-d" "2020-01-01" "tests/data.unknown_mime_type")
(let ((late-90s (* 60 60 24 365 30)))
(utime "tests/data.unknown_mime_type" late-90s late-90s))
;; FIXME: These tests are failing due to deprecation warnings
;; in Python 3.8. Remove this when updating to aiohttp >= 3.7.
;; https://github.com/aio-libs/aiohttp/issues/4477
;; https://github.com/aio-libs/aiohttp/issues/4525
(with-directory-excursion "tests"
(for-each delete-file '("test_client_session.py"
"test_multipart.py"
"test_web_middleware.py"
"test_web_protocol.py"
"test_web_urldispatcher.py")))
#t)))))
;; Disable test that attempts to access httpbin.org.
(substitute* "tests/test_formdata.py"
(("async def test_mark_formdata_as_processed.*" all)
(string-append "@pytest.mark.xfail\n" all)))
;; Don't test the aiohttp pytest plugin to avoid a dependency loop.
(delete-file "tests/test_pytest_plugin.py")
#t))
(replace 'check
(lambda* (#:key tests? #:allow-other-keys)
(setenv "PYTHONPATH"
(string-append ".:" (getenv "PYTHONPATH")))
(if tests?
(invoke "pytest" "-vv"
;; Disable loading the aiohttp coverage plugin
;; to avoid a circular dependency (code coverage
;; is not very interesting to us anyway).
"-o" "addopts=''")
(format #t "test suite not run~%")))))))
(propagated-inputs
`(("python-aiodns" ,python-aiodns)
("python-async-timeout" ,python-async-timeout)
("python-attrs" ,python-attrs)
("python-attrs" ,python-attrs) ;note: remove for > 3.7
("python-chardet" ,python-chardet)
("python-idna-ssl" ,python-idna-ssl)
("python-multidict" ,python-multidict)
("python-typing-extensions" ,python-typing-extensions)
("python-yarl" ,python-yarl)))
(native-inputs
`(("python-pytest-runner" ,python-pytest-runner)
("python-pytest-xdit" ,python-pytest-xdist)
("python-pytest-timeout" ,python-pytest-timeout)
("python-pytest-forked" ,python-pytest-forked)
`(("python-pytest" ,python-pytest)
("python-pytest-mock" ,python-pytest-mock)
("python-re-assert" ,python-re-assert)
("gunicorn" ,gunicorn-bootstrap)
("python-freezegun" ,python-freezegun)
("python-async-generator" ,python-async-generator)))