summary refs log tree commit diff
diff options
context:
space:
mode:
authorMaxim Cournoyer <maxim.cournoyer@gmail.com>2022-01-17 17:45:39 -0500
committerMaxim Cournoyer <maxim.cournoyer@gmail.com>2022-01-17 22:24:04 -0500
commite40dfcfcb1bcfa15355b076714897709fa4e1fb2 (patch)
treeeaf1241ed6e945c6263249ebc2395d5303dcd505
parentf91d1c30194a9168d0f30d35a024e44f7066d6e3 (diff)
downloadguix-e40dfcfcb1bcfa15355b076714897709fa4e1fb2.tar.gz
gnu: python-aiohttp: Update to 3.8.1.
* gnu/packages/check.scm (python-pytest-6.1): Delete package.
* gnu/packages/python-web.scm (python-aiohttp): Update to 3.8.1.
[source]: Adjust snippet and comment it out with a TODO comment.
[phases]{cythonize}: Fix indentation.
{check}: Use 'when' for the TESTS? condition.
Delete the test_proxy_functional.py test file.
Skip tests requiring networking.  Run tests in parallel with xdist.
[propagated-inputs]: Add python-aiosignal.  Remove python-attrs.
{python-chardet}: Replace by...
{python-charset-normalizer}: ... this.
Add python-frozenlist.
[native-inputs]: Use the regular python-pytest package.
Add python-pytest-xdist.
-rw-r--r--gnu/packages/check.scm11
-rw-r--r--gnu/packages/python-web.scm62
2 files changed, 37 insertions, 36 deletions
diff --git a/gnu/packages/check.scm b/gnu/packages/check.scm
index d380b8fa80..8b90929b4b 100644
--- a/gnu/packages/check.scm
+++ b/gnu/packages/check.scm
@@ -1004,17 +1004,6 @@ and many external plugins.")
     (license license:expat)
     (properties `((python2-variant . ,(delay python2-pytest))))))
 
-(define-public python-pytest-6.1
-  (package
-    (inherit python-pytest)
-    (version "6.1.2")
-    (source
-      (origin
-        (method url-fetch)
-        (uri (pypi-uri "pytest" version))
-        (sha256
-         (base32 "0gl2sdm322vzmsh5k4f8kj9raiq2y7kdinnca4m45ifvii5fk9y0"))))))
-
 (define-public python-pytest-6 python-pytest)
 
 ;; Pytest 4.x are the last versions that support Python 2.
diff --git a/gnu/packages/python-web.scm b/gnu/packages/python-web.scm
index 75126c5b40..8764e34526 100644
--- a/gnu/packages/python-web.scm
+++ b/gnu/packages/python-web.scm
@@ -223,22 +223,18 @@ for adding, removing and dropping callbacks.")
 (define-public python-aiohttp
   (package
     (name "python-aiohttp")
-    (version "3.7.4")
+    (version "3.8.1")
     (source
      (origin
        (method url-fetch)
        (uri (pypi-uri "aiohttp" version))
        (sha256
-        (base32 "1pn79h8fng4xi5gl1f6saw31nxgmgyxl41yf3vba1l21673yr12x"))
-       (modules '((guix build utils)))
-       (snippet
-        '(begin
-           (for-each delete-file
-                     '("aiohttp/_frozenlist.c"
-                       "aiohttp/_helpers.c"
-                       "aiohttp/_http_parser.c"
-                       "aiohttp/_http_writer.c"
-                       "aiohttp/_websocket.c"))))))
+        (base32 "0y3m1dzl4h6frg8vys0fc3m83ijd1plfpihv3kvmxqadlphp2m7w"))
+       ;; TODO: Unbundle the llhttp sources.
+       ;; (modules '((guix build utils)))
+       ;; (snippet
+       ;;  '((delete-file-recursively "vendor")))
+       ))
     (build-system python-build-system)
     (arguments
      '(;; The test suite fails to handle a deprecation warning:
@@ -269,24 +265,39 @@ for adding, removing and dropping callbacks.")
              ;; Adapted from the Makefile.
              (with-directory-excursion "aiohttp"
                (for-each
-                 (lambda (file)
-                   (invoke "cython" "-3"
-                           file "-I" "."))
-                 (find-files "." "_.*\\.pyx$")))))
+                (lambda (file)
+                  (invoke "cython" "-3"
+                          file "-I" "."))
+                (find-files "." "_.*\\.pyx$")))))
          (replace 'check
            (lambda* (#:key tests? #:allow-other-keys)
-             (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=''" "--ignore=aiohttp")
-                 (format #t "test suite not run~%")))))))
+             (when tests?
+               ;; This tests requires the 'proxy.py' module, not yet
+               ;; packaged.
+               (delete-file "tests/test_proxy_functional.py")
+               (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=''" "--ignore=aiohttp"
+                       "-n" (number->string (parallel-job-count))
+                       "-k" (string-append
+                             ;; This test probably requires to be run with the
+                             ;; library loaded from the the build directory.
+                             "not test_c_parser_loaded and "
+                             ;; Disable the following tests as they require
+                             ;; networking.
+                             "not TestDeflateBuffer and "
+                             "not test_client_session_timeout_zero and "
+                             "not test_empty_body and "
+                             "not test_mark_formdata_as_processed[pyloop] and "
+                             "not test_receive_runtime_err[pyloop]"))))))))
     (propagated-inputs
      (list python-aiodns
+           python-aiosignal
            python-async-timeout
-           python-attrs ;note: remove for > 3.7
-           python-chardet
+           python-charset-normalizer
+           python-frozenlist
            python-idna-ssl
            python-multidict
            python-typing-extensions
@@ -296,8 +307,9 @@ for adding, removing and dropping callbacks.")
            python-async-generator
            python-cython
            python-freezegun
-           python-pytest-6.1
+           python-pytest
            python-pytest-mock
+           python-pytest-xdist
            python-re-assert))
     (home-page "https://github.com/aio-libs/aiohttp/")
     (synopsis "Async HTTP client/server framework (asyncio)")