depot/third_party/nixpkgs/pkgs/servers/sql/patroni/default.nix
Default email ae91cbe6cc Project import generated by Copybara.
GitOrigin-RevId: 536fe36e23ab0fc8b7f35c24603422eee9fc17a2
2021-02-05 18:12:51 +01:00

63 lines
1.3 KiB
Nix

{ lib
, pythonPackages
, fetchFromGitHub
}:
pythonPackages.buildPythonApplication rec {
pname = "patroni";
version = "2.0.1";
src = fetchFromGitHub {
owner = "zalando";
repo = pname;
rev = "v${version}";
sha256 = "sha256-IlRltJrEMrRiwVVMYQywb0MqwEoL8MX3do2GlHXjuPc=";
};
# 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
pysyncobj
python-dateutil
python-etcd
pyyaml
tzlocal
urllib3
ydiff
];
checkInputs = with pythonPackages; [
flake8
mock
pytestCheckHook
pytest-cov
requests
];
# Fix tests by preventing them from writing to /homeless-shelter.
preCheck = "export HOME=$(mktemp -d)";
pythonImportsCheck = [ "patroni" ];
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;
};
}