nixpkgs/nixos/lib/test-driver/default.nix

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

71 lines
1.2 KiB
Nix
Raw Normal View History

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,
}:
python3Packages.buildPythonApplication {
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
ipython
2024-11-22 10:05:19 -05:00
]
++ extraPythonPackages python3Packages;
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
];
passthru.tests = {
inherit (nixosTests.nixos-test-driver) driver-timeout;
};
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
checkPhase = ''
echo -e "\x1b[32m## run mypy\x1b[0m"
mypy test_driver extract-docstrings.py
echo -e "\x1b[32m## run ruff check\x1b[0m"
ruff check .
echo -e "\x1b[32m## run ruff format\x1b[0m"
ruff format --check --diff .
'';
}