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.4";
24 format = "setuptools";
25
26 disabled = pythonOlder "3.6";
27
28 src = fetchFromGitHub {
29 owner = "romis2012";
30 repo = pname;
31 rev = "refs/tags/v${version}";
32 sha256 = "sha256-+eWGmCHkXQA+JaEgofqUeFyGyMxSctal+jsqsShFM58=";
33 };
34
35 propagatedBuildInputs = [
36 httpx
37 httpcore
38 python-socks
39 ];
40
41 passthru.optional-dependencies = {
42 asyncio = [ async-timeout ];
43 trio = [ trio ];
44 };
45
46 checkInputs = [
47 flask
48 hypercorn
49 pytest-asyncio
50 pytest-trio
51 pytestCheckHook
52 starlette
53 yarl
54 ];
55
56 pythonImportsCheck = [
57 "httpx_socks"
58 ];
59
60 disabledTests = [
61 # Tests don't work in the sandbox
62 "test_proxy"
63 "test_secure_proxy"
64 ];
65
66 meta = with lib; {
67 description = "Proxy (HTTP, SOCKS) transports for httpx";
68 homepage = "https://github.com/romis2012/httpx-socks";
69 license = licenses.asl20;
70 maintainers = with maintainers; [ fab ];
71 };
72}