2020-02-17 06:54:18 +01:00
|
|
|
{ lib, pythonPackages, fetchFromGitHub }:
|
|
|
|
|
|
|
|
pythonPackages.buildPythonApplication rec {
|
|
|
|
pname = "patroni";
|
2020-05-04 05:53:07 +02:00
|
|
|
version = "1.6.5";
|
2020-02-17 06:54:18 +01:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "zalando";
|
|
|
|
repo = pname;
|
|
|
|
rev = "v${version}";
|
2020-05-04 05:53:07 +02:00
|
|
|
sha256 = "0iw0ra9fya4bf1vkjq3w5kij4x46yinb90v015pi9c6qfpancfdj";
|
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
|
|
|
|
python-dateutil
|
|
|
|
python-etcd
|
|
|
|
pyyaml
|
|
|
|
tzlocal
|
|
|
|
urllib3
|
|
|
|
ydiff
|
|
|
|
];
|
|
|
|
|
|
|
|
checkInputs = with pythonPackages; [
|
|
|
|
flake8
|
|
|
|
mock
|
2020-11-03 02:20:14 +01:00
|
|
|
pytestCheckHook
|
2020-02-17 06:54:18 +01:00
|
|
|
pytestcov
|
|
|
|
requests
|
|
|
|
];
|
|
|
|
|
|
|
|
# Fix tests by preventing them from writing to /homeless-shelter.
|
|
|
|
preCheck = "export HOME=$(mktemp -d)";
|
|
|
|
|
|
|
|
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;
|
2021-01-07 16:44:08 +01:00
|
|
|
maintainers = teams.deshaw.members;
|
2020-02-17 06:54:18 +01:00
|
|
|
};
|
|
|
|
}
|