2024-11-22 10:02:43 -05: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
|
|
|
}:
|
2023-09-30 09:56:42 +02:00
|
|
|
python3Packages.buildPythonApplication {
|
2021-12-06 12:49:23 +00:00
|
|
|
pname = "nixos-test-driver";
|
2022-01-01 23:06:07 +01:00
|
|
|
version = "1.1";
|
2024-11-22 10:05:19 -05:00
|
|
|
pyproject = true;
|
|
|
|
|
2024-12-31 00:14:30 +00:00
|
|
|
src = ./src;
|
2024-11-22 10:05:19 -05:00
|
|
|
|
|
|
|
build-system = with python3Packages; [
|
|
|
|
setuptools
|
|
|
|
];
|
|
|
|
|
|
|
|
dependencies =
|
|
|
|
with python3Packages;
|
|
|
|
[
|
|
|
|
colorama
|
|
|
|
junit-xml
|
|
|
|
ptpython
|
2025-03-21 12:34:59 +00:00
|
|
|
ipython
|
2024-11-22 10:05:19 -05:00
|
|
|
]
|
|
|
|
++ extraPythonPackages python3Packages;
|
2021-12-06 12:49:23 +00:00
|
|
|
|
2024-11-22 10:02:43 -05:00
|
|
|
propagatedBuildInputs =
|
|
|
|
[
|
|
|
|
coreutils
|
|
|
|
netpbm
|
|
|
|
qemu_pkg
|
|
|
|
socat
|
|
|
|
vde2
|
|
|
|
]
|
2024-11-22 10:05:19 -05:00
|
|
|
++ lib.optionals enableOCR [
|
2024-11-22 10:02:43 -05:00
|
|
|
imagemagick_light
|
|
|
|
tesseract4
|
2024-11-22 10:05:19 -05:00
|
|
|
];
|
2024-01-12 13:58:07 +03:00
|
|
|
|
2023-10-27 13:34:03 +02:00
|
|
|
passthru.tests = {
|
|
|
|
inherit (nixosTests.nixos-test-driver) driver-timeout;
|
|
|
|
};
|
|
|
|
|
2021-12-06 12:49:23 +00:00
|
|
|
doCheck = true;
|
2024-11-22 10:05:19 -05:00
|
|
|
|
2024-11-22 10:02:43 -05:00
|
|
|
nativeCheckInputs = with python3Packages; [
|
|
|
|
mypy
|
|
|
|
ruff
|
|
|
|
];
|
2024-11-22 10:05:19 -05:00
|
|
|
|
2021-12-06 12:49:23 +00:00
|
|
|
checkPhase = ''
|
2023-09-30 09:56:42 +02:00
|
|
|
echo -e "\x1b[32m## run mypy\x1b[0m"
|
|
|
|
mypy test_driver extract-docstrings.py
|
2024-11-22 10:07:29 -05:00
|
|
|
echo -e "\x1b[32m## run ruff check\x1b[0m"
|
2024-05-22 11:25:53 +02:00
|
|
|
ruff check .
|
2024-11-22 10:07:29 -05:00
|
|
|
echo -e "\x1b[32m## run ruff format\x1b[0m"
|
|
|
|
ruff format --check --diff .
|
2021-12-06 12:49:23 +00:00
|
|
|
'';
|
|
|
|
}
|