Skip to content

Commit e6ffd99

Browse files
authored
python3Packages.{mirakuru,pgsanity}: fix builds (#354774)
2 parents 06be856 + 67fa714 commit e6ffd99

File tree

3 files changed

+45
-3
lines changed

3 files changed

+45
-3
lines changed

pkgs/development/python-modules/mirakuru/default.nix

Lines changed: 23 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
{
2+
stdenv,
23
lib,
34
buildPythonPackage,
45
fetchFromGitHub,
@@ -13,18 +14,23 @@
1314

1415
buildPythonPackage rec {
1516
pname = "mirakuru";
16-
version = "2.5.2";
17+
version = "2.5.3";
1718
format = "pyproject";
1819

19-
disabled = pythonOlder "3.8";
20+
disabled = pythonOlder "3.9";
2021

2122
src = fetchFromGitHub {
2223
owner = "ClearcodeHQ";
2324
repo = "mirakuru";
2425
rev = "refs/tags/v${version}";
25-
hash = "sha256-I1TKP0ESuBMTcReZf0tryjvGpSpwzofwmOiQqhyr6Zg=";
26+
hash = "sha256-blk4Oclb3+Cj3RH7BhzacfoPFDBIP/zgv4Ct7fawGnQ=";
2627
};
2728

29+
patches = [
30+
# https://github.com/ClearcodeHQ/mirakuru/pull/810
31+
./tmpdir.patch
32+
];
33+
2834
nativeBuildInputs = [ setuptools ];
2935

3036
propagatedBuildInputs = [ psutil ];
@@ -37,6 +43,20 @@ buildPythonPackage rec {
3743
];
3844
pythonImportsCheck = [ "mirakuru" ];
3945

46+
# Necessary for the tests to pass on Darwin with sandbox enabled.
47+
__darwinAllowLocalNetworking = true;
48+
49+
# Those are failing in the darwin sandbox with:
50+
# > ps: %mem: requires entitlement
51+
# > ps: vsz: requires entitlement
52+
# > ps: rss: requires entitlement
53+
# > ps: time: requires entitlement
54+
disabledTests = lib.optionals stdenv.hostPlatform.isDarwin [
55+
"test_forgotten_stop"
56+
"test_mirakuru_cleanup"
57+
"test_daemons_killing"
58+
];
59+
4060
meta = with lib; {
4161
homepage = "https://pypi.org/project/mirakuru";
4262
description = "Process orchestration tool designed for functional and integration tests";
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
--- a/tests/executors/test_unixsocket_executor.py
2+
+++ b/tests/executors/test_unixsocket_executor.py
3+
@@ -4,6 +4,7 @@ Some of these tests run ``nc``: when running Debian, make sure the
4+
``netcat-openbsd`` package is used, not ``netcat-traditional``.
5+
"""
6+
7+
+import os
8+
import sys
9+
10+
import pytest
11+
@@ -12,7 +13,7 @@ from mirakuru import TimeoutExpired
12+
from mirakuru.unixsocket import UnixSocketExecutor
13+
from tests import TEST_SOCKET_SERVER_PATH
14+
15+
-SOCKET_PATH = "/tmp/mirakuru.sock"
16+
+SOCKET_PATH = os.path.join(os.getenv("TMPDIR", "/tmp"), "mirakuru.sock")
17+
18+
SOCKET_SERVER_CMD = f"{sys.executable} {TEST_SOCKET_SERVER_PATH} {SOCKET_PATH}"
19+

pkgs/development/python-modules/pgsanity/default.nix

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,9 @@ buildPythonPackage rec {
2020
unittestCheckHook
2121
postgresql
2222
];
23+
24+
unittestFlagsArray = [ "test" ];
25+
2326
propagatedBuildInputs = [ postgresql ];
2427

2528
meta = with lib; {

0 commit comments

Comments
 (0)