summaryrefslogtreecommitdiff
path: root/gnu/packages/python-web.scm
diff options
context:
space:
mode:
authorSharlatan Hellseher <sharlatanus@gmail.com>2026-05-28 22:33:56 +0100
committerSharlatan Hellseher <sharlatanus@gmail.com>2026-08-08 23:02:00 +0100
commitfa04ee95ce7ef96d4cf10f52067ff220529f7450 (patch)
tree9bc49d8dce8764c44667df43c626c48f4d049758 /gnu/packages/python-web.scm
parentb080130ec9dc68b2c01ed37c3beea63f93a22d5b (diff)
gnu: python-aiohttp: Update to 3.13.5.
This change unvedors llhttp and switch to git-source. * gnu/packages/python-web.scm (python-aiohttp): Update to 3.13.5. Use G-Expressions. [source]: Switch to git-fetch. [arguments] <test-flags>: Restructure ignored test files and adjust skipped tests; limit parallel tests up to 8 threads for better stability in CI. [phases]{cythonize}: Merge to {pre-build} phase. {set-libllhtp-pkconfig, fix-pytest-config, pre-build, remove-local-source}: New phases [inputs]: Add llhttp. [propagated-inputs]: Add python-aiodns, python-backports-zstd, and python-brotli. [native-inputs]: Remove python-isal; add python-pkgconfig and python-zlib-ng. Relates-to: guix/guix#8789 Change-Id: Ibfcf7873660d2683e69e27fa17ebdf25d1c6fbe8
Diffstat (limited to 'gnu/packages/python-web.scm')
-rw-r--r--gnu/packages/python-web.scm171
1 files changed, 92 insertions, 79 deletions
diff --git a/gnu/packages/python-web.scm b/gnu/packages/python-web.scm
index ccc7d306631..97815424eda 100644
--- a/gnu/packages/python-web.scm
+++ b/gnu/packages/python-web.scm
@@ -2723,103 +2723,116 @@ for adding, removing and dropping callbacks.")
2723(define-public python-aiohttp 2723(define-public python-aiohttp
2724 (package 2724 (package
2725 (name "python-aiohttp") 2725 (name "python-aiohttp")
2726 ;; TODO: Newer versions require zlib-ng: 2726 (version "3.13.5")
2727 ;; <https://github.com/zlib-ng/zlib-ng>,
2728 ;; <https://github.com/pycompression/python-zlib-ng>.
2729 (version "3.11.18")
2730 (source 2727 (source
2731 (origin 2728 (origin
2732 (method url-fetch) 2729 (method git-fetch)
2733 (uri (pypi-uri "aiohttp" version)) 2730 (uri (git-reference
2731 (url "https://github.com/aio-libs/aiohttp/")
2732 (commit (string-append "v" version))))
2733 (file-name (git-file-name name version))
2734 (sha256 2734 (sha256
2735 (base32 "12jmkxkc5nnk6ma6m7rrs0w4vzswfc47ffxn5m0pwav1708nx1df")) 2735 (base32 "0l9jcmhqd2v97gy1bxvimwi3aajxhxqn6jkzzgg7cf42mpyza0vc"))
2736 (snippet 2736 (snippet
2737 #~(begin 2737 #~(begin
2738 (use-modules ((guix build utils))) 2738 (use-modules ((guix build utils)))
2739 ;; TODO: Unbundle the llhttp sources. 2739 (delete-file-recursively "vendor")))))
2740 ;; (delete-file-recursively "vendor")
2741 (delete-file "aiohttp/_http_parser.c")
2742 (delete-file "aiohttp/_http_writer.c")))))
2743 (build-system pyproject-build-system) 2740 (build-system pyproject-build-system)
2744 (arguments 2741 (arguments
2745 (list 2742 (list
2746 ;; tests: 3045 passed, 32 skipped, 29 xfailed, 2 subtests passed 2743 ;; tests: 4003 passed, 80 skipped, 31 xfailed, 2 subtests passed
2747 #:test-flags 2744 #:test-flags
2748 '(list 2745 #~(list "--numprocesses" (number->string (min 8 (parallel-job-count)))
2749 "-o" "addopts=''" ; Avoid -p pytest_cov. 2746 ;; This tests requires the 'proxy.py' module, not yet packaged.
2750 "-m" "not dev_mode" 2747 "--ignore=tests/test_proxy_functional.py"
2751 "--numprocesses" (number->string (parallel-job-count)) 2748 ;; No benchamrks.
2752 "--ignore=aiohttp/test_utils.py" 2749 "--ignore-glob=tests/test_benchmarks_*"
2753 ;; This tests requires the 'proxy.py' module, not yet packaged. 2750 "-k"
2754 "--ignore=tests/test_proxy_functional.py" 2751 (string-join
2755 ;; These tests need brotli. 2752 ;; Combinatin of tests failing with similar errors:
2756 "--ignore=tests/test_web_sendfile_functional.py" 2753 ;; - Cannot connect to host example.com:443 ssl:default [Could
2757 "--ignore=tests/test_web_functional.py" 2754 ;; not contact DNS servers].
2758 ;; These tests need pytest_codspeed 2755 ;; - aiohttp.http_exceptions.ContentEncodingError: 400.
2759 "--ignore-glob=tests/test_benchmarks*" 2756 ;; - Can not decode content-encoding: br
2760 ;; These tests need python_on_whales 2757 (list "not test_add_static_path_resolution"
2761 "--ignore=tests/autobahn/test_autobahn.py" 2758 "test_empty_header_name"
2762 "-k" 2759 "test_http_payload_brotli"
2763 ;; These tests fail for unknown reasons (see: 2760 "test_http_payload_zstandard"
2764 ;; https://github.com/aio-libs/aiohttp/issues/7130) 2761 "test_invalid_header_spacing"
2765 (string-append 2762 "test_payload_decompress_size_limit_brotli"
2766 "not test_no_warnings " 2763 "test_reject_obsolete_line_folding"
2767 "and not test_default_loop " 2764 "test_response_with_precompressed_body_brotli"
2768 "and not test_ctor_global_loop " 2765 "test_static_file_custom_content_type_compress"
2769 "and not test_set_loop_default_loop " 2766 "test_static_file_with_encoding_and_enable_compression"
2770 2767 "test_tcp_connector_ssl_shutdown_timeout_nonzero_passed"
2771 ;; Disable brotli tests, because we’re not providing that optional 2768 "test_tcp_connector_ssl_shutdown_timeout_passed_to_"
2772 ;; library. 2769 "test_tcp_connector_ssl_shutdown_timeout_zero_not_")
2773 "and not test_feed_eof_no_err_brotli " 2770 " and not "))
2774
2775 ;; Disable the following tests as they require
2776 ;; networking.
2777 "and not TestDeflateBuffer "
2778 "and not test_client_session_timeout_zero "
2779 "and not test_empty_body "
2780 "and not test_mark_formdata_as_processed[pyloop] "
2781 "and not test_receive_runtime_err[pyloop] "
2782
2783 ;; assert 'gzip, deflate' == 'gzip, deflate, br'
2784 "and not test_headers[pyloop] "
2785 ;; ~/.. does not resolve
2786 "and not test_add_static_path_resolution"))
2787 #:phases 2771 #:phases
2788 '(modify-phases %standard-phases 2772 #~(modify-phases %standard-phases
2789 (add-after 'unpack 'fix-tests 2773 (add-after 'unpack 'set-libllhtp-pkgconfig
2790 (lambda _ 2774 (lambda _
2791 ;; Make sure the timestamp of this file is > 1990, because a few 2775 ;; pkg-config can't find the libllhttp library.
2792 ;; tests like test_static_file_if_modified_since_past_date depend 2776 (if (getenv "PKG_CONFIG_PATH")
2793 ;; on it. 2777 (setenv "PKG_CONFIG_PATH"
2794 (let ((late-90s (* 60 60 24 365 30))) 2778 (string-append
2795 (utime "tests/data.unknown_mime_type" late-90s late-90s)))) 2779 #$(this-package-input "llhttp") "/lib/pkgconfig"
2796 (add-before 'build 'cythonize 2780 (getenv "PKG_CONFIG_PATH")))
2797 (lambda _ 2781 (setenv "PKG_CONFIG_PATH"
2798 ;; Adapted from the Makefile. 2782 (string-append
2799 (with-directory-excursion "aiohttp" 2783 #$(this-package-input "llhttp") "/lib/pkgconfig")))))
2800 (for-each 2784 (add-after 'unpack 'fix-pytest-config
2801 (lambda (file) 2785 (lambda _
2802 (invoke "cython" "-3" 2786 (substitute* "setup.cfg"
2803 file "-I" ".")) 2787 (("--numprocesses=auto") "")
2804 (find-files "." "_.*\\.pyx$")))))))) 2788 (("-p pytest_cov") "")
2805 (propagated-inputs 2789 (("--cov=aiohttp") "")
2806 (list python-aiohappyeyeballs 2790 (("--cov=tests/") ""))))
2807 python-aiosignal 2791 (add-after 'unpack 'fix-tests
2808 python-attrs 2792 (lambda _
2809 python-frozenlist 2793 ;; Make sure the timestamp of this file is > 1990, because a few
2810 python-multidict 2794 ;; tests like test_static_file_if_modified_since_past_date
2811 python-propcache 2795 ;; depend on it.
2812 python-yarl)) 2796 (let ((late-90s (* 60 60 24 365 30)))
2797 (utime "tests/data.unknown_mime_type" late-90s late-90s))))
2798 (add-before 'build 'pre-build
2799 (lambda _
2800 (setenv "USE_SYSTEM_DEPS" "true")
2801 ;; Help setup.py to determine project's root.
2802 (with-output-to-file ".git"
2803 (lambda () (display "")))
2804 (substitute* "Makefile"
2805 (("cythonize: .install-cython") "cythonize:"))
2806 (invoke "make" "cythonize")))
2807 (add-before 'check 'remove-local-source
2808 (lambda _
2809 (delete-file-recursively "aiohttp"))))))
2813 (native-inputs 2810 (native-inputs
2814 (list gunicorn-bootstrap 2811 (list gunicorn-bootstrap
2815 python-cython
2816 python-freezegun 2812 python-freezegun
2817 python-isal 2813 python-cython
2814 python-pkgconfig
2815 ;; python-proxy-py ;not packaged yet in Guix
2818 python-pytest 2816 python-pytest
2819 python-pytest-mock 2817 python-pytest-mock
2820 python-pytest-xdist 2818 python-pytest-xdist
2821 python-re-assert 2819 python-re-assert
2822 python-setuptools)) 2820 python-setuptools
2821 python-zlib-ng))
2822 (inputs
2823 (list llhttp))
2824 (propagated-inputs
2825 (list python-aiohappyeyeballs
2826 python-aiosignal
2827 python-attrs
2828 python-frozenlist
2829 python-multidict
2830 python-propcache
2831 python-yarl
2832 ;; [optional]
2833 python-aiodns
2834 python-backports-zstd ;Python version < 3.14
2835 python-brotli))
2823 (home-page "https://github.com/aio-libs/aiohttp/") 2836 (home-page "https://github.com/aio-libs/aiohttp/")
2824 (synopsis "Async HTTP client/server framework (asyncio)") 2837 (synopsis "Async HTTP client/server framework (asyncio)")
2825 (description "@code{aiohttp} is an asynchronous HTTP client/server 2838 (description "@code{aiohttp} is an asynchronous HTTP client/server