2021-02-05 17:12:51 +00:00
|
|
|
{ lib
|
|
|
|
, pythonPackages
|
|
|
|
, fetchFromGitHub
|
2022-08-21 13:32:41 +00:00
|
|
|
, nixosTests
|
2021-02-05 17:12:51 +00:00
|
|
|
}:
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
pythonPackages.buildPythonApplication rec {
|
|
|
|
pname = "patroni";
|
2024-06-20 14:57:18 +00:00
|
|
|
version = "3.3.1";
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "zalando";
|
|
|
|
repo = pname;
|
2024-06-20 14:57:18 +00:00
|
|
|
rev = "refs/tags/v${version}";
|
|
|
|
sha256 = "sha256-GyPPBoYcJnuMer9FYGhWqursX/qJLaAlc9zFULoJqo4=";
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
propagatedBuildInputs = with pythonPackages; [
|
2024-05-15 15:35:15 +00:00
|
|
|
boto3
|
2020-04-24 23:36:52 +00:00
|
|
|
click
|
|
|
|
consul
|
2021-06-28 23:13:55 +00:00
|
|
|
dnspython
|
2020-04-24 23:36:52 +00:00
|
|
|
kazoo
|
|
|
|
kubernetes
|
|
|
|
prettytable
|
|
|
|
psutil
|
|
|
|
psycopg2
|
2021-02-05 17:12:51 +00:00
|
|
|
pysyncobj
|
2020-04-24 23:36:52 +00:00
|
|
|
python-dateutil
|
|
|
|
python-etcd
|
|
|
|
pyyaml
|
|
|
|
tzlocal
|
|
|
|
urllib3
|
|
|
|
ydiff
|
|
|
|
];
|
|
|
|
|
2023-02-02 18:25:31 +00:00
|
|
|
nativeCheckInputs = with pythonPackages; [
|
2020-04-24 23:36:52 +00:00
|
|
|
flake8
|
|
|
|
mock
|
2020-11-06 00:33:48 +00:00
|
|
|
pytestCheckHook
|
2021-02-05 17:12:51 +00:00
|
|
|
pytest-cov
|
2020-04-24 23:36:52 +00:00
|
|
|
requests
|
|
|
|
];
|
|
|
|
|
|
|
|
# Fix tests by preventing them from writing to /homeless-shelter.
|
|
|
|
preCheck = "export HOME=$(mktemp -d)";
|
|
|
|
|
2021-02-05 17:12:51 +00:00
|
|
|
pythonImportsCheck = [ "patroni" ];
|
|
|
|
|
2022-08-21 13:32:41 +00:00
|
|
|
passthru.tests = {
|
|
|
|
patroni = nixosTests.patroni;
|
|
|
|
};
|
|
|
|
|
2020-04-24 23:36:52 +00:00
|
|
|
meta = with lib; {
|
|
|
|
homepage = "https://patroni.readthedocs.io/en/latest/";
|
2024-06-20 14:57:18 +00:00
|
|
|
description = "Template for PostgreSQL HA with ZooKeeper, etcd or Consul";
|
2020-04-24 23:36:52 +00:00
|
|
|
license = licenses.mit;
|
2022-04-27 09:35:20 +00:00
|
|
|
platforms = platforms.unix;
|
2021-01-09 10:05:03 +00:00
|
|
|
maintainers = teams.deshaw.members;
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
}
|