Merge pull request #330634 from r-ryantm/auto-update/circumflex
[NixPkgs.git] / pkgs / servers / sql / patroni / default.nix
blob119218bada526abf4d319a05016cf98c21f5dc69
1 { lib
2 , pythonPackages
3 , fetchFromGitHub
4 , nixosTests
5 }:
7 pythonPackages.buildPythonApplication rec {
8   pname = "patroni";
9   version = "3.3.1";
11   src = fetchFromGitHub {
12     owner = "zalando";
13     repo = pname;
14     rev = "refs/tags/v${version}";
15     sha256 = "sha256-GyPPBoYcJnuMer9FYGhWqursX/qJLaAlc9zFULoJqo4=";
16   };
18   propagatedBuildInputs = with pythonPackages; [
19     boto3
20     click
21     consul
22     dnspython
23     kazoo
24     kubernetes
25     prettytable
26     psutil
27     psycopg2
28     pysyncobj
29     python-dateutil
30     python-etcd
31     pyyaml
32     tzlocal
33     urllib3
34     ydiff
35   ];
37   nativeCheckInputs = with pythonPackages; [
38     flake8
39     mock
40     pytestCheckHook
41     pytest-cov
42     requests
43   ];
45   # Fix tests by preventing them from writing to /homeless-shelter.
46   preCheck = "export HOME=$(mktemp -d)";
48   pythonImportsCheck = [ "patroni" ];
50   passthru.tests = {
51     patroni = nixosTests.patroni;
52   };
54   meta = with lib; {
55     homepage = "https://patroni.readthedocs.io/en/latest/";
56     description = "Template for PostgreSQL HA with ZooKeeper, etcd or Consul";
57     license = licenses.mit;
58     platforms = platforms.unix;
59     maintainers = teams.deshaw.members;
60   };