From 44f365a9310d4b38e5bd984e5c7a229e96472297 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Robert=20Sch=C3=BCtz?= Date: Thu, 10 Nov 2022 12:05:18 -0800 Subject: [PATCH] python310Packages.pytest-xdist: 2.5.0 -> 3.1.0 https://github.com/pytest-dev/pytest-xdist/blob/v3.1.0/CHANGELOG.rst --- .../python-modules/pytest-xdist/default.nix | 31 ++++++++++++++----- .../python-modules/pytest-xdist/setup-hook.sh | 9 ------ 2 files changed, 23 insertions(+), 17 deletions(-) diff --git a/pkgs/development/python-modules/pytest-xdist/default.nix b/pkgs/development/python-modules/pytest-xdist/default.nix index b17b6f2f763a..9efbd95cff83 100644 --- a/pkgs/development/python-modules/pytest-xdist/default.nix +++ b/pkgs/development/python-modules/pytest-xdist/default.nix @@ -7,32 +7,47 @@ , filelock , execnet , pytest -, pytest-forked , psutil -, pexpect +, setproctitle }: buildPythonPackage rec { pname = "pytest-xdist"; - version = "2.5.0"; + version = "3.1.0"; disabled = pythonOlder "3.6"; + format = "pyproject"; + src = fetchPypi { inherit pname version; - sha256 = "sha256-RYDeyj/wTdsqxT66Oddstd1e3qwFDLb7x2iw3XErTt8="; + hash = "sha256-QP2481RJIcXfzUhqwIDOIocOcdgs7W0uePqXwq3dSAw="; }; - nativeBuildInputs = [ setuptools-scm ]; + nativeBuildInputs = [ + setuptools-scm + ]; + buildInputs = [ pytest ]; - checkInputs = [ pytestCheckHook filelock pexpect ]; - propagatedBuildInputs = [ execnet pytest-forked psutil ]; + + propagatedBuildInputs = [ + execnet + ]; + + checkInputs = [ + filelock + pytestCheckHook + ]; + + passthru.optional-dependencies = { + psutil = [ psutil ]; + setproctitle = [ setproctitle ]; + }; pytestFlagsArray = [ # pytest can already use xdist at this point "--numprocesses=$NIX_BUILD_CORES" - "--forked" ]; # access file system diff --git a/pkgs/development/python-modules/pytest-xdist/setup-hook.sh b/pkgs/development/python-modules/pytest-xdist/setup-hook.sh index 61d0f64d1a4d..4c6473cea64d 100644 --- a/pkgs/development/python-modules/pytest-xdist/setup-hook.sh +++ b/pkgs/development/python-modules/pytest-xdist/setup-hook.sh @@ -1,16 +1,7 @@ pytestXdistHook() { pytestFlagsArray+=( "--numprocesses=$NIX_BUILD_CORES" - "--forked" ) - - # Using --forked on darwin leads to crashes when fork safety is - # enabled. This often happens when urllib tries to request proxy - # settings on MacOS through `urllib.request.getproxies()` - # - https://github.com/python/cpython/issues/77906 - if [[ "$OSTYPE" == "darwin"* ]]; then - export OBJC_DISABLE_INITIALIZE_FORK_SAFETY=YES - fi } # the flags should be added before pytestCheckHook runs so