From patchwork Fri Mar 27 13:10:08 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Lars-Dominik Braun X-Patchwork-Id: 20904 Return-Path: X-Original-To: patchwork@mira.cbaines.net Delivered-To: patchwork@mira.cbaines.net Received: by mira.cbaines.net (Postfix, from userid 113) id 22F2227BBEA; Fri, 27 Mar 2020 13:11:14 +0000 (GMT) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on mira.cbaines.net X-Spam-Level: X-Spam-Status: No, score=-2.8 required=5.0 tests=BAYES_00,DKIM_SIGNED, MAILING_LIST_MULTI,T_DKIM_INVALID,URIBL_BLOCKED autolearn=unavailable autolearn_force=no version=3.4.2 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mira.cbaines.net (Postfix) with ESMTP id 5C21127BBE4 for ; Fri, 27 Mar 2020 13:11:13 +0000 (GMT) Received: from localhost ([::1]:41610 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jHolU-0000oX-R2 for patchwork@mira.cbaines.net; Fri, 27 Mar 2020 09:11:12 -0400 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 X-Loop: help-debbugs@gnu.org Subject: [bug#40251] [PATCH] Enable tests for python-aiohttp Resent-From: Lars-Dominik Braun Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Fri, 27 Mar 2020 13:11:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 40251 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 40251@debbugs.gnu.org X-Debbugs-Original-To: guix-patches@gnu.org Received: via spool by submit@debbugs.gnu.org id=B.158531463113165 (code B ref -1); Fri, 27 Mar 2020 13:11:01 +0000 Received: (at submit) by debbugs.gnu.org; 27 Mar 2020 13:10:31 +0000 Received: from localhost ([127.0.0.1]:60602 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1jHokj-0003Q6-EN for submit@debbugs.gnu.org; Fri, 27 Mar 2020 09:10:31 -0400 Received: from lists.gnu.org ([209.51.188.17]:47697) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1jHokc-0003Pl-GT for submit@debbugs.gnu.org; Fri, 27 Mar 2020 09:10:24 -0400 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) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=leibniz-psychology-org.20150623.gappssmtp.com; s=20150623; h=date:from:to:subject:message-id:mime-version:content-disposition :user-agent; bh=IUlg1kSBg1AyAqlR2CFA6te5hXbpSQdOD1y3B4R2mcQ=; b=ZVQXhfPwhRcLf+Qq+pSn2NWd6qfsB8JrhMAHLjH/dPub43CuC3yHsdd9rlibSweHn6 VPZ78GiunhPIqtqzycD1wZ5MwVNTPpZoaD5n2PTfzja3GTtqZRIvptEdHiJ4a53qu6dn YgaoXpb91TsPcGBXI+6Sjp0DVI0m3qT3n1HB0iiIXAgB1hgsawbi7bNDdsmgS3nwiIsG UXpWfukt5fCjsuX8QAZGlTVCfIyUzdiQa/tyW6xiO0F0kqgXuxZ94a/iwjg9lwz8KaFI zM9j+zCL21HbIcAgA29yImk3Mx+w4DyrQJgAsnovYHZ6jTkCdbw4+wzo8EGsk4KRkC6u gEXA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:subject:message-id:mime-version :content-disposition:user-agent; bh=IUlg1kSBg1AyAqlR2CFA6te5hXbpSQdOD1y3B4R2mcQ=; b=jEiaq3ARc1KUlNeD2HLDTucCAmHibyCHU786SQEcct201WkyMwEPDVVgHMLv6Z0AZ3 7QnIXvZxcRwn+fNuhZlsgRKzKBBkA9cx22UxLPUA4OC3tGo+pDnJlbXpGZrK2G0kqg/f B3ZqaPF5oo3AQfdgPOsoUy8AQ0Dq9vnGO06ob5mKpjWy0HvXb5dwanbDd209HTAgyuiZ 6qqgjHt6vfEILJQcWJIt7NN/DicgvHvNIMybd/Jb375TswcNJcDIRA+swTsgfksCRZRH sqUzqO0kBX/SJMj47Edux5RXiy3/HWGgaKJd7J531zg0SS7nCwpsrdn6NnYUJYNMBZtP 7pVQ== X-Gm-Message-State: ANhLgQ0UDJdlT3P4U8bVi8rqL2HJK9Rr7nJPUci3cDiMG88NLI9mEUPm FhsJNYU2PWngtkc0dYlwc1HnCC+HmyAAoyoE20urx37CYIR2TES04k/coWuncTlAqKyleTypb8l aHlgJDxVmb/j9BmUxsCiO7w8Y7cebkMEvUQoszhhaFJKymjK5dP+R/4OU4IKFhIFtZHqQF7fE0T hg98wo9MY= X-Google-Smtp-Source: ADFU+vuLTJSMhH/XpbnvMN7aoiykCmQhfB5w01XM6/as2bHDivtsyOXoD5z0Ze0CvrcNUgXjrNPL+g== X-Received: by 2002:a1c:195:: with SMTP id 143mr5395785wmb.0.1585314609859; Fri, 27 Mar 2020 06:10:09 -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-Disposition: inline User-Agent: Mutt/1.10.1 (2018-07-13) X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 209.51.188.43 X-BeenThere: guix-patches@gnu.org List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-patches-bounces+patchwork=mira.cbaines.net@gnu.org Sender: "Guix-patches" X-getmail-retrieved-from-mailbox: Patches 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 From f3bbf527ca17d509a1c755960d0f7fc2c3daf8ea Mon Sep 17 00:00:00 2001 From: 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-fail.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 = \ %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.patch 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/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 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.patch")))) + (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’re 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_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") + #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))) +;; break cyclic dependency for python-aiohttp, which depends on gunicorn for +;; 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") -- 2.20.1