1{ lib
2, async-timeout
3, buildPythonPackage
4, curio
5, fetchFromGitHub
6, flask
7, httpcore
8, httpx
9, hypercorn
10, pytest-asyncio
11, pytest-trio
12, pytestCheckHook
13, python-socks
14, pythonOlder
15, sniffio
16, starlette
17, trio
18, yarl
19}:
20
21buildPythonPackage rec {
22 pname = "httpx-socks";
23 version = "0.7.5";
24 format = "setuptools";
25
26 disabled = pythonOlder "3.7";
27
28 src = fetchFromGitHub {
29 owner = "romis2012";
30 repo = pname;
31 rev = "refs/tags/v${version}";
32 hash = "sha256-HwLJ2pScgiNmM/l14aKp47MMuGW1qSaIq7ujpCSRtqA=";
33 };
34
35 propagatedBuildInputs = [
36 httpx
37 httpcore
38 python-socks
39 ];
40
41 passthru.optional-dependencies = {
42 asyncio = [
43 async-timeout
44 ];
45 trio = [
46 trio
47 ];
48 };
49
50 nativeCheckInputs = [
51 flask
52 hypercorn
53 pytest-asyncio
54 pytest-trio
55 pytestCheckHook
56 starlette
57 yarl
58 ];
59
60 pythonImportsCheck = [
61 "httpx_socks"
62 ];
63
64 disabledTests = [
65 # Tests don't work in the sandbox
66 "test_proxy"
67 "test_secure_proxy"
68 ];
69
70 meta = with lib; {
71 description = "Proxy (HTTP, SOCKS) transports for httpx";
72 homepage = "https://github.com/romis2012/httpx-socks";
73 changelog = "https://github.com/romis2012/httpx-socks/releases/tag/v${version}";
74 license = licenses.asl20;
75 maintainers = with maintainers; [ fab ];
76 };
77}