Yueh-Shun Li 76e2a397c2 treewide: pytestFlagsArray -> pytestFlags and join flag and option argument
This treewide change targets Python packages
that specifies pytest flags with pytestFlagsArray,
and whose flags cannot be consructed by other pytestCheckHook-honoured arguments.

Use the __structuredAttrs-agnostic argument pytestFlags
instead of the deprecated pytestFlagsArray.

For flags with option arguments,
join each flag and their option argument into a single command-line argument
following POSIX Utility Argument Syntax[1]
for easier overriding (remove/replace).

Examples:

* [ "-W" "ignore:message:WarningClass" ] ->
  [ "-Wignore:message:WarningClass" ]

* [ "--reruns" "3" ] ->
  [ "--reruns=3" ]

[1]: https://pubs.opengroup.org/onlinepubs/009695399/basedefs/xbd_chap12.html
2025-06-16 01:02:16 +08:00

68 lines
1.3 KiB
Nix

{
lib,
buildPythonPackage,
isPyPy,
fetchPypi,
hatchling,
hatch-vcs,
gevent,
pytestCheckHook,
}:
buildPythonPackage rec {
pname = "execnet";
version = "2.1.1";
pyproject = true;
src = fetchPypi {
inherit pname version;
hash = "sha256-UYm1LGEhwk/q4ogWarQbMlScfiNIZSc2VAuebn1OcuM=";
};
postPatch =
''
# remove vbox tests
rm testing/test_termination.py
rm testing/test_channel.py
rm testing/test_xspec.py
rm testing/test_gateway.py
''
+ lib.optionalString isPyPy ''
rm testing/test_multi.py
'';
build-system = [
hatchling
hatch-vcs
];
# sometimes crashes with: OSError: [Errno 9] Bad file descriptor
doCheck = !isPyPy;
nativeCheckInputs = [
gevent
pytestCheckHook
];
disabledTests = [
# gets stuck
"test_popen_io"
# OSError: [Errno 9] Bad file descriptor
"test_stdouterrin_setnull"
];
pytestFlags = [ "-vvv" ];
pythonImportsCheck = [ "execnet" ];
__darwinAllowLocalNetworking = true;
meta = {
description = "Distributed Python deployment and communication";
homepage = "https://execnet.readthedocs.io/";
changelog = "https://github.com/pytest-dev/execnet/blob/v${version}/CHANGELOG.rst";
license = lib.licenses.mit;
maintainers = with lib.maintainers; [ getchoo ];
};
}