mirror of
https://codeberg.org/guix/guix.git
synced 2025-10-02 02:15:12 +00:00
gnu: python-aiohttp: Update to 3.11.11.
* gnu/packages/python-web.scm (python-aiohttp): Update to 3.11.11. [source]: Adjust snippet. [build-system]: Use pyproject-build-system. [arguments]: Use #:test-flags instead of modifying test in build phases; remove custom 'check phase. [propagated-inputs]: Add python-aiohappyeyeballs and python-propcache; remove python-asynctest, python-charset-normalizer, and python-idna-ssl. [native-inputs]: Remove python-async-generator; replace python-cython with python-cython-3; add python-pytest-cov, python-setuptools, and python-wheel. Change-Id: I5a95d3d801343b0afb824a8779be1f5f8e5d6eb8
This commit is contained in:
parent
4a11566f4f
commit
2814ef23a3
1 changed files with 53 additions and 70 deletions
|
@ -691,46 +691,68 @@ for adding, removing and dropping callbacks.")
|
||||||
(define-public python-aiohttp
|
(define-public python-aiohttp
|
||||||
(package
|
(package
|
||||||
(name "python-aiohttp")
|
(name "python-aiohttp")
|
||||||
(version "3.8.4")
|
(version "3.11.11")
|
||||||
(source
|
(source
|
||||||
(origin
|
(origin
|
||||||
(method url-fetch)
|
(method url-fetch)
|
||||||
(uri (pypi-uri "aiohttp" version))
|
(uri (pypi-uri "aiohttp" version))
|
||||||
(sha256
|
(sha256
|
||||||
(base32 "0p5bj6g7ca19gvwk8fz00k579ma9w9kd27ssh2zl3r61ca8ilbmz"))
|
(base32 "0gihj076nm3863sqfnbh786621w1ad7lj7fq88d85wzbwvqwfjdv"))
|
||||||
(snippet
|
(snippet
|
||||||
#~(begin
|
#~(begin
|
||||||
(use-modules ((guix build utils)))
|
(use-modules ((guix build utils)))
|
||||||
;; TODO: Unbundle the llhttp sources.
|
;; TODO: Unbundle the llhttp sources.
|
||||||
;; (delete-file-recursively "vendor")
|
;; (delete-file-recursively "vendor")
|
||||||
(delete-file "aiohttp/_helpers.c")
|
|
||||||
(delete-file "aiohttp/_http_parser.c")
|
(delete-file "aiohttp/_http_parser.c")
|
||||||
(delete-file "aiohttp/_http_writer.c")
|
(delete-file "aiohttp/_http_writer.c")))))
|
||||||
(delete-file "aiohttp/_websocket.c")))))
|
(build-system pyproject-build-system)
|
||||||
(build-system python-build-system)
|
|
||||||
(arguments
|
(arguments
|
||||||
'(#:phases
|
(list
|
||||||
(modify-phases %standard-phases
|
#:test-flags
|
||||||
|
'(list
|
||||||
|
;; This tests requires the 'proxy.py' module, not yet packaged.
|
||||||
|
"--ignore=tests/test_proxy_functional.py"
|
||||||
|
;; These tests need brotli.
|
||||||
|
"--ignore=tests/test_web_sendfile_functional.py"
|
||||||
|
"--ignore=tests/test_web_functional.py"
|
||||||
|
;; These tests need pytest_codspeed
|
||||||
|
"--ignore-glob=tests/test_benchmarks*"
|
||||||
|
;; These tests need python_on_whales
|
||||||
|
"--ignore=tests/autobahn/test_autobahn.py"
|
||||||
|
"-k"
|
||||||
|
;; These tests fail for unknown reasons (see:
|
||||||
|
;; https://github.com/aio-libs/aiohttp/issues/7130)
|
||||||
|
(string-append
|
||||||
|
"not test_no_warnings "
|
||||||
|
"and not test_default_loop "
|
||||||
|
"and not test_ctor_global_loop "
|
||||||
|
"and not test_set_loop_default_loop "
|
||||||
|
|
||||||
|
;; Disable brotli tests, because we’re not providing that optional
|
||||||
|
;; library.
|
||||||
|
"and not test_feed_eof_no_err_brotli "
|
||||||
|
|
||||||
|
;; Disable the following tests as they require
|
||||||
|
;; networking.
|
||||||
|
"and 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] "
|
||||||
|
|
||||||
|
;; assert 'gzip, deflate' == 'gzip, deflate, br'
|
||||||
|
"and not test_headers[pyloop] "
|
||||||
|
;; ~/.. does not resolve
|
||||||
|
"and not test_add_static_path_resolution"))
|
||||||
|
#:phases
|
||||||
|
'(modify-phases %standard-phases
|
||||||
(add-after 'unpack 'fix-tests
|
(add-after 'unpack 'fix-tests
|
||||||
(lambda _
|
(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
|
;; Make sure the timestamp of this file is > 1990, because a few
|
||||||
;; tests like test_static_file_if_modified_since_past_date depend
|
;; tests like test_static_file_if_modified_since_past_date depend
|
||||||
;; on it.
|
;; on it.
|
||||||
(let ((late-90s (* 60 60 24 365 30)))
|
(let ((late-90s (* 60 60 24 365 30)))
|
||||||
(utime "tests/data.unknown_mime_type" late-90s late-90s))
|
(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")))
|
|
||||||
(add-before 'build 'cythonize
|
(add-before 'build 'cythonize
|
||||||
(lambda _
|
(lambda _
|
||||||
;; Adapted from the Makefile.
|
;; Adapted from the Makefile.
|
||||||
|
@ -739,66 +761,27 @@ for adding, removing and dropping callbacks.")
|
||||||
(lambda (file)
|
(lambda (file)
|
||||||
(invoke "cython" "-3"
|
(invoke "cython" "-3"
|
||||||
file "-I" "."))
|
file "-I" "."))
|
||||||
(find-files "." "_.*\\.pyx$")))))
|
(find-files "." "_.*\\.pyx$"))))))))
|
||||||
(replace 'check
|
|
||||||
(lambda* (#:key tests? #:allow-other-keys)
|
|
||||||
(let ((skipped-tests
|
|
||||||
(string-append
|
|
||||||
;; This test probably requires to be run with the
|
|
||||||
;; library loaded from the the build directory.
|
|
||||||
"not test_c_parser_loaded and "
|
|
||||||
;; TODO: These tests fail with recent versions of Pytest
|
|
||||||
;; and the fix is difficult to backport:
|
|
||||||
;; https://github.com/aio-libs/aiohttp/pull/6872
|
|
||||||
;; Re-enable after 3.9.
|
|
||||||
"not test_session_close_awaitable and "
|
|
||||||
"not test_async_with_session and "
|
|
||||||
"not test_close_run_until_complete_not_deprecated 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] "
|
|
||||||
;; These tests fail for unknown reasons (see:
|
|
||||||
;; https://github.com/aio-libs/aiohttp/issues/7130)
|
|
||||||
"and not test_no_warnings "
|
|
||||||
"and not test_default_loop "
|
|
||||||
"and not test_ctor_global_loop "
|
|
||||||
"and not test_set_loop_default_loop ")))
|
|
||||||
(when tests?
|
|
||||||
;; This tests requires the 'proxy.py' module, not yet
|
|
||||||
;; packaged.
|
|
||||||
(delete-file "tests/test_proxy_functional.py")
|
|
||||||
;; Sometimes tests fail when run in parallel.
|
|
||||||
(invoke "pytest" "-vv"
|
|
||||||
"-o" "addopts=''" "--ignore=aiohttp"
|
|
||||||
;; These tests cause errors (see:
|
|
||||||
;; https://github.com/aio-libs/aiohttp/issues/7130).
|
|
||||||
"--ignore" "tests/test_web_sendfile_functional.py"
|
|
||||||
"--ignore" "tests/test_web_urldispatcher.py"
|
|
||||||
"-k" skipped-tests))))))))
|
|
||||||
(propagated-inputs
|
(propagated-inputs
|
||||||
(list python-aiodns
|
(list python-aiohappyeyeballs
|
||||||
python-aiosignal
|
python-aiosignal
|
||||||
python-attrs
|
|
||||||
python-asynctest
|
|
||||||
python-async-timeout
|
python-async-timeout
|
||||||
python-charset-normalizer
|
python-attrs
|
||||||
python-frozenlist
|
python-frozenlist
|
||||||
python-idna-ssl
|
|
||||||
python-multidict
|
python-multidict
|
||||||
|
python-propcache
|
||||||
python-yarl))
|
python-yarl))
|
||||||
(native-inputs
|
(native-inputs
|
||||||
(list gunicorn-bootstrap
|
(list gunicorn-bootstrap
|
||||||
python-async-generator
|
python-cython-3
|
||||||
python-cython
|
|
||||||
python-freezegun
|
python-freezegun
|
||||||
python-pytest
|
python-pytest
|
||||||
|
python-pytest-cov
|
||||||
python-pytest-mock
|
python-pytest-mock
|
||||||
python-pytest-xdist
|
python-pytest-xdist
|
||||||
python-re-assert))
|
python-re-assert
|
||||||
|
python-setuptools
|
||||||
|
python-wheel))
|
||||||
(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)")
|
||||||
(description "@code{aiohttp} is an asynchronous HTTP client/server
|
(description "@code{aiohttp} is an asynchronous HTTP client/server
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue