30 buildPythonPackage rec {
35 disabled = pythonOlder "3.8";
37 src = fetchFromGitHub {
40 rev = "refs/tags/v${version}";
41 hash = "sha256-dEeMHruFJ1o0J6VUJcpUk7LhEC8sV8hUKXoKcd618lE=";
46 src = ./unvendor-llhttp.patch;
47 llhttpDev = lib.getDev llhttp;
48 llhttpLib = lib.getLib llhttp;
53 sed -i '/--cov/d' setup.cfg
57 touch .git # tools/gen.py uses .git to find the project root
69 propagatedBuildInputs = [
80 # NOTE: pytest-xdist cannot be added because it is flaky. See https://github.com/NixOS/nixpkgs/issues/230597 for more info.
88 ] ++ lib.optionals (!(stdenv.isDarwin && stdenv.isAarch64)) [
89 # Optional test dependency. Depends indirectly on pyopenssl, which is
90 # broken on aarch64-darwin.
95 # Disable tests that require network access
96 "test_client_session_timeout_zero"
97 "test_mark_formdata_as_processed"
98 "test_requote_redirect_url_default"
99 # Disable tests that trigger deprecation warnings in pytest
100 "test_async_with_session"
101 "test_session_close_awaitable"
102 "test_close_run_until_complete_not_deprecated"
103 # https://github.com/aio-libs/aiohttp/issues/7130
104 "test_static_file_if_none_match"
105 "test_static_file_if_match"
106 "test_static_file_if_modified_since_past_date"
107 # don't run benchmarks
109 ] ++ lib.optionals stdenv.is32bit [
111 ] ++ lib.optionals stdenv.isDarwin [
112 "test_addresses" # https://github.com/aio-libs/aiohttp/issues/3572, remove >= v4.0.0
116 disabledTestPaths = [
117 "tests/test_proxy_functional.py" # FIXME package proxy.py
120 __darwinAllowLocalNetworking = true;
122 # aiohttp in current folder shadows installed version
125 touch tests/data.unknown_mime_type # has to be modified after 1 Jan 1990
126 '' + lib.optionalString stdenv.isDarwin ''
127 # Work around "OSError: AF_UNIX path too long"
132 changelog = "https://github.com/aio-libs/aiohttp/blob/v${version}/CHANGES.rst";
133 description = "Asynchronous HTTP Client/Server for Python and asyncio";
134 license = licenses.asl20;
135 homepage = "https://github.com/aio-libs/aiohttp";
136 maintainers = with maintainers; [ dotlambda ];