Unverified Commit e6ffd996 authored by Pol Dellaiera's avatar Pol Dellaiera Committed by GitHub
Browse files

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

parents 06be8564 67fa7146
Loading
Loading
Loading
Loading
+23 −3
Original line number Diff line number Diff line
{
  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";
+19 −0
Original line number Diff line number Diff line
--- 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}"
 
+3 −0
Original line number Diff line number Diff line
@@ -20,6 +20,9 @@ buildPythonPackage rec {
    unittestCheckHook
    postgresql
  ];

  unittestFlagsArray = [ "test" ];

  propagatedBuildInputs = [ postgresql ];

  meta = with lib; {