1{ lib
2, python3Packages
3, enableOCR ? false
4, qemu_pkg ? qemu_test
5, coreutils
6, imagemagick_light
7, libtiff
8, netpbm
9, qemu_test
10, socat
11, tesseract4
12, vde2
13, extraPythonPackages ? (_ : [])
14}:
15
16python3Packages.buildPythonApplication rec {
17 pname = "nixos-test-driver";
18 version = "1.1";
19 src = ./.;
20
21 propagatedBuildInputs = [
22 coreutils
23 netpbm
24 python3Packages.colorama
25 python3Packages.ptpython
26 qemu_pkg
27 socat
28 vde2
29 ]
30 ++ (lib.optionals enableOCR [ imagemagick_light tesseract4 ])
31 ++ extraPythonPackages python3Packages;
32
33 doCheck = true;
34 nativeCheckInputs = with python3Packages; [ mypy pylint black ];
35 checkPhase = ''
36 mypy --disallow-untyped-defs \
37 --no-implicit-optional \
38 --pretty \
39 --no-color-output \
40 --ignore-missing-imports ${src}/test_driver
41 pylint --errors-only --enable=unused-import ${src}/test_driver
42 black --check --diff ${src}/test_driver
43 '';
44}