summaryrefslogtreecommitdiff
path: root/mesonbuild/dependencies/cuda.py
diff options
context:
space:
mode:
authorDylan Baker <dylan@pnwbakers.com>2025-08-01 15:40:44 -0700
committerDylan Baker <dylan@pnwbakers.com>2025-10-20 15:15:53 -0700
commit035b8e4c013d686da7ab433b643338f696e15500 (patch)
treebf3fc4dcbf4e7e2f3014dfcdbf95efc7fcb34039 /mesonbuild/dependencies/cuda.py
parentae89ca1015fd1d8306bbb78c31f1bde53375a712 (diff)
downloadmeson-035b8e4c013d686da7ab433b643338f696e15500.tar.gz
dependency: Use a TypedDict to describe the keyword arguments to Dependency
This allows us to check that all of the keyword arguments are of the correct type.
Diffstat (limited to 'mesonbuild/dependencies/cuda.py')
-rw-r--r--mesonbuild/dependencies/cuda.py7
1 files changed, 4 insertions, 3 deletions
diff --git a/mesonbuild/dependencies/cuda.py b/mesonbuild/dependencies/cuda.py
index 6fe2f1d03..0bb8ffa6f 100644
--- a/mesonbuild/dependencies/cuda.py
+++ b/mesonbuild/dependencies/cuda.py
@@ -19,6 +19,7 @@ if T.TYPE_CHECKING:
from ..environment import Environment
from ..compilers import Compiler
from ..envconfig import MachineInfo
+ from .base import DependencyObjectKWs
TV_ResultTuple = T.Tuple[T.Optional[str], T.Optional[str], bool]
@@ -27,7 +28,7 @@ class CudaDependency(SystemDependency):
supported_languages = ['cpp', 'c', 'cuda'] # see also _default_language
targets_dir = 'targets' # Directory containing CUDA targets.
- def __init__(self, environment: 'Environment', kwargs: T.Dict[str, T.Any]) -> None:
+ def __init__(self, environment: 'Environment', kwargs: DependencyObjectKWs) -> None:
for_machine = self.get_for_machine_from_kwargs(kwargs)
compilers = environment.coredata.compilers[for_machine]
machine = environment.machines[for_machine]
@@ -310,8 +311,8 @@ class CudaDependency(SystemDependency):
def log_info(self) -> str:
return self.cuda_path if self.cuda_path else ''
- def get_requested(self, kwargs: T.Dict[str, T.Any]) -> T.List[str]:
- candidates = mesonlib.extract_as_list(kwargs, 'modules')
+ def get_requested(self, kwargs: DependencyObjectKWs) -> T.List[str]:
+ candidates = mesonlib.extract_as_list(kwargs, 'modules') # type: ignore[arg-type,var-annotated]
for c in candidates:
if not isinstance(c, str):
raise DependencyException('CUDA module argument is not a string.')