summaryrefslogtreecommitdiff
path: root/mesonbuild/dependencies
diff options
context:
space:
mode:
authorDylan Baker <dylan@pnwbakers.com>2024-12-09 09:46:56 -0800
committerDylan Baker <dylan@pnwbakers.com>2025-10-20 15:15:53 -0700
commit793ba9a54357c7b7bbce03d82ec5cc9e0f71dc72 (patch)
treed511174c9cb13c7699c93ee0daecd2b4c0cbdc56 /mesonbuild/dependencies
parentac49d7e2a8183d4e68c9b006318c4ed4c2efabae (diff)
downloadmeson-793ba9a54357c7b7bbce03d82ec5cc9e0f71dc72.tar.gz
modules/python: port dependency embed to typed_kwargs
Diffstat (limited to 'mesonbuild/dependencies')
-rw-r--r--mesonbuild/dependencies/base.py3
-rw-r--r--mesonbuild/dependencies/python.py10
2 files changed, 8 insertions, 5 deletions
diff --git a/mesonbuild/dependencies/base.py b/mesonbuild/dependencies/base.py
index 547beb61e..685e1eaca 100644
--- a/mesonbuild/dependencies/base.py
+++ b/mesonbuild/dependencies/base.py
@@ -58,6 +58,9 @@ if T.TYPE_CHECKING:
static: T.Optional[bool]
version: T.List[str]
+ # Only in the python dependency
+ embed: bool
+
_MissingCompilerBase = Compiler
else:
_MissingCompilerBase = object
diff --git a/mesonbuild/dependencies/python.py b/mesonbuild/dependencies/python.py
index 0f9a618b6..021bd3294 100644
--- a/mesonbuild/dependencies/python.py
+++ b/mesonbuild/dependencies/python.py
@@ -1,4 +1,4 @@
-# SPDX-License-Identifier: Apache-2.0
+# SPDX-License-Identifier: Apache-2.
# Copyright 2022 The Meson development team
from __future__ import annotations
@@ -484,7 +484,7 @@ class PythonPkgConfigDependency(PkgConfigDependency, _PythonDependencyBase):
pkgconfig_paths = [pkg_libdir] if pkg_libdir else []
PkgConfigDependency.__init__(self, pkg_name, environment, kwargs, extra_paths=pkgconfig_paths)
- _PythonDependencyBase.__init__(self, installation, T.cast('bool', kwargs.get('embed', False)), for_machine)
+ _PythonDependencyBase.__init__(self, installation, kwargs.get('embed', False), for_machine)
if pkg_libdir and not self.is_found:
mlog.debug(f'{pkg_name!r} could not be found in {pkg_libdir_origin}, '
@@ -512,7 +512,7 @@ class PythonFrameworkDependency(ExtraFrameworkDependency, _PythonDependencyBase)
kwargs: DependencyObjectKWs, installation: 'BasicPythonExternalProgram',
for_machine: 'MachineChoice'):
ExtraFrameworkDependency.__init__(self, name, environment, kwargs)
- _PythonDependencyBase.__init__(self, installation, T.cast('bool', kwargs.get('embed', False)), for_machine)
+ _PythonDependencyBase.__init__(self, installation, kwargs.get('embed', False), for_machine)
class PythonSystemDependency(SystemDependency, _PythonDependencyBase):
@@ -521,7 +521,7 @@ class PythonSystemDependency(SystemDependency, _PythonDependencyBase):
kwargs: DependencyObjectKWs, installation: 'BasicPythonExternalProgram',
for_machine: 'MachineChoice'):
SystemDependency.__init__(self, name, environment, kwargs)
- _PythonDependencyBase.__init__(self, installation, T.cast('bool', kwargs.get('embed', False)), for_machine)
+ _PythonDependencyBase.__init__(self, installation, kwargs.get('embed', False), for_machine)
# For most platforms, match pkg-config behavior. iOS is a special case;
# check for that first, so that check takes priority over
@@ -569,7 +569,7 @@ def python_factory(env: 'Environment', for_machine: 'MachineChoice',
# We can't use the factory_methods decorator here, as we need to pass the
# extra installation argument
methods = process_method_kw({DependencyMethods.PKGCONFIG, DependencyMethods.SYSTEM}, kwargs)
- embed = T.cast('bool', kwargs.get('embed', False))
+ embed = kwargs.get('embed', False)
candidates: T.List['DependencyGenerator'] = []
from_installation = installation is not None
# When not invoked through the python module, default installation.