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

74 lines
1.2 KiB
Nix

{
lib,
buildPythonPackage,
fetchFromGitHub,
scikit-build-core,
setuptools,
setuptools-scm,
cmake,
ninja,
matchpy,
numpy,
astunparse,
typing-extensions,
nix-update-script,
pytestCheckHook,
pytest-cov-stub,
}:
buildPythonPackage rec {
pname = "uarray";
version = "0.9.2";
pyproject = true;
src = fetchFromGitHub {
owner = "Quansight-Labs";
repo = "uarray";
tag = version;
hash = "sha256-eCrmmP+9TI+T8Km8MOz0EqseneFwPizlnZloK5yNLcM=";
};
build-system = [
scikit-build-core
setuptools
setuptools-scm
cmake
ninja
];
dontUseCmakeConfigure = true;
dependencies = [
astunparse
matchpy
numpy
typing-extensions
];
nativeCheckInputs = [
pytestCheckHook
pytest-cov-stub
];
# Tests must be run from outside the source directory
preCheck = ''
cd $TMP
'';
pytestFlags = [
"--pyargs"
"uarray"
];
pythonImportsCheck = [ "uarray" ];
passthru.updateScript = nix-update-script { };
meta = with lib; {
description = "Universal array library";
homepage = "https://github.com/Quansight-Labs/uarray";
license = licenses.bsd0;
maintainers = [ lib.maintainers.pbsds ];
};
}