2024-06-05 15:53:02 +00:00
|
|
|
{
|
|
|
|
lib,
|
|
|
|
buildPythonPackage,
|
|
|
|
fetchFromGitHub,
|
|
|
|
pycryptodome,
|
|
|
|
uvloop,
|
|
|
|
setuptools,
|
|
|
|
pythonOlder,
|
2020-04-24 23:36:52 +00:00
|
|
|
}:
|
|
|
|
|
|
|
|
buildPythonPackage rec {
|
|
|
|
pname = "pproxy";
|
2024-04-21 15:54:59 +00:00
|
|
|
version = "2.7.9";
|
|
|
|
pyproject = true;
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2024-04-21 15:54:59 +00:00
|
|
|
disabled = pythonOlder "3.6";
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "qwj";
|
|
|
|
repo = "python-proxy";
|
2020-12-03 08:41:04 +00:00
|
|
|
rev = "7fccf8dd62204f34b0aa3a70fc568fd6ddff7728";
|
2024-04-21 15:54:59 +00:00
|
|
|
sha256 = "sha256-bOqDdNiaZ5MRi/UeF0hJwMs+rfQBKRsTmXrZ6ieIguo=";
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
|
2024-06-05 15:53:02 +00:00
|
|
|
nativeBuildInputs = [ setuptools ];
|
2024-04-21 15:54:59 +00:00
|
|
|
|
2020-04-24 23:36:52 +00:00
|
|
|
propagatedBuildInputs = [
|
|
|
|
pycryptodome
|
|
|
|
uvloop
|
|
|
|
];
|
|
|
|
|
2024-06-05 15:53:02 +00:00
|
|
|
pythonImportsCheck = [ "pproxy" ];
|
2024-04-21 15:54:59 +00:00
|
|
|
|
|
|
|
disabledTests = [
|
|
|
|
# Tests try to connect to outside Internet, so disabled
|
|
|
|
"api_server"
|
|
|
|
"api_client"
|
|
|
|
];
|
|
|
|
|
2020-04-24 23:36:52 +00:00
|
|
|
# test suite doesn't use test runner. so need to run ``python ./tests/*``
|
|
|
|
checkPhase = ''
|
|
|
|
shopt -s extglob
|
|
|
|
for f in ./tests/!(${builtins.concatStringsSep "|" disabledTests}).py ; do
|
|
|
|
echo "***Testing $f***"
|
|
|
|
eval "python $f"
|
|
|
|
done
|
|
|
|
'';
|
|
|
|
|
|
|
|
meta = with lib; {
|
|
|
|
description = "Proxy server that can tunnel among remote servers by regex rules";
|
2024-04-21 15:54:59 +00:00
|
|
|
mainProgram = "pproxy";
|
2020-04-24 23:36:52 +00:00
|
|
|
homepage = "https://github.com/qwj/python-proxy";
|
|
|
|
license = licenses.mit;
|
|
|
|
maintainers = with maintainers; [ drewrisinger ];
|
|
|
|
};
|
|
|
|
}
|