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

buildPythonPackage rec {
  pname = "httpcore";
  version = "0.13.6";
  disabled = pythonOlder "3.6";

  src = fetchFromGitHub {
    owner = "encode";
    repo = pname;
    rev = version;
    sha256 = "sha256-7G7jchOQTgcFSGZfoMPFm0NY9ofg5MM5Xn5lV+W9w8k=";
  };

  propagatedBuildInputs = [
    anyio
    h11
    h2
    sniffio
  ];

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

  disabledTestPaths = [
    # these tests fail during dns lookups: httpcore.ConnectError: [Errno -2] Name or service not known
    "tests/test_threadsafety.py"
    "tests/async_tests/"
    "tests/sync_tests/test_interfaces.py"
    "tests/sync_tests/test_retries.py"
  ];

  pythonImportsCheck = [ "httpcore" ];

  meta = with lib; {
    description = "A minimal low-level HTTP client";
    homepage = "https://github.com/encode/httpcore";
    license = licenses.bsd3;
    maintainers = with maintainers; [ ris ];
  };
}