about summary refs log tree commit diff
path: root/pkgs/servers
diff options
context:
space:
mode:
authorGraham Christensen <graham@grahamc.com>2020-02-25 09:55:36 -0500
committerGitHub <noreply@github.com>2020-02-25 09:55:36 -0500
commitb6f8e000605980df258e438bc58f29ed1472c109 (patch)
treec1de760439fd3923333c1acd5fb3b612a6060017 /pkgs/servers
parent8246c35875d1564b99e2e65db229abaa11a09386 (diff)
parente6c42d3740077defd180abcc4e1e2a86ceca9b48 (diff)
downloadnixlib-b6f8e000605980df258e438bc58f29ed1472c109.tar
nixlib-b6f8e000605980df258e438bc58f29ed1472c109.tar.gz
nixlib-b6f8e000605980df258e438bc58f29ed1472c109.tar.bz2
nixlib-b6f8e000605980df258e438bc58f29ed1472c109.tar.lz
nixlib-b6f8e000605980df258e438bc58f29ed1472c109.tar.xz
nixlib-b6f8e000605980df258e438bc58f29ed1472c109.tar.zst
nixlib-b6f8e000605980df258e438bc58f29ed1472c109.zip
Merge pull request #80696 from deshaw/contrib/patroni
patroni: init at 1.6.4
Diffstat (limited to 'pkgs/servers')
-rw-r--r--pkgs/servers/sql/patroni/default.nix57
1 files changed, 57 insertions, 0 deletions
diff --git a/pkgs/servers/sql/patroni/default.nix b/pkgs/servers/sql/patroni/default.nix
new file mode 100644
index 000000000000..a9fc3fd1a174
--- /dev/null
+++ b/pkgs/servers/sql/patroni/default.nix
@@ -0,0 +1,57 @@
+{ lib, pythonPackages, fetchFromGitHub }:
+
+pythonPackages.buildPythonApplication rec {
+  pname = "patroni";
+  version = "1.6.4";
+
+  src = fetchFromGitHub {
+    owner = "zalando";
+    repo = pname;
+    rev = "v${version}";
+    sha256 = "0w0mz4a1cyxdsqmv7jrkw163jll8ir5zmf93zcidlqx13knrk80g";
+  };
+
+  # 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
+    pytest
+    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;
+    maintainers = [ maintainers.limeytexan ];
+  };
+}