From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:470:142:3::10]:59774) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jHolM-0000oE-NI for guix-patches@gnu.org; Fri, 27 Mar 2020 09:11:06 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1jHolK-0001fX-9l for guix-patches@gnu.org; Fri, 27 Mar 2020 09:11:04 -0400 Received: from debbugs.gnu.org ([209.51.188.43]:54629) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1jHolK-0001er-5M for guix-patches@gnu.org; Fri, 27 Mar 2020 09:11:02 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1jHolK-0003RE-0U for guix-patches@gnu.org; Fri, 27 Mar 2020 09:11:02 -0400 Subject: [bug#40251] [PATCH] Enable tests for python-aiohttp Resent-Message-ID: Received: from eggs.gnu.org ([2001:470:142:3::10]:58884) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jHokZ-0000jK-UW for guix-patches@gnu.org; Fri, 27 Mar 2020 09:10:18 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1jHokW-00064X-BZ for guix-patches@gnu.org; Fri, 27 Mar 2020 09:10:15 -0400 Received: from mail-wm1-x32a.google.com ([2a00:1450:4864:20::32a]:55135) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1jHokV-0005st-N1 for guix-patches@gnu.org; Fri, 27 Mar 2020 09:10:12 -0400 Received: by mail-wm1-x32a.google.com with SMTP id c81so11333997wmd.4 for ; Fri, 27 Mar 2020 06:10:11 -0700 (PDT) Received: from localhost (dynamic-2a01-0c22-d014-0900-3de3-0cf8-7076-2e04.c22.pool.telefonica.de. [2a01:c22:d014:900:3de3:cf8:7076:2e04]) by smtp.gmail.com with ESMTPSA id d21sm8439956wrb.51.2020.03.27.06.10.08 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 27 Mar 2020 06:10:09 -0700 (PDT) Date: Fri, 27 Mar 2020 14:10:08 +0100 From: Lars-Dominik Braun Message-ID: <20200327131008.GC4578@zpidnp36> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="SnV5plBeK2Ge1I9g" Content-Disposition: inline List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-patches-bounces+kyle=kyleam.com@gnu.org Sender: "Guix-patches" To: 40251@debbugs.gnu.org --SnV5plBeK2Ge1I9g Content-Type: multipart/mixed; boundary="PPYy/fEw/8QCHSq3" Content-Disposition: inline --PPYy/fEw/8QCHSq3 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Hi, this patch-set enables tests for python-aiohttp. gunicorn 20.0.4 fixes a critical bug that prevents using it on a guix system and python-pytest-forked is required for the tests. We also need to cut through a circular dependency (gunicorn<->aiohttp), thus gunicorn-bootstrap is introduced. Cheers, Lars --PPYy/fEw/8QCHSq3 Content-Type: text/x-diff; charset=us-ascii Content-Disposition: attachment; filename="0001-gnu-gunicorn-Update-to-20.0.4.patch" Content-Transfer-Encoding: quoted-printable =46rom 405d7831be08b7f00643b7b28a88ce60c2ebcd00 Mon Sep 17 00:00:00 2001 =46rom: Lars-Dominik Braun Date: Fri, 27 Mar 2020 13:55:03 +0100 Subject: [PATCH 1/3] gnu: gunicorn: Update to 20.0.4 * gnu/packages/python-web.scm (gunicorn) [version]: Update to 20.0.4 [arguments] Re-enable previously failing tests --- gnu/packages/python-web.scm | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/gnu/packages/python-web.scm b/gnu/packages/python-web.scm index 26e2fe04ec..19c08026f2 100644 --- a/gnu/packages/python-web.scm +++ b/gnu/packages/python-web.scm @@ -3390,14 +3390,14 @@ hard or impossible to fix in cssselect.") (define-public gunicorn (package (name "gunicorn") - (version "20.0.0") + (version "20.0.4") (source (origin (method url-fetch) (uri (pypi-uri "gunicorn" version)) (sha256 (base32 - "0l1zm8a0vz8ws3lkn8q9a0f93ipdzyvlf2zlwdj5xyadh6jdwsgg")))) + "09n6fc019bgrvph1s5h1lwhn2avcsprw6ncd203qhra3i8mvn10r")))) (outputs '("out" "doc")) (build-system python-build-system) (arguments @@ -3413,11 +3413,6 @@ hard or impossible to fix in cssselect.") (lambda _ (setenv "PYTHONPATH" (string-append ".:" (getenv "PYTHONPATH"))) - ;; Remove test modules failing due to libc not found due to - ;; section '.dynamic' not found in libc.so - (delete-file "tests/test_arbiter.py") - (delete-file "tests/test_config.py") - (delete-file "tests/test_sock.py") (invoke "pytest"))) (add-after 'install 'install-doc (lambda* (#:key outputs #:allow-other-keys) --=20 2.20.1 --PPYy/fEw/8QCHSq3 Content-Type: text/x-diff; charset=us-ascii Content-Disposition: attachment; filename="0002-gnu-Add-python-pytest-forked.patch" Content-Transfer-Encoding: quoted-printable =46rom 02c51b326e72a501cc00216a34355ce0512ca449 Mon Sep 17 00:00:00 2001 =46rom: Lars-Dominik Braun Date: Fri, 27 Mar 2020 13:57:00 +0100 Subject: [PATCH 2/3] gnu: Add python-pytest-forked * gnu/packages/check.scm (python-pytest-forked): New variable. --- gnu/packages/check.scm | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) diff --git a/gnu/packages/check.scm b/gnu/packages/check.scm index 1b60b99ce1..ef0d4e3aec 100644 --- a/gnu/packages/check.scm +++ b/gnu/packages/check.scm @@ -1025,6 +1025,31 @@ result back.") timeout has been exceeded.") (license license:expat))) =20 +(define-public python-pytest-forked + (package + (name "python-pytest-forked") + (version "1.1.3") + (source + (origin + (method url-fetch) + (uri (pypi-uri "pytest-forked" version)) + (sha256 + (base32 + "000i4q7my2fq4l49n8idx2c812dql97qv6qpm2vhrrn9v6g6j18q")))) + (build-system python-build-system) + (propagated-inputs + `(("python-pytest" ,python-pytest))) + (native-inputs + `(("python-setuptools-scm" ,python-setuptools-scm))) + (home-page + "https://github.com/pytest-dev/pytest-forked") + (synopsis + "Run tests in isolated forked subprocesses") + (description + "Pytest plugin which will run each test in a subprocess and will repo= rt if +a test crashed the process.") + (license license:expat))) + (define-public python-scripttest (package (name "python-scripttest") --=20 2.20.1 --PPYy/fEw/8QCHSq3 Content-Type: text/x-diff; charset=utf-8 Content-Disposition: attachment; filename="0003-gnu-python-aiohttp-Enable-tests.patch" Content-Transfer-Encoding: quoted-printable =46rom f3bbf527ca17d509a1c755960d0f7fc2c3daf8ea Mon Sep 17 00:00:00 2001 =46rom: Lars-Dominik Braun Date: Fri, 27 Mar 2020 13:58:11 +0100 Subject: [PATCH 3/3] gnu: python-aiohttp: Enable tests * gnu/packages/python-web.scm (python-aiohttp) [arguments]: Enable tests [native-inputs] Add test dependencies [patches] Add test case patch * gnu/packages/patches/python-aiohttp-3.6.2-no-warning-fail.patch: New file * gnu/local.mk (dist_patch_DATA): Add it --- gnu/local.mk | 1 + ...python-aiohttp-3.6.2-no-warning-fail.patch | 34 ++++++++++++++++++ gnu/packages/python-web.scm | 36 +++++++++++++++++-- 3 files changed, 69 insertions(+), 2 deletions(-) create mode 100644 gnu/packages/patches/python-aiohttp-3.6.2-no-warning-fa= il.patch diff --git a/gnu/local.mk b/gnu/local.mk index 0a406dffa0..dc9db36c69 100644 --- a/gnu/local.mk +++ b/gnu/local.mk @@ -1339,6 +1339,7 @@ dist_patch_DATA =3D \ %D%/packages/patches/python-3.8-search-paths.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-alembic-exceptions-cause.patch \ %D%/packages/patches/python-axolotl-AES-fix.patch \ %D%/packages/patches/python-cairocffi-dlopen-path.patch \ diff --git a/gnu/packages/patches/python-aiohttp-3.6.2-no-warning-fail.patc= h b/gnu/packages/patches/python-aiohttp-3.6.2-no-warning-fail.patch new file mode 100644 index 0000000000..6cdddefd50 --- /dev/null +++ b/gnu/packages/patches/python-aiohttp-3.6.2-no-warning-fail.patch @@ -0,0 +1,34 @@ +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/60f01cca36b9f9d8d35dd351384eaae= 2f8fd0d4b, +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=3DTrue) as _warnings: + yield +- rw =3D ['{w.filename}:{w.lineno}:{w.message}'.format(w=3Dw) +- for w in _warnings # type: ignore +- if w.category =3D=3D RuntimeWarning] +- if rw: +- raise RuntimeError('{} Runtime Warning{},\n{}'.format( +- len(rw), +- '' if len(rw) =3D=3D 1 else 's', +- '\n'.join(rw) +- )) +=20 +=20 + @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 =3D ( + {'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 19c08026f2..3686432a1d 100644 --- a/gnu/packages/python-web.scm +++ b/gnu/packages/python-web.scm @@ -90,10 +90,23 @@ (uri (pypi-uri "aiohttp" version)) (sha256 (base32 - "09pkw6f1790prnrq0k8cqgnf1qy57ll8lpmc6kld09q7zw4vi6i5")))) + "09pkw6f1790prnrq0k8cqgnf1qy57ll8lpmc6kld09q7zw4vi6i5")) + (patches (search-patches "python-aiohttp-3.6.2-no-warning-fail.patc= h")))) + (build-system python-build-system) (arguments - `(#:tests? #f)) ;missing pytest-timeout + '(#:phases + (modify-phases %standard-phases + (add-after 'unpack 'fix-tests + (lambda _ + ;; disable brotli tests, because we=E2=80=99re not providing = that optional library + (substitute* "tests/test_http_parser.py" + ((" async def test_feed_eof_no_err_brotli") + " @pytest.mark.xfail\n async def test_feed_eof_no_er= r_brotli")) + ;; make sure the timestamp of this file is > 1990, because a = few + ;; tests like test_static_file_if_modified_since_past_date de= pend on it + (invoke "touch" "-d" "2020-01-01" "tests/data.unknown_mime_ty= pe") + #t))))) (propagated-inputs `(("python-aiodns" ,python-aiodns) ("python-async-timeout" ,python-async-timeout) @@ -102,6 +115,15 @@ ("python-idna-ssl" ,python-idna-ssl) ("python-multidict" ,python-multidict) ("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-mock" ,python-pytest-mock) + ("gunicorn" ,gunicorn-bootstrap) + ("python-freezegun" ,python-freezegun) + ("python-async-generator" ,python-async-generator))) (home-page "https://github.com/aio-libs/aiohttp/") (synopsis "Async HTTP client/server framework (asyncio)") (description "@code{aiohttp} is an asynchronous HTTP client/server @@ -3447,6 +3469,16 @@ various web frameworks, simply implemented, light on= server resources, and fairly speedy.") (license license:expat))) =20 +;; break cyclic dependency for python-aiohttp, which depends on gunicorn f= or +;; its tests +(define-public gunicorn-bootstrap + (package + (inherit gunicorn) + (name "gunicorn") + (arguments `(#:tests? #f)) + (properties '((hidden? . #t))) + (native-inputs `()))) + (define-public python-translation-finder (package (name "python-translation-finder") --=20 2.20.1 --PPYy/fEw/8QCHSq3-- --SnV5plBeK2Ge1I9g Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQGzBAABCgAdFiEEyk+M9DfXR4/aBV/UQhN3ARo3hEYFAl59+ywACgkQQhN3ARo3 hEal6Qv/W5aX4XhACLIegFKMcTSX/xaPc1l/peMLIdsr0Rt2UA0RS8O2G1a87fDW 9k7fY6sJnLiwv9ESTiJnEoryGS7NfJAjpVZAzoPa4NRfqdr/86eEU1/bxLSexXDN wf7U2P2seU84g7GE8Dr7apMOsRd4I4UZ+kKf/0kvkbv0axjquxUBn+t/dMmwMkG4 ZRyjPNU9jpsSs/cq+gKbObxRnymmFuMhRLKmoW9xM10r1TENKvmfAO11/pUChXHr Y3I8aKt4ikzoql+iP56Kyj8v7pgbF+RpVTyaPHfFonOsqJiAjMM1THReywzjWOyN lafGJQgsUe6kVUAltFMWZAsBnWAmbklfE22M0eqIB4s6ofkwcyNc3XBJlOuoo2N7 +P9TBkdHMGKTiW6amqhD4Gi8BTnfCeT79PY4q8NZv7bghM4e3nZVSDYVybgoxIdE N2RePccuZTOTXGbqy3W9jYvZ1tnqwYUxZaMVL3z3LW5phmuAfjhWr0jj6thBKyDT vSU+05WO =a2Tz -----END PGP SIGNATURE----- --SnV5plBeK2Ge1I9g--