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.
This commit is contained in:
Maxim Cournoyer 2022-01-17 17:45:39 -05:00
parent f91d1c3019
commit e40dfcfcb1
No known key found for this signature in database
GPG key ID: 1260E46482E63562
2 changed files with 37 additions and 36 deletions

View file

@ -1004,17 +1004,6 @@ (define-public python-pytest
(license license:expat) (license license:expat)
(properties `((python2-variant . ,(delay python2-pytest)))))) (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) (define-public python-pytest-6 python-pytest)
;; Pytest 4.x are the last versions that support Python 2. ;; Pytest 4.x are the last versions that support Python 2.

View file

@ -223,22 +223,18 @@ (define-public python-aiosignal
(define-public python-aiohttp (define-public python-aiohttp
(package (package
(name "python-aiohttp") (name "python-aiohttp")
(version "3.7.4") (version "3.8.1")
(source (source
(origin (origin
(method url-fetch) (method url-fetch)
(uri (pypi-uri "aiohttp" version)) (uri (pypi-uri "aiohttp" version))
(sha256 (sha256
(base32 "1pn79h8fng4xi5gl1f6saw31nxgmgyxl41yf3vba1l21673yr12x")) (base32 "0y3m1dzl4h6frg8vys0fc3m83ijd1plfpihv3kvmxqadlphp2m7w"))
(modules '((guix build utils))) ;; TODO: Unbundle the llhttp sources.
(snippet ;; (modules '((guix build utils)))
'(begin ;; (snippet
(for-each delete-file ;; '((delete-file-recursively "vendor")))
'("aiohttp/_frozenlist.c" ))
"aiohttp/_helpers.c"
"aiohttp/_http_parser.c"
"aiohttp/_http_writer.c"
"aiohttp/_websocket.c"))))))
(build-system python-build-system) (build-system python-build-system)
(arguments (arguments
'(;; The test suite fails to handle a deprecation warning: '(;; The test suite fails to handle a deprecation warning:
@ -269,24 +265,39 @@ (define-public python-aiohttp
;; Adapted from the Makefile. ;; Adapted from the Makefile.
(with-directory-excursion "aiohttp" (with-directory-excursion "aiohttp"
(for-each (for-each
(lambda (file) (lambda (file)
(invoke "cython" "-3" (invoke "cython" "-3"
file "-I" ".")) file "-I" "."))
(find-files "." "_.*\\.pyx$"))))) (find-files "." "_.*\\.pyx$")))))
(replace 'check (replace 'check
(lambda* (#:key tests? #:allow-other-keys) (lambda* (#:key tests? #:allow-other-keys)
(if tests? (when tests?
(invoke "pytest" "-vv" ;; This tests requires the 'proxy.py' module, not yet
;; Disable loading the aiohttp coverage plugin ;; packaged.
;; to avoid a circular dependency (code coverage (delete-file "tests/test_proxy_functional.py")
;; is not very interesting to us anyway). (invoke "pytest" "-vv"
"-o" "addopts=''" "--ignore=aiohttp") ;; Disable loading the aiohttp coverage plugin
(format #t "test suite not run~%"))))))) ;; 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 (propagated-inputs
(list python-aiodns (list python-aiodns
python-aiosignal
python-async-timeout python-async-timeout
python-attrs ;note: remove for > 3.7 python-charset-normalizer
python-chardet python-frozenlist
python-idna-ssl python-idna-ssl
python-multidict python-multidict
python-typing-extensions python-typing-extensions
@ -296,8 +307,9 @@ (define-public python-aiohttp
python-async-generator python-async-generator
python-cython python-cython
python-freezegun python-freezegun
python-pytest-6.1 python-pytest
python-pytest-mock python-pytest-mock
python-pytest-xdist
python-re-assert)) python-re-assert))
(home-page "https://github.com/aio-libs/aiohttp/") (home-page "https://github.com/aio-libs/aiohttp/")
(synopsis "Async HTTP client/server framework (asyncio)") (synopsis "Async HTTP client/server framework (asyncio)")