From ea59081128142046e5a37b8b2edea8b84eae4e5b Mon Sep 17 00:00:00 2001 From: Wolfgang Walther Date: Sat, 9 Nov 2024 13:13:14 +0100 Subject: [PATCH 1/4] python3Packages.mirakuru: 2.5.2 -> 2.5.3 This adds support for python 3.13 and removes support for 3.8. --- pkgs/development/python-modules/mirakuru/default.nix | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/pkgs/development/python-modules/mirakuru/default.nix b/pkgs/development/python-modules/mirakuru/default.nix index e208daa625ef..4a8633c925a7 100644 --- a/pkgs/development/python-modules/mirakuru/default.nix +++ b/pkgs/development/python-modules/mirakuru/default.nix @@ -13,16 +13,16 @@ buildPythonPackage rec { pname = "mirakuru"; - version = "2.5.2"; + version = "2.5.3"; format = "pyproject"; - disabled = pythonOlder "3.8"; + disabled = pythonOlder "3.9"; src = fetchFromGitHub { owner = "ClearcodeHQ"; repo = "mirakuru"; rev = "refs/tags/v${version}"; - hash = "sha256-I1TKP0ESuBMTcReZf0tryjvGpSpwzofwmOiQqhyr6Zg="; + hash = "sha256-blk4Oclb3+Cj3RH7BhzacfoPFDBIP/zgv4Ct7fawGnQ="; }; nativeBuildInputs = [ setuptools ]; From 1b89b9a99d802ca73bf17d52bbec13faea592b20 Mon Sep 17 00:00:00 2001 From: Wolfgang Walther Date: Sat, 9 Nov 2024 13:53:46 +0100 Subject: [PATCH 2/4] python3Packages.mirakuru: fix build on darwin --- .../python-modules/mirakuru/default.nix | 5 +++++ .../python-modules/mirakuru/tmpdir.patch | 19 +++++++++++++++++++ 2 files changed, 24 insertions(+) create mode 100644 pkgs/development/python-modules/mirakuru/tmpdir.patch diff --git a/pkgs/development/python-modules/mirakuru/default.nix b/pkgs/development/python-modules/mirakuru/default.nix index 4a8633c925a7..3a7e969c9a1b 100644 --- a/pkgs/development/python-modules/mirakuru/default.nix +++ b/pkgs/development/python-modules/mirakuru/default.nix @@ -25,6 +25,11 @@ buildPythonPackage rec { hash = "sha256-blk4Oclb3+Cj3RH7BhzacfoPFDBIP/zgv4Ct7fawGnQ="; }; + patches = [ + # https://github.com/ClearcodeHQ/mirakuru/pull/810 + ./tmpdir.patch + ]; + nativeBuildInputs = [ setuptools ]; propagatedBuildInputs = [ psutil ]; diff --git a/pkgs/development/python-modules/mirakuru/tmpdir.patch b/pkgs/development/python-modules/mirakuru/tmpdir.patch new file mode 100644 index 000000000000..2fd6fcfd2741 --- /dev/null +++ b/pkgs/development/python-modules/mirakuru/tmpdir.patch @@ -0,0 +1,19 @@ +--- a/tests/executors/test_unixsocket_executor.py ++++ b/tests/executors/test_unixsocket_executor.py +@@ -4,6 +4,7 @@ Some of these tests run ``nc``: when running Debian, make sure the + ``netcat-openbsd`` package is used, not ``netcat-traditional``. + """ + ++import os + import sys + + import pytest +@@ -12,7 +13,7 @@ from mirakuru import TimeoutExpired + from mirakuru.unixsocket import UnixSocketExecutor + from tests import TEST_SOCKET_SERVER_PATH + +-SOCKET_PATH = "/tmp/mirakuru.sock" ++SOCKET_PATH = os.path.join(os.getenv("TMPDIR", "/tmp"), "mirakuru.sock") + + SOCKET_SERVER_CMD = f"{sys.executable} {TEST_SOCKET_SERVER_PATH} {SOCKET_PATH}" + From e07f6a75653d2b8a6f7ab72f98b5befbda22876d Mon Sep 17 00:00:00 2001 From: Wolfgang Walther Date: Sat, 9 Nov 2024 13:57:29 +0100 Subject: [PATCH 3/4] python3Packages.mirakuru: fix build on darwin in sandbox --- .../python-modules/mirakuru/default.nix | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/pkgs/development/python-modules/mirakuru/default.nix b/pkgs/development/python-modules/mirakuru/default.nix index 3a7e969c9a1b..58c74cd3cad1 100644 --- a/pkgs/development/python-modules/mirakuru/default.nix +++ b/pkgs/development/python-modules/mirakuru/default.nix @@ -1,4 +1,5 @@ { + stdenv, lib, buildPythonPackage, fetchFromGitHub, @@ -42,6 +43,20 @@ buildPythonPackage rec { ]; pythonImportsCheck = [ "mirakuru" ]; + # Necessary for the tests to pass on Darwin with sandbox enabled. + __darwinAllowLocalNetworking = true; + + # Those are failing in the darwin sandbox with: + # > ps: %mem: requires entitlement + # > ps: vsz: requires entitlement + # > ps: rss: requires entitlement + # > ps: time: requires entitlement + disabledTests = lib.optionals stdenv.hostPlatform.isDarwin [ + "test_forgotten_stop" + "test_mirakuru_cleanup" + "test_daemons_killing" + ]; + meta = with lib; { homepage = "https://pypi.org/project/mirakuru"; description = "Process orchestration tool designed for functional and integration tests"; From 67fa71469a6b9c0675fb27b32be32b3e5d023bbf Mon Sep 17 00:00:00 2001 From: Wolfgang Walther Date: Sat, 9 Nov 2024 14:26:58 +0100 Subject: [PATCH 4/4] python3Packages.pgsanity: fix build Tests are located in test/, make unittest pick them up. --- pkgs/development/python-modules/pgsanity/default.nix | 3 +++ 1 file changed, 3 insertions(+) diff --git a/pkgs/development/python-modules/pgsanity/default.nix b/pkgs/development/python-modules/pgsanity/default.nix index 7f1c482977a3..df957c92c686 100644 --- a/pkgs/development/python-modules/pgsanity/default.nix +++ b/pkgs/development/python-modules/pgsanity/default.nix @@ -20,6 +20,9 @@ buildPythonPackage rec { unittestCheckHook postgresql ]; + + unittestFlagsArray = [ "test" ]; + propagatedBuildInputs = [ postgresql ]; meta = with lib; {