at 24.11-pre 1.1 kB view raw
1{ lib 2, python3Packages 3, enableOCR ? false 4, qemu_pkg ? qemu_test 5, coreutils 6, imagemagick_light 7, netpbm 8, qemu_test 9, socat 10, ruff 11, tesseract4 12, vde2 13, extraPythonPackages ? (_ : []) 14, nixosTests 15}: 16 17python3Packages.buildPythonApplication { 18 pname = "nixos-test-driver"; 19 version = "1.1"; 20 src = ./.; 21 pyproject = true; 22 23 propagatedBuildInputs = [ 24 coreutils 25 netpbm 26 python3Packages.colorama 27 python3Packages.junit-xml 28 python3Packages.ptpython 29 qemu_pkg 30 socat 31 vde2 32 ] 33 ++ (lib.optionals enableOCR [ imagemagick_light tesseract4 ]) 34 ++ extraPythonPackages python3Packages; 35 36 nativeBuildInputs = [ 37 python3Packages.setuptools 38 ]; 39 40 passthru.tests = { 41 inherit (nixosTests.nixos-test-driver) driver-timeout; 42 }; 43 44 doCheck = true; 45 nativeCheckInputs = with python3Packages; [ mypy ruff black ]; 46 checkPhase = '' 47 echo -e "\x1b[32m## run mypy\x1b[0m" 48 mypy test_driver extract-docstrings.py 49 echo -e "\x1b[32m## run ruff\x1b[0m" 50 ruff check . 51 echo -e "\x1b[32m## run black\x1b[0m" 52 black --check --diff . 53 ''; 54}