2021-12-19 01:06:50 +00:00
|
|
|
{ lib
|
|
|
|
, python3Packages
|
|
|
|
, enableOCR ? false
|
|
|
|
, qemu_pkg ? qemu_test
|
|
|
|
, coreutils
|
|
|
|
, imagemagick_light
|
|
|
|
, netpbm
|
|
|
|
, qemu_test
|
|
|
|
, socat
|
2023-10-09 19:29:22 +00:00
|
|
|
, ruff
|
2021-12-19 01:06:50 +00:00
|
|
|
, tesseract4
|
|
|
|
, vde2
|
2022-06-16 17:23:12 +00:00
|
|
|
, extraPythonPackages ? (_ : [])
|
2023-11-16 04:20:00 +00:00
|
|
|
, nixosTests
|
2021-12-19 01:06:50 +00:00
|
|
|
}:
|
|
|
|
|
2023-10-09 19:29:22 +00:00
|
|
|
python3Packages.buildPythonApplication {
|
2021-12-19 01:06:50 +00:00
|
|
|
pname = "nixos-test-driver";
|
2022-01-13 20:06:32 +00:00
|
|
|
version = "1.1";
|
2021-12-19 01:06:50 +00:00
|
|
|
src = ./.;
|
2023-10-09 19:29:22 +00:00
|
|
|
format = "pyproject";
|
2021-12-19 01:06:50 +00:00
|
|
|
|
2022-06-16 17:23:12 +00:00
|
|
|
propagatedBuildInputs = [
|
|
|
|
coreutils
|
|
|
|
netpbm
|
|
|
|
python3Packages.colorama
|
|
|
|
python3Packages.ptpython
|
|
|
|
qemu_pkg
|
|
|
|
socat
|
|
|
|
vde2
|
|
|
|
]
|
|
|
|
++ (lib.optionals enableOCR [ imagemagick_light tesseract4 ])
|
|
|
|
++ extraPythonPackages python3Packages;
|
2021-12-19 01:06:50 +00:00
|
|
|
|
2023-11-16 04:20:00 +00:00
|
|
|
passthru.tests = {
|
|
|
|
inherit (nixosTests.nixos-test-driver) driver-timeout;
|
|
|
|
};
|
|
|
|
|
2021-12-19 01:06:50 +00:00
|
|
|
doCheck = true;
|
2023-10-09 19:29:22 +00:00
|
|
|
nativeCheckInputs = with python3Packages; [ mypy ruff black ];
|
2021-12-19 01:06:50 +00:00
|
|
|
checkPhase = ''
|
2023-10-09 19:29:22 +00:00
|
|
|
echo -e "\x1b[32m## run mypy\x1b[0m"
|
|
|
|
mypy test_driver extract-docstrings.py
|
|
|
|
echo -e "\x1b[32m## run ruff\x1b[0m"
|
|
|
|
ruff .
|
|
|
|
echo -e "\x1b[32m## run black\x1b[0m"
|
|
|
|
black --check --diff .
|
2021-12-19 01:06:50 +00:00
|
|
|
'';
|
|
|
|
}
|