2021-08-05 21:33:18 +00:00
|
|
|
{ lib
|
|
|
|
, async-timeout
|
|
|
|
, buildPythonPackage
|
|
|
|
, curio
|
|
|
|
, fetchFromGitHub
|
|
|
|
, flask
|
|
|
|
, httpcore
|
|
|
|
, httpx
|
2021-12-26 17:43:05 +00:00
|
|
|
, hypercorn
|
2021-08-05 21:33:18 +00:00
|
|
|
, pytest-asyncio
|
|
|
|
, pytest-trio
|
|
|
|
, pytestCheckHook
|
|
|
|
, python-socks
|
|
|
|
, pythonOlder
|
2023-07-15 17:15:38 +00:00
|
|
|
, setuptools
|
2021-08-05 21:33:18 +00:00
|
|
|
, sniffio
|
2021-12-26 17:43:05 +00:00
|
|
|
, starlette
|
2023-07-15 17:15:38 +00:00
|
|
|
, tiny-proxy
|
2021-08-05 21:33:18 +00:00
|
|
|
, trio
|
2023-07-15 17:15:38 +00:00
|
|
|
, trustme
|
2021-08-05 21:33:18 +00:00
|
|
|
, yarl
|
|
|
|
}:
|
|
|
|
|
|
|
|
buildPythonPackage rec {
|
|
|
|
pname = "httpx-socks";
|
2023-07-15 17:15:38 +00:00
|
|
|
version = "0.7.6";
|
|
|
|
format = "pyproject";
|
2021-12-26 17:43:05 +00:00
|
|
|
|
2022-11-27 09:42:12 +00:00
|
|
|
disabled = pythonOlder "3.7";
|
2021-08-05 21:33:18 +00:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "romis2012";
|
|
|
|
repo = pname;
|
2022-06-16 17:23:12 +00:00
|
|
|
rev = "refs/tags/v${version}";
|
2023-07-15 17:15:38 +00:00
|
|
|
hash = "sha256-rLcYC8IO2eCWAL4QIiUg/kyigybq6VNTUjNDXx4KPHc=";
|
2021-08-05 21:33:18 +00:00
|
|
|
};
|
|
|
|
|
2023-07-15 17:15:38 +00:00
|
|
|
nativeBuildInputs = [
|
|
|
|
setuptools
|
|
|
|
];
|
|
|
|
|
2021-08-05 21:33:18 +00:00
|
|
|
propagatedBuildInputs = [
|
|
|
|
httpx
|
2022-05-18 14:49:53 +00:00
|
|
|
httpcore
|
2021-08-05 21:33:18 +00:00
|
|
|
python-socks
|
|
|
|
];
|
|
|
|
|
2022-06-16 17:23:12 +00:00
|
|
|
passthru.optional-dependencies = {
|
2022-11-27 09:42:12 +00:00
|
|
|
asyncio = [
|
|
|
|
async-timeout
|
|
|
|
];
|
|
|
|
trio = [
|
|
|
|
trio
|
|
|
|
];
|
2022-05-18 14:49:53 +00:00
|
|
|
};
|
|
|
|
|
2023-08-22 20:05:09 +00:00
|
|
|
__darwinAllowLocalNetworking = true;
|
|
|
|
|
2023-02-02 18:25:31 +00:00
|
|
|
nativeCheckInputs = [
|
2021-08-05 21:33:18 +00:00
|
|
|
flask
|
2021-12-26 17:43:05 +00:00
|
|
|
hypercorn
|
2021-08-05 21:33:18 +00:00
|
|
|
pytest-asyncio
|
|
|
|
pytest-trio
|
|
|
|
pytestCheckHook
|
2021-12-26 17:43:05 +00:00
|
|
|
starlette
|
2023-07-15 17:15:38 +00:00
|
|
|
tiny-proxy
|
|
|
|
trustme
|
2021-08-05 21:33:18 +00:00
|
|
|
yarl
|
|
|
|
];
|
|
|
|
|
2021-12-26 17:43:05 +00:00
|
|
|
pythonImportsCheck = [
|
|
|
|
"httpx_socks"
|
|
|
|
];
|
2021-08-05 21:33:18 +00:00
|
|
|
|
2022-02-20 05:27:41 +00:00
|
|
|
disabledTests = [
|
|
|
|
# Tests don't work in the sandbox
|
|
|
|
"test_proxy"
|
|
|
|
"test_secure_proxy"
|
|
|
|
];
|
|
|
|
|
2021-08-05 21:33:18 +00:00
|
|
|
meta = with lib; {
|
|
|
|
description = "Proxy (HTTP, SOCKS) transports for httpx";
|
|
|
|
homepage = "https://github.com/romis2012/httpx-socks";
|
2022-11-27 09:42:12 +00:00
|
|
|
changelog = "https://github.com/romis2012/httpx-socks/releases/tag/v${version}";
|
2021-08-05 21:33:18 +00:00
|
|
|
license = licenses.asl20;
|
|
|
|
maintainers = with maintainers; [ fab ];
|
|
|
|
};
|
|
|
|
}
|