summaryrefslogtreecommitdiff
path: root/gnu/packages
diff options
context:
space:
mode:
authorMarius Bakke <marius@gnu.org>2020-11-26 18:59:27 +0100
committerMarius Bakke <marius@gnu.org>2020-11-26 21:00:32 +0100
commit00a85828b06744a8b53a55f52a651ff88e071044 (patch)
tree48ac8082dd4f5db0491ecc191cb39b1188e2be64 /gnu/packages
parent47f95d3f1680290977007a8ed112b5037fa78da0 (diff)
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.
Diffstat (limited to 'gnu/packages')
-rw-r--r--gnu/packages/patches/python-aiohttp-3.6.2-no-warning-fail.patch34
-rw-r--r--gnu/packages/python-web.scm49
2 files changed, 28 insertions, 55 deletions
diff --git a/gnu/packages/patches/python-aiohttp-3.6.2-no-warning-fail.patch b/gnu/packages/patches/python-aiohttp-3.6.2-no-warning-fail.patch
deleted file mode 100644
index 6cdddefd50..0000000000
--- a/gnu/packages/patches/python-aiohttp-3.6.2-no-warning-fail.patch
+++ /dev/null
@@ -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)
diff --git a/gnu/packages/python-web.scm b/gnu/packages/python-web.scm
index 172c36d6f9..f5ffc2e0f0 100644
--- a/gnu/packages/python-web.scm
+++ b/gnu/packages/python-web.scm
@@ -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")
-
- ;; 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)))))
+ (let ((late-90s (* 60 60 24 365 30)))
+ (utime "tests/data.unknown_mime_type" late-90s late-90s))
+
+ ;; 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)))