From ff31b814b62c760b1abbedc43d9b34d2dc75b351 Mon Sep 17 00:00:00 2001 From: Emily Date: Mon, 25 Nov 2024 17:12:00 +0000 Subject: [PATCH] =?UTF-8?q?nixos/lib/test-driver:=20fix=20linting=20after?= =?UTF-8?q?=20compatibility=20clean=E2=80=90up?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The previous commit removed the handling of `dict` arguments, but didn’t adjust the type, leading to the following type-checking error: test_driver/driver.py:216: error: Argument 1 to "NixStartScript" has incompatible type "str | dict[Any, Any]"; expected "str" [arg-type] It also left an unused import that Ruff is unhappy about: build/lib/test_driver/driver.py:11:22: F401 [*] `colorama.Fore` imported but unused … build/lib/test_driver/driver.py:11:28: F401 [*] `colorama.Style` imported but unused Fixes: 71306e6b36657f3987214611ec863a891334bf5a (cherry picked from commit d490680530a81f77bdd248cbc99aa4878d6d97c7) --- nixos/lib/test-driver/test_driver/driver.py | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/nixos/lib/test-driver/test_driver/driver.py b/nixos/lib/test-driver/test_driver/driver.py index 50d299788eda..5813966d84d6 100644 --- a/nixos/lib/test-driver/test_driver/driver.py +++ b/nixos/lib/test-driver/test_driver/driver.py @@ -7,8 +7,6 @@ from contextlib import contextmanager from pathlib import Path from typing import Any, Callable, ContextManager, Dict, Iterator, List, Optional, Union -from colorama import Fore, Style - from test_driver.logger import AbstractLogger from test_driver.machine import Machine, NixStartScript, retry from test_driver.polling_condition import PollingCondition @@ -205,7 +203,7 @@ class Driver: def create_machine( self, - start_command: str | dict, + start_command: str, *, name: Optional[str] = None, keep_vm_state: bool = False,