python3Packages.{mirakuru,pgsanity}: fix builds (#354774)

This commit is contained in:
Pol Dellaiera
2024-11-10 00:02:58 +01:00
committed by GitHub
3 changed files with 45 additions and 3 deletions

View File

@@ -1,4 +1,5 @@
{
stdenv,
lib,
buildPythonPackage,
fetchFromGitHub,
@@ -13,18 +14,23 @@
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=";
};
patches = [
# https://github.com/ClearcodeHQ/mirakuru/pull/810
./tmpdir.patch
];
nativeBuildInputs = [ setuptools ];
propagatedBuildInputs = [ psutil ];
@@ -37,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";

View File

@@ -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}"

View File

@@ -20,6 +20,9 @@ buildPythonPackage rec {
unittestCheckHook
postgresql
];
unittestFlagsArray = [ "test" ];
propagatedBuildInputs = [ postgresql ];
meta = with lib; {