1{ lib
2, buildPythonPackage
3, fetchFromGitHub
4, certifi
5, hstspreload
6, chardet
7, h11
8, h2
9, idna
10, rfc3986
11, sniffio
12, isPy27
13, pytest
14, pytestcov
15, trustme
16, uvicorn
17, trio
18, brotli
19}:
20
21buildPythonPackage rec {
22 pname = "httpx";
23 version = "0.9.5";
24 disabled = isPy27;
25
26 src = fetchFromGitHub {
27 owner = "encode";
28 repo = pname;
29 rev = version;
30 sha256 = "140z2j7b5hlcxvfb433hqv5b8irqa88hpq33lzr9m992djbhj2hb";
31 };
32
33 propagatedBuildInputs = [
34 certifi
35 hstspreload
36 chardet
37 h11
38 h2
39 idna
40 rfc3986
41 sniffio
42 ];
43
44 checkInputs = [
45 pytest
46 pytestcov
47 trustme
48 uvicorn
49 trio
50 brotli
51 ];
52
53 postPatch = ''
54 substituteInPlace setup.py \
55 --replace "h11==0.8.*" "h11"
56 '';
57
58 checkPhase = ''
59 PYTHONPATH=.:$PYTHONPATH pytest
60 '';
61
62 meta = with lib; {
63 description = "The next generation HTTP client";
64 homepage = https://github.com/encode/httpx;
65 license = licenses.bsd3;
66 maintainers = [ maintainers.costrouc ];
67 };
68}