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

46 lines
1.1 KiB
Nix

{
lib,
buildPythonPackage,
fetchFromGitHub,
pythonOlder,
poetry-core,
pytestCheckHook,
}:
buildPythonPackage {
pname = "timeslot";
version = "0.1.2";
# pypi distribution doesn't include tests, so build from source instead
src = fetchFromGitHub {
owner = "ErikBjare";
repo = "timeslot";
rev = "af35445e96cbb2f3fb671a75aac6aa93e4e7e7a6";
sha256 = "sha256-GEhg2iMsYMfalT7L9TCd1KHU6oa/wTl5m3mRC0zOH9Q=";
};
format = "pyproject";
disabled = pythonOlder "3.6";
nativeBuildInputs = [ poetry-core ];
nativeCheckInputs = [ pytestCheckHook ];
pytestFlags = [
# The pyproject.toml specifies the flag `--cov=timeslot`,
# This causes an error when running without pytest-cov,
# so use this flag to override that option, as we don't need coverage.
"--override-ini=addopts="
];
pythonImportsCheck = [ "timeslot" ];
meta = with lib; {
description = "Data type for representing time slots with a start and end";
homepage = "https://github.com/ErikBjare/timeslot";
maintainers = with maintainers; [ huantian ];
license = licenses.mit;
};
}