Something went wrong. Try again.
What happens if I push all of nixpkgs
Something went wrong. Try again.
3.7 kB · 174 lines
Nix
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175{ lib, stdenv, buildPythonPackage, fetchFromGitHub, replaceVars, isPy310, isPyPy,
# build-system cython_3_1, pkgconfig, setuptools,
# native dependencies llhttp,
# dependencies aiohappyeyeballs, aiosignal, async-timeout, attrs, frozenlist, multidict, propcache, yarl,
# optional dependencies aiodns, brotli, brotlicffi,
# tests blockbuster, freezegun, gunicorn, isa-l, isal, proxy-py, pytest-codspeed, pytest-cov-stub, pytest-mock, pytest-xdist, pytestCheckHook, python-on-whales, re-assert, trustme, zlib-ng,}:
buildPythonPackage rec { pname = "aiohttp"; version = "3.12.14"; pyproject = true;
src = fetchFromGitHub { owner = "aio-libs"; repo = "aiohttp"; tag = "v${version}"; hash = "sha256-KPPxP6x/3sz2mDJNswh/xPatcMtVdYv3aArg//7tSao="; };
patches = lib.optionals (!lib.meta.availableOn stdenv.hostPlatform isa-l) [ ./remove-isal.patch ];
postPatch = '' rm -r vendor patchShebangs tools touch .git # tools/gen.py uses .git to find the project root
# don't install Cython using pip substituteInPlace Makefile \ --replace-fail "cythonize: .install-cython" "cythonize:" '';
build-system = [ cython_3_1 pkgconfig setuptools ];
preBuild = '' make cythonize '';
buildInputs = [ llhttp ];
env.AIOHTTP_USE_SYSTEM_DEPS = true;
dependencies = [ aiohappyeyeballs aiosignal async-timeout attrs frozenlist multidict propcache yarl ] ++ optional-dependencies.speedups;
optional-dependencies.speedups = [ aiodns (if isPyPy then brotlicffi else brotli) ];
nativeCheckInputs = [ blockbuster freezegun gunicorn # broken on aarch64-darwin (if lib.meta.availableOn stdenv.hostPlatform isa-l then isal else null) proxy-py pytest-codspeed pytest-cov-stub pytest-mock pytest-xdist pytestCheckHook python-on-whales re-assert trustme zlib-ng ];
disabledTests = [ # Disable tests that require network access "test_client_session_timeout_zero" "test_mark_formdata_as_processed" "test_requote_redirect_url_default" "test_tcp_connector_ssl_shutdown_timeout_nonzero_passed" "test_tcp_connector_ssl_shutdown_timeout_zero_not_passed" # don't run benchmarks "test_import_time" # racy "test_uvloop_secure_https_proxy" # Cannot connect to host example.com:443 ssl:default [Could not contact DNS servers] "test_tcp_connector_ssl_shutdown_timeout_passed_to_create_connection" ] # these tests fail with python310 but succeeds with 11+ ++ lib.optionals isPy310 [ "test_https_proxy_unsupported_tls_in_tls" "test_tcp_connector_raise_connector_ssl_error" ] ++ lib.optionals stdenv.hostPlatform.is32bit [ "test_cookiejar" ] ++ lib.optionals stdenv.hostPlatform.isDarwin [ "test_addresses" # https://github.com/aio-libs/aiohttp/issues/3572, remove >= v4.0.0 "test_close" ];
__darwinAllowLocalNetworking = true;
preCheck = '' # aiohttp in current folder shadows installed version rm -r aiohttp touch tests/data.unknown_mime_type # has to be modified after 1 Jan 1990
export HOME=$(mktemp -d) '' + lib.optionalString stdenv.hostPlatform.isDarwin '' # Work around "OSError: AF_UNIX path too long" export TMPDIR="/tmp" '';
meta = with lib; { changelog = "https://docs.aiohttp.org/en/${src.tag}/changes.html"; description = "Asynchronous HTTP Client/Server for Python and asyncio"; license = licenses.asl20; homepage = "https://github.com/aio-libs/aiohttp"; maintainers = with maintainers; [ dotlambda ]; };}