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, setuptools
16, sniffio
17, starlette
18, tiny-proxy
19, trio
20, trustme
21, yarl
22}:
23
24buildPythonPackage rec {
25 pname = "httpx-socks";
26 version = "0.8.0";
27 format = "pyproject";
28
29 disabled = pythonOlder "3.7";
30
31 src = fetchFromGitHub {
32 owner = "romis2012";
33 repo = pname;
34 rev = "refs/tags/v${version}";
35 hash = "sha256-3Dj+rrH5Pil5xQE6sAAD5RTycwlKq+TVsAeB2NVqGjY=";
36 };
37
38 nativeBuildInputs = [
39 setuptools
40 ];
41
42 propagatedBuildInputs = [
43 httpx
44 httpcore
45 python-socks
46 ];
47
48 passthru.optional-dependencies = {
49 asyncio = [
50 async-timeout
51 ];
52 trio = [
53 trio
54 ];
55 };
56
57 __darwinAllowLocalNetworking = true;
58
59 nativeCheckInputs = [
60 flask
61 hypercorn
62 pytest-asyncio
63 pytest-trio
64 pytestCheckHook
65 starlette
66 tiny-proxy
67 trustme
68 yarl
69 ];
70
71 pythonImportsCheck = [
72 "httpx_socks"
73 ];
74
75 disabledTests = [
76 # Tests don't work in the sandbox
77 "test_proxy"
78 "test_secure_proxy"
79 ];
80
81 meta = with lib; {
82 description = "Proxy (HTTP, SOCKS) transports for httpx";
83 homepage = "https://github.com/romis2012/httpx-socks";
84 changelog = "https://github.com/romis2012/httpx-socks/releases/tag/v${version}";
85 license = licenses.asl20;
86 maintainers = with maintainers; [ fab ];
87 };
88}