From ab6f62edfc5e6bd8287dbbb31521c5f73834d4f1 Mon Sep 17 00:00:00 2001 From: Gaetan Lepage Date: Tue, 26 Nov 2024 16:13:36 +0100 Subject: [PATCH 1/3] patroni: format --- pkgs/by-name/pa/patroni/package.nix | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/pkgs/by-name/pa/patroni/package.nix b/pkgs/by-name/pa/patroni/package.nix index f0628394addb..856e2b8704f1 100644 --- a/pkgs/by-name/pa/patroni/package.nix +++ b/pkgs/by-name/pa/patroni/package.nix @@ -1,8 +1,9 @@ -{ lib -, python3Packages -, fetchFromGitHub -, nixosTests -, nix-update-script +{ + lib, + python3Packages, + fetchFromGitHub, + nixosTests, + nix-update-script, }: python3Packages.buildPythonApplication rec { From d2e3ec6d427c51c3e8dfbb424f5d6435fdbdbc7c Mon Sep 17 00:00:00 2001 From: Gaetan Lepage Date: Tue, 26 Nov 2024 16:15:57 +0100 Subject: [PATCH 2/3] patroni: 4.0.3 -> 4.0.4 Diff: https://github.com/zalando/patroni/compare/refs/tags/v4.0.3...v4.0.4 Changelog: https://github.com/patroni/patroni/blob/v4.0.4/docs/releases.rst --- pkgs/by-name/pa/patroni/package.nix | 24 +++++++++++++++--------- 1 file changed, 15 insertions(+), 9 deletions(-) diff --git a/pkgs/by-name/pa/patroni/package.nix b/pkgs/by-name/pa/patroni/package.nix index 856e2b8704f1..b09368b60711 100644 --- a/pkgs/by-name/pa/patroni/package.nix +++ b/pkgs/by-name/pa/patroni/package.nix @@ -2,22 +2,23 @@ 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 @@ -36,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; @@ -55,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; }; } From 6974df1a15ae8a8fad32f135d9c959b58ac094ea Mon Sep 17 00:00:00 2001 From: Gaetan Lepage Date: Tue, 26 Nov 2024 17:55:32 +0100 Subject: [PATCH 3/3] python312Packages.python-etcd: fix on darwin --- .../python-modules/python-etcd/default.nix | 17 ++++++++++++++--- 1 file changed, 14 insertions(+), 3 deletions(-) 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; }; }