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
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
|
{
lib,
stdenv,
buildPythonApplication,
colorama,
coreutils,
imagemagick_light,
ipython,
junit-xml,
ptpython,
pydantic,
python,
ovmfvartool,
remote-pdb,
ruff,
ty,
netpbm,
vhost-device-vsock,
nixosTests,
setuptools,
socat,
systemd,
tesseract4,
util-linux,
vde2,
enableNspawn ? false,
enableOCR ? false,
extraPythonPackages ? (_: [ ]),
}:
buildPythonApplication {
pname = "nixos-test-driver";
version = "1.1";
pyproject = true;
src = ./src;
build-system = [
setuptools
];
dependencies = [
colorama
ipython
junit-xml
ptpython
pydantic
ovmfvartool
remote-pdb
]
++ extraPythonPackages python.pkgs;
propagatedBuildInputs = [
coreutils
netpbm
socat
util-linux
vde2
]
++ lib.optionals stdenv.hostPlatform.isLinux [
vhost-device-vsock
]
++ lib.optionals enableNspawn [
systemd
]
++ lib.optionals enableOCR [
imagemagick_light
tesseract4
];
# containers test requires extra nix features that are not available in ofborg.
passthru.tests = removeAttrs nixosTests.nixos-test-driver [ "containers" ];
doCheck = true;
nativeCheckInputs = [
ruff
ty
];
checkPhase = ''
echo -e "\x1b[32m## run ty\x1b[0m"
ty check --error-on-warning 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 .
'';
}
|