diff --git a/pkgs/by-name/pa/patroni/package.nix b/pkgs/by-name/pa/patroni/package.nix index f0628394addb..b09368b60711 100644 --- a/pkgs/by-name/pa/patroni/package.nix +++ b/pkgs/by-name/pa/patroni/package.nix @@ -1,22 +1,24 @@ -{ lib -, python3Packages -, fetchFromGitHub -, nixosTests -, nix-update-script +{ + lib, + python3Packages, + fetchFromGitHub, + versionCheckHook, + nixosTests, + nix-update-script, }: python3Packages.buildPythonApplication rec { pname = "patroni"; - version = "4.0.3"; + version = "4.0.4"; src = fetchFromGitHub { owner = "zalando"; - repo = pname; + repo = "patroni"; rev = "refs/tags/v${version}"; - sha256 = "sha256-urNTxaipM4wD+1fp7EFdT7/FGLq86O1nOfst7JyX0fc="; + sha256 = "sha256-if3azfBb6/OegahZYAM2RMxmWRDsCX5DNkUATTcAUrw="; }; - propagatedBuildInputs = with python3Packages; [ + dependencies = with python3Packages; [ boto3 click consul @@ -35,18 +37,22 @@ python3Packages.buildPythonApplication rec { ydiff ]; + pythonImportsCheck = [ "patroni" ]; + nativeCheckInputs = with python3Packages; [ flake8 mock pytestCheckHook pytest-cov requests + versionCheckHook ]; + versionCheckProgramArg = [ "--version" ]; # Fix tests by preventing them from writing to /homeless-shelter. preCheck = "export HOME=$(mktemp -d)"; - pythonImportsCheck = [ "patroni" ]; + __darwinAllowLocalNetworking = true; passthru = { tests.patroni = nixosTests.patroni; @@ -54,11 +60,12 @@ python3Packages.buildPythonApplication rec { updateScript = nix-update-script { }; }; - meta = with lib; { + meta = { homepage = "https://patroni.readthedocs.io/en/latest/"; description = "Template for PostgreSQL HA with ZooKeeper, etcd or Consul"; - license = licenses.mit; - platforms = platforms.unix; - maintainers = teams.deshaw.members; + changelog = "https://github.com/patroni/patroni/blob/v${version}/docs/releases.rst"; + license = lib.licenses.mit; + platforms = lib.platforms.unix; + maintainers = lib.teams.deshaw.members; }; } diff --git a/pkgs/development/python-modules/python-etcd/default.nix b/pkgs/development/python-modules/python-etcd/default.nix index 031efa7b31e3..def0b49aecaa 100644 --- a/pkgs/development/python-modules/python-etcd/default.nix +++ b/pkgs/development/python-modules/python-etcd/default.nix @@ -1,5 +1,6 @@ { lib, + stdenv, buildPythonPackage, fetchFromGitHub, setuptools, @@ -9,7 +10,6 @@ etcd_3_4, mock, pyopenssl, - stdenv, }: buildPythonPackage { @@ -48,9 +48,20 @@ buildPythonPackage { done ''; - meta = with lib; { + disabledTests = lib.optionals stdenv.hostPlatform.isDarwin [ + # Seems to be failing because of network restrictions + # AttributeError: Can't get local object 'TestWatch.test_watch_indexed_generator..watch_value' + "test_watch" + "test_watch_generator" + "test_watch_indexed" + "test_watch_indexed_generator" + ]; + + __darwinAllowLocalNetworking = true; + + meta = { description = "Python client for Etcd"; homepage = "https://github.com/jplana/python-etcd"; - license = licenses.mit; + license = lib.licenses.mit; }; }