summary refs log tree commit diff
path: root/pkgs/development/python-modules/aiohttp/default.nix
blob: 737d1eec3c2113d3c7e0b18b6c4dcd208b0a9d48 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
{ lib
, stdenv
, buildPythonPackage
, fetchPypi
, pythonOlder
, pythonAtLeast
, attrs
, chardet
, multidict
, async-timeout
, yarl
, idna-ssl
, typing-extensions
, pytestrunner
, pytest
, gunicorn
, pytest-timeout
, async_generator
, pytest_xdist
, pytestcov
, pytest-mock
, trustme
, brotlipy
, freezegun
}:

buildPythonPackage rec {
  pname = "aiohttp";
  version = "3.6.2";
  # https://github.com/aio-libs/aiohttp/issues/4525 python3.8 failures
  disabled = pythonOlder "3.5" || pythonAtLeast "3.8";

  src = fetchPypi {
    inherit pname version;
    sha256 = "09pkw6f1790prnrq0k8cqgnf1qy57ll8lpmc6kld09q7zw4vi6i5";
  };

  checkInputs = [
    pytestrunner pytest gunicorn pytest-timeout async_generator pytest_xdist
    pytest-mock pytestcov trustme brotlipy freezegun
  ];

  propagatedBuildInputs = [ attrs chardet multidict async-timeout yarl ]
    ++ lib.optionals (pythonOlder "3.7") [ idna-ssl typing-extensions ];

  # disable tests which attempt to do loopback connections
  checkPhase = ''
    cd tests
    pytest -k "not get_valid_log_format_exc \
               and not test_access_logger_atoms \
               and not aiohttp_request_coroutine \
               and not server_close_keepalive_connection \
               and not connector \
               and not client_disconnect \
               and not handle_keepalive_on_closed_connection \
               and not proxy_https_bad_response \
               and not partially_applied_handler \
               ${lib.optionalString stdenv.is32bit "and not test_cookiejar"} \
               and not middleware" \
      --ignore=test_connector.py
  '';

  meta = with lib; {
    description = "Asynchronous HTTP Client/Server for Python and asyncio";
    license = licenses.asl20;
    homepage = https://github.com/aio-libs/aiohttp;
    maintainers = with maintainers; [ dotlambda ];
  };
}