1{ lib
2, stdenv
3, buildPythonPackage
4, fetchPypi
5, pythonOlder
6, pythonAtLeast
7, attrs
8, chardet
9, multidict
10, async-timeout
11, yarl
12, idna-ssl
13, typing-extensions
14, pytestrunner
15, pytest
16, gunicorn
17, pytest-timeout
18, async_generator
19, pytest_xdist
20, pytestcov
21, pytest-mock
22, trustme
23, brotlipy
24, freezegun
25}:
26
27buildPythonPackage rec {
28 pname = "aiohttp";
29 version = "3.6.2";
30 # https://github.com/aio-libs/aiohttp/issues/4525 python3.8 failures
31 disabled = pythonOlder "3.5" || pythonAtLeast "3.8";
32
33 src = fetchPypi {
34 inherit pname version;
35 sha256 = "09pkw6f1790prnrq0k8cqgnf1qy57ll8lpmc6kld09q7zw4vi6i5";
36 };
37
38 checkInputs = [
39 pytestrunner pytest gunicorn pytest-timeout async_generator pytest_xdist
40 pytest-mock pytestcov trustme brotlipy freezegun
41 ];
42
43 propagatedBuildInputs = [ attrs chardet multidict async-timeout yarl ]
44 ++ lib.optionals (pythonOlder "3.7") [ idna-ssl typing-extensions ];
45
46 # disable tests which attempt to do loopback connections
47 checkPhase = ''
48 cd tests
49 pytest -k "not get_valid_log_format_exc \
50 and not test_access_logger_atoms \
51 and not aiohttp_request_coroutine \
52 and not server_close_keepalive_connection \
53 and not connector \
54 and not client_disconnect \
55 and not handle_keepalive_on_closed_connection \
56 and not proxy_https_bad_response \
57 and not partially_applied_handler \
58 ${lib.optionalString stdenv.is32bit "and not test_cookiejar"} \
59 and not middleware" \
60 --ignore=test_connector.py
61 '';
62
63 meta = with lib; {
64 description = "Asynchronous HTTP Client/Server for Python and asyncio";
65 license = licenses.asl20;
66 homepage = https://github.com/aio-libs/aiohttp;
67 maintainers = with maintainers; [ dotlambda ];
68 };
69}