2024-11-22 15:02:43 +00:00
|
|
|
{
|
|
|
|
lib,
|
|
|
|
python3Packages,
|
|
|
|
enableOCR ? false,
|
|
|
|
qemu_pkg ? qemu_test,
|
|
|
|
coreutils,
|
|
|
|
imagemagick_light,
|
|
|
|
netpbm,
|
|
|
|
qemu_test,
|
|
|
|
socat,
|
|
|
|
ruff,
|
|
|
|
tesseract4,
|
|
|
|
vde2,
|
|
|
|
extraPythonPackages ? (_: [ ]),
|
|
|
|
nixosTests,
|
2021-12-06 12:49:23 +00:00
|
|
|
}:
|
2024-06-14 18:42:16 +00:00
|
|
|
let
|
|
|
|
fs = lib.fileset;
|
|
|
|
in
|
2023-09-30 07:56:42 +00:00
|
|
|
python3Packages.buildPythonApplication {
|
2021-12-06 12:49:23 +00:00
|
|
|
pname = "nixos-test-driver";
|
2022-01-01 22:06:07 +00:00
|
|
|
version = "1.1";
|
2024-11-22 15:05:19 +00:00
|
|
|
pyproject = true;
|
|
|
|
|
2024-06-14 18:42:16 +00:00
|
|
|
src = fs.toSource {
|
|
|
|
root = ./.;
|
|
|
|
fileset = fs.unions [
|
|
|
|
./pyproject.toml
|
|
|
|
./test_driver
|
|
|
|
./extract-docstrings.py
|
|
|
|
];
|
|
|
|
};
|
2024-11-22 15:05:19 +00:00
|
|
|
|
|
|
|
build-system = with python3Packages; [
|
|
|
|
setuptools
|
|
|
|
];
|
|
|
|
|
|
|
|
dependencies =
|
|
|
|
with python3Packages;
|
|
|
|
[
|
|
|
|
colorama
|
|
|
|
junit-xml
|
|
|
|
ptpython
|
|
|
|
]
|
|
|
|
++ extraPythonPackages python3Packages;
|
2021-12-06 12:49:23 +00:00
|
|
|
|
2024-11-22 15:02:43 +00:00
|
|
|
propagatedBuildInputs =
|
|
|
|
[
|
|
|
|
coreutils
|
|
|
|
netpbm
|
|
|
|
qemu_pkg
|
|
|
|
socat
|
|
|
|
vde2
|
|
|
|
]
|
2024-11-22 15:05:19 +00:00
|
|
|
++ lib.optionals enableOCR [
|
2024-11-22 15:02:43 +00:00
|
|
|
imagemagick_light
|
|
|
|
tesseract4
|
2024-11-22 15:05:19 +00:00
|
|
|
];
|
2024-01-12 10:58:07 +00:00
|
|
|
|
2023-10-27 11:34:03 +00:00
|
|
|
passthru.tests = {
|
|
|
|
inherit (nixosTests.nixos-test-driver) driver-timeout;
|
|
|
|
};
|
|
|
|
|
2021-12-06 12:49:23 +00:00
|
|
|
doCheck = true;
|
2024-11-22 15:05:19 +00:00
|
|
|
|
2024-11-22 15:02:43 +00:00
|
|
|
nativeCheckInputs = with python3Packages; [
|
|
|
|
mypy
|
|
|
|
ruff
|
|
|
|
];
|
2024-11-22 15:05:19 +00:00
|
|
|
|
2021-12-06 12:49:23 +00:00
|
|
|
checkPhase = ''
|
2023-09-30 07:56:42 +00:00
|
|
|
echo -e "\x1b[32m## run mypy\x1b[0m"
|
|
|
|
mypy test_driver extract-docstrings.py
|
2024-11-22 15:07:29 +00:00
|
|
|
echo -e "\x1b[32m## run ruff check\x1b[0m"
|
2024-05-22 09:25:53 +00:00
|
|
|
ruff check .
|
2024-11-22 15:07:29 +00:00
|
|
|
echo -e "\x1b[32m## run ruff format\x1b[0m"
|
|
|
|
ruff format --check --diff .
|
2021-12-06 12:49:23 +00:00
|
|
|
'';
|
|
|
|
}
|