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

67 lines
1.2 KiB
Nix

{
lib,
stdenv,
buildPythonPackage,
fetchPypi,
replaceVars,
xorg,
# build-system
setuptools,
# tests
easyprocess,
entrypoint2,
pillow,
psutil,
pytest-timeout,
pytest-xdist,
pytestCheckHook,
vncdo,
}:
buildPythonPackage rec {
pname = "pyvirtualdisplay";
version = "3.0";
pyproject = true;
src = fetchPypi {
pname = "PyVirtualDisplay";
inherit version;
hash = "sha256-CXVbw86263JfsH7KVCX0PyNY078I4A0qm3kqGu3RYVk=";
};
patches = lib.optionals stdenv.hostPlatform.isLinux [
(replaceVars ./paths.patch {
xauth = lib.getExe xorg.xauth;
xdpyinfo = lib.getExe xorg.xdpyinfo;
})
];
build-system = [ setuptools ];
doCheck = stdenv.hostPlatform.isLinux;
nativeCheckInputs = [
easyprocess
entrypoint2
pillow
psutil
pytest-timeout
pytestCheckHook
(vncdo.overridePythonAttrs { doCheck = false; })
xorg.xorgserver
xorg.xmessage
xorg.xvfb
];
pytestFlags = [ "-v" ];
meta = with lib; {
description = "Python wrapper for Xvfb, Xephyr and Xvnc";
homepage = "https://github.com/ponty/pyvirtualdisplay";
license = licenses.bsdOriginal;
maintainers = with maintainers; [ layus ];
};
}