depot/third_party/nixpkgs/pkgs/development/python-modules/entrance/default.nix
Default email bcb2f287e1 Project import generated by Copybara.
GitOrigin-RevId: d603719ec6e294f034936c0d0dc06f689d91b6c3
2024-06-20 20:27:18 +05:30

65 lines
1.3 KiB
Nix

{
lib,
fetchPypi,
buildPythonPackage,
pythonOlder,
routerFeatures,
janus,
ncclient,
paramiko,
pyyaml,
sanic,
}:
let
# The `routerFeatures` flag optionally brings in some somewhat heavy
# dependencies, in order to enable interacting with routers
opts =
if routerFeatures then
{
prePatch = ''
substituteInPlace ./setup.py --replace "extra_deps = []" "extra_deps = router_feature_deps"
'';
extraBuildInputs = [
janus
ncclient
paramiko
];
}
else
{
prePatch = "";
extraBuildInputs = [ ];
};
in
buildPythonPackage rec {
pname = "entrance";
version = "1.1.20";
format = "setuptools";
src = fetchPypi {
inherit pname version;
hash = "sha256-PvsP6HXCllW102h3o7abz9uC2AZTwvg5qIqP+rdkk6Y=";
};
# The versions of `sanic` and `websockets` in nixpkgs only support 3.6 or later
disabled = pythonOlder "3.6";
# No useful tests
doCheck = false;
propagatedBuildInputs = [
pyyaml
sanic
] ++ opts.extraBuildInputs;
prePatch = opts.prePatch;
meta = with lib; {
description = "Server framework for web apps with an Elm frontend";
homepage = "https://github.com/ensoft/entrance";
license = licenses.mit;
maintainers = with maintainers; [ simonchatts ];
};
}