summary refs log tree commit diff
path: root/pkgs/development/python-modules/httpx/default.nix
blob: e5db065defcdbe748ceedde849fd817a2aee83e1 (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
{ lib
, buildPythonPackage
, pythonOlder
, fetchFromGitHub
, brotli
, certifi
, h2
, httpcore
, rfc3986
, sniffio
, pytestCheckHook
, pytest-asyncio
, pytest-trio
, pytest-cov
, trustme
, uvicorn
}:

buildPythonPackage rec {
  pname = "httpx";
  version = "0.18.0";
  disabled = pythonOlder "3.6";

  src = fetchFromGitHub {
    owner = "encode";
    repo = pname;
    rev = version;
    sha256 = "sha256-6EYBTRXaVHBgW/JzZvWLz55AqgocOyym2FVtu2Nkp/U=";
  };

  propagatedBuildInputs = [
    brotli
    certifi
    h2
    httpcore
    rfc3986
    sniffio
  ];

  checkInputs = [
    pytestCheckHook
    pytest-asyncio
    pytest-trio
    pytest-cov
    trustme
    uvicorn
  ];

  pythonImportsCheck = [ "httpx" ];

  disabledTests = [
    # httpcore.ConnectError: [Errno 101] Network is unreachable
    "test_connect_timeout"
    # httpcore.ConnectError: [Errno -2] Name or service not known
    "test_async_proxy_close"
    "test_sync_proxy_close"
  ];

  __darwinAllowLocalNetworking = true;

  meta = with lib; {
    description = "The next generation HTTP client";
    homepage = "https://github.com/encode/httpx";
    license = licenses.bsd3;
    maintainers = [ maintainers.costrouc ];
  };
}