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

65 lines
1.2 KiB
Nix

{
lib,
buildPythonPackage,
fetchFromGitHub,
libiconv,
dirty-equals,
pytest-benchmark,
pytestCheckHook,
pythonOlder,
rustPlatform,
}:
buildPythonPackage rec {
pname = "rtoml";
version = "0.10";
pyproject = true;
disabled = pythonOlder "3.7";
src = fetchFromGitHub {
owner = "samuelcolvin";
repo = "rtoml";
rev = "v${version}";
hash = "sha256-1movtKMQkQ6PEpKpSkK0Oy4AV0ee7XrS0P9m6QwZTaM=";
};
cargoDeps = rustPlatform.fetchCargoVendor {
inherit pname version src;
hash = "sha256-/elui0Rf3XwvD2jX+NGoJgf9S3XSp16qzdwkGZbKaZg=";
};
build-system = with rustPlatform; [
cargoSetupHook
maturinBuildHook
];
buildInputs = [ libiconv ];
pythonImportsCheck = [ "rtoml" ];
nativeCheckInputs = [
dirty-equals
pytest-benchmark
pytestCheckHook
];
pytestFlags = [ "--benchmark-disable" ];
disabledTests = [
# TypeError: loads() got an unexpected keyword argument 'name'
"test_load_data_toml"
];
preCheck = ''
rm -rf rtoml
'';
meta = with lib; {
description = "Rust based TOML library for Python";
homepage = "https://github.com/samuelcolvin/rtoml";
license = licenses.mit;
maintainers = with maintainers; [ evils ];
};
}