diff options
| author | Dylan Baker <dylan@pnwbakers.com> | 2025-08-03 14:53:09 -0700 |
|---|---|---|
| committer | Dylan Baker <dylan@pnwbakers.com> | 2025-10-20 15:15:53 -0700 |
| commit | 87dac856b61dbd98e922aa159f08bce4852941d9 (patch) | |
| tree | 63c4c3a88da670622fa8b2f5c44d3923493c6774 /mesonbuild/dependencies | |
| parent | 2496bf2cf0781013ced5926b2be76a6a828e8cee (diff) | |
| download | meson-87dac856b61dbd98e922aa159f08bce4852941d9.tar.gz | |
dependencies: Add remaining internal arguments to Dependency classes
These may be better replaced by setting instance attributes, honestly.
Diffstat (limited to 'mesonbuild/dependencies')
| -rw-r--r-- | mesonbuild/dependencies/base.py | 4 | ||||
| -rw-r--r-- | mesonbuild/dependencies/configtool.py | 4 | ||||
| -rw-r--r-- | mesonbuild/dependencies/hdf5.py | 2 | ||||
| -rw-r--r-- | mesonbuild/dependencies/mpi.py | 4 | ||||
| -rw-r--r-- | mesonbuild/dependencies/python.py | 2 | ||||
| -rw-r--r-- | mesonbuild/dependencies/qt.py | 2 |
6 files changed, 11 insertions, 7 deletions
diff --git a/mesonbuild/dependencies/base.py b/mesonbuild/dependencies/base.py index ccccfdac2..b8cdd369a 100644 --- a/mesonbuild/dependencies/base.py +++ b/mesonbuild/dependencies/base.py @@ -62,7 +62,11 @@ if T.TYPE_CHECKING: embed: bool # Only passed internally, not part of the DSL API + paths: T.List[str] + returncode_value: int silent: bool + tools: T.List[str] + version_arg: str _MissingCompilerBase = Compiler else: diff --git a/mesonbuild/dependencies/configtool.py b/mesonbuild/dependencies/configtool.py index 2761bfb5d..e2721fe3b 100644 --- a/mesonbuild/dependencies/configtool.py +++ b/mesonbuild/dependencies/configtool.py @@ -45,10 +45,10 @@ class ConfigToolDependency(ExternalDependency): if not self.tool_name: self.tool_name = self.tools[0] if 'version_arg' in kwargs: - self.version_arg = kwargs['version_arg'] # type: ignore[typeddict-item] + self.version_arg = kwargs['version_arg'] req_version = kwargs.get('version', []) - tool, version = self.find_config(req_version, kwargs.get('returncode_value', 0), exclude_paths=exclude_paths) # type: ignore[arg-type] + tool, version = self.find_config(req_version, kwargs.get('returncode_value', 0), exclude_paths=exclude_paths) self.config = tool self.is_found = self.report_config(version, req_version) if not self.is_found: diff --git a/mesonbuild/dependencies/hdf5.py b/mesonbuild/dependencies/hdf5.py index be58b6db8..5894cfb46 100644 --- a/mesonbuild/dependencies/hdf5.py +++ b/mesonbuild/dependencies/hdf5.py @@ -102,7 +102,7 @@ class HDF5ConfigToolDependency(ConfigToolDependency): for_machine = kwargs.get('native', MachineChoice.HOST) nkwargs = kwargs.copy() - nkwargs['tools'] = tools # type: ignore[typeddict-unknown-key] + nkwargs['tools'] = tools # Override the compiler that the config tools are going to use by # setting the environment variables that they use for the compiler and diff --git a/mesonbuild/dependencies/mpi.py b/mesonbuild/dependencies/mpi.py index ce497372a..074dafde3 100644 --- a/mesonbuild/dependencies/mpi.py +++ b/mesonbuild/dependencies/mpi.py @@ -59,7 +59,7 @@ def mpi_factory(env: 'Environment', if compiler_is_intel: if env.machines[for_machine].is_windows(): - nwargs['returncode_value'] = 3 # type: ignore[typeddict-unknown-key] + nwargs['returncode_value'] = 3 if language == 'c': tool_names.append('mpiicc') @@ -76,7 +76,7 @@ def mpi_factory(env: 'Environment', elif language == 'fortran': tool_names.extend(['mpifort', 'mpif90', 'mpif77']) - nwargs['tools'] = tool_names # type: ignore[typeddict-unknown-key] + nwargs['tools'] = tool_names candidates.append(functools.partial( MPIConfigToolDependency, tool_names[0], env, nwargs, language=language)) diff --git a/mesonbuild/dependencies/python.py b/mesonbuild/dependencies/python.py index 021bd3294..707e07499 100644 --- a/mesonbuild/dependencies/python.py +++ b/mesonbuild/dependencies/python.py @@ -591,7 +591,7 @@ def python_factory(env: 'Environment', for_machine: 'MachineChoice', if mesonlib.version_compare(installation.version, '>= 3'): # There is a python in /System/Library/Frameworks, but that's python 2.x, # Python 3 will always be in /Library - nkwargs['paths'] = ['/Library/Frameworks'] # type: ignore[typeddict-unknown-key] + nkwargs['paths'] = ['/Library/Frameworks'] candidates.append(functools.partial(PythonFrameworkDependency, 'Python', env, nkwargs, installation, for_machine)) return candidates diff --git a/mesonbuild/dependencies/qt.py b/mesonbuild/dependencies/qt.py index 9aef02ef4..18e476338 100644 --- a/mesonbuild/dependencies/qt.py +++ b/mesonbuild/dependencies/qt.py @@ -356,7 +356,7 @@ class QmakeQtDependency(_QtBase, ConfigToolDependency, metaclass=abc.ABCMeta): # ExtraFrameworkDependency doesn't support any methods fw_kwargs = kwargs.copy() fw_kwargs.pop('method') - fw_kwargs['paths'] = [libdir] # type: ignore[typeddict-unknown-key] + fw_kwargs['paths'] = [libdir] for m in modules: fname = 'Qt' + m |
