1{ lib
2, buildPythonPackage
3, pythonOlder
4, fetchFromGitHub
5, brotlicffi
6, certifi
7, charset-normalizer
8, h2
9, httpcore
10, rfc3986
11, sniffio
12, pytestCheckHook
13, pytest-asyncio
14, pytest-trio
15, typing-extensions
16, trustme
17, uvicorn
18}:
19
20buildPythonPackage rec {
21 pname = "httpx";
22 version = "0.19.0";
23 disabled = pythonOlder "3.6";
24
25 src = fetchFromGitHub {
26 owner = "encode";
27 repo = pname;
28 rev = version;
29 sha256 = "sha256-bUxxeUYqOHBmSL2gPQG5cIq6k5QY4Kyhj9ToA5yZXPA=";
30 };
31
32 propagatedBuildInputs = [
33 brotlicffi
34 certifi
35 charset-normalizer
36 h2
37 httpcore
38 rfc3986
39 sniffio
40 ];
41
42 checkInputs = [
43 pytestCheckHook
44 pytest-asyncio
45 pytest-trio
46 trustme
47 typing-extensions
48 uvicorn
49 ];
50
51 pythonImportsCheck = [ "httpx" ];
52
53 disabledTests = [
54 # httpcore.ConnectError: [Errno 101] Network is unreachable
55 "test_connect_timeout"
56 # httpcore.ConnectError: [Errno -2] Name or service not known
57 "test_async_proxy_close"
58 "test_sync_proxy_close"
59 ];
60
61 __darwinAllowLocalNetworking = true;
62
63 meta = with lib; {
64 description = "The next generation HTTP client";
65 homepage = "https://github.com/encode/httpx";
66 license = licenses.bsd3;
67 maintainers = with maintainers; [ costrouc fab ];
68 };
69}