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