nixos/test-driver: modernize

This commit is contained in:
Nick Cao
2024-11-22 10:05:19 -05:00
parent 42d4046e94
commit ef2d3c542a

View File

@@ -20,6 +20,8 @@ in
python3Packages.buildPythonApplication { python3Packages.buildPythonApplication {
pname = "nixos-test-driver"; pname = "nixos-test-driver";
version = "1.1"; version = "1.1";
pyproject = true;
src = fs.toSource { src = fs.toSource {
root = ./.; root = ./.;
fileset = fs.unions [ fileset = fs.unions [
@@ -28,27 +30,31 @@ python3Packages.buildPythonApplication {
./extract-docstrings.py ./extract-docstrings.py
]; ];
}; };
pyproject = true;
build-system = with python3Packages; [
setuptools
];
dependencies =
with python3Packages;
[
colorama
junit-xml
ptpython
]
++ extraPythonPackages python3Packages;
propagatedBuildInputs = propagatedBuildInputs =
[ [
coreutils coreutils
netpbm netpbm
python3Packages.colorama
python3Packages.junit-xml
python3Packages.ptpython
qemu_pkg qemu_pkg
socat socat
vde2 vde2
] ]
++ (lib.optionals enableOCR [ ++ lib.optionals enableOCR [
imagemagick_light imagemagick_light
tesseract4 tesseract4
])
++ extraPythonPackages python3Packages;
nativeBuildInputs = [
python3Packages.setuptools
]; ];
passthru.tests = { passthru.tests = {
@@ -56,11 +62,13 @@ python3Packages.buildPythonApplication {
}; };
doCheck = true; doCheck = true;
nativeCheckInputs = with python3Packages; [ nativeCheckInputs = with python3Packages; [
mypy mypy
ruff ruff
black black
]; ];
checkPhase = '' checkPhase = ''
echo -e "\x1b[32m## run mypy\x1b[0m" echo -e "\x1b[32m## run mypy\x1b[0m"
mypy test_driver extract-docstrings.py mypy test_driver extract-docstrings.py