summary refs log tree commit diff
path: root/nixos/lib/test-driver/default.nix
blob: 3aee913431890a7ed29156b9e517380d3beef592 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
{ lib
, python3Packages
, enableOCR ? false
, qemu_pkg ? qemu_test
, coreutils
, imagemagick_light
, libtiff
, netpbm
, qemu_test
, socat
, tesseract4
, vde2
}:

python3Packages.buildPythonApplication rec {
  pname = "nixos-test-driver";
  version = "1.1";
  src = ./.;

  propagatedBuildInputs = [ coreutils netpbm python3Packages.colorama python3Packages.ptpython qemu_pkg socat vde2 ]
    ++ (lib.optionals enableOCR [ imagemagick_light tesseract4 ]);

  doCheck = true;
  checkInputs = with python3Packages; [ mypy pylint black ];
  checkPhase = ''
    mypy --disallow-untyped-defs \
          --no-implicit-optional \
          --ignore-missing-imports ${src}/test_driver
    pylint --errors-only --enable=unused-import ${src}/test_driver
    black --check --diff ${src}/test_driver
  '';
}