nixpkgs/pkgs/servers/sql/patroni/default.nix

64 lines
1.3 KiB
Nix
Raw Normal View History

2021-02-03 10:13:48 +01:00
{ lib
, pythonPackages
, fetchFromGitHub
}:
2020-02-17 06:54:18 +01:00
pythonPackages.buildPythonApplication rec {
pname = "patroni";
2021-02-23 09:10:18 +01:00
version = "2.0.2";
2020-02-17 06:54:18 +01:00
src = fetchFromGitHub {
owner = "zalando";
repo = pname;
rev = "v${version}";
2021-02-23 09:10:18 +01:00
sha256 = "048g211njwmgl2v7nx6x5x82b4bbp35n234z7ah10aybm3yrxnc7";
2020-02-17 06:54:18 +01:00
};
# cdiff renamed to ydiff; remove when patroni source reflects this.
postPatch = ''
for i in requirements.txt patroni/ctl.py tests/test_ctl.py; do
substituteInPlace $i --replace cdiff ydiff
done
'';
propagatedBuildInputs = with pythonPackages; [
boto
click
consul
dns
kazoo
kubernetes
prettytable
psutil
psycopg2
2021-02-03 10:13:48 +01:00
pysyncobj
2020-02-17 06:54:18 +01:00
python-dateutil
python-etcd
pyyaml
tzlocal
urllib3
ydiff
];
checkInputs = with pythonPackages; [
flake8
mock
2020-11-03 02:20:14 +01:00
pytestCheckHook
2021-02-03 10:13:48 +01:00
pytest-cov
2020-02-17 06:54:18 +01:00
requests
];
# Fix tests by preventing them from writing to /homeless-shelter.
preCheck = "export HOME=$(mktemp -d)";
2021-02-03 10:13:48 +01:00
pythonImportsCheck = [ "patroni" ];
2020-02-17 06:54:18 +01:00
meta = with lib; {
homepage = "https://patroni.readthedocs.io/en/latest/";
description = "A Template for PostgreSQL HA with ZooKeeper, etcd or Consul";
license = licenses.mit;
platforms = platforms.linux;
maintainers = teams.deshaw.members;
2020-02-17 06:54:18 +01:00
};
}