From 6f3d0ddd823cc0ac49634c353ebdac403dd4c799 Mon Sep 17 00:00:00 2001 From: Dylan Baker Date: Fri, 24 Oct 2025 09:26:35 -0700 Subject: dependencies: Pass the `name` to `ExternalDependency` constructor So we don't create a default name that is overwritten except in the case of appleframeworks. This allows for some cleanup, including deleting some initializers that were only setting the name. --- mesonbuild/dependencies/python.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'mesonbuild/dependencies/python.py') diff --git a/mesonbuild/dependencies/python.py b/mesonbuild/dependencies/python.py index aa2e22c6f..f979e705e 100644 --- a/mesonbuild/dependencies/python.py +++ b/mesonbuild/dependencies/python.py @@ -457,7 +457,8 @@ class _PythonDependencyBase(_Base): class PythonPkgConfigDependency(PkgConfigDependency, _PythonDependencyBase): - def __init__(self, environment: 'Environment', kwargs: DependencyObjectKWs, + # name is needed for polymorphism + def __init__(self, name: str, environment: Environment, kwargs: DependencyObjectKWs, installation: 'BasicPythonExternalProgram', embed: bool, for_machine: 'MachineChoice'): pkg_embed = '-embed' if embed and mesonlib.version_compare(installation.info['version'], '>=3.8') else '' @@ -579,7 +580,7 @@ def python_factory(env: 'Environment', for_machine: 'MachineChoice', if DependencyMethods.PKGCONFIG in methods: if from_installation: - candidates.append(functools.partial(PythonPkgConfigDependency, env, kwargs, installation, embed, for_machine)) + candidates.append(functools.partial(PythonPkgConfigDependency, 'python3', env, kwargs, installation, embed, for_machine)) else: candidates.append(functools.partial(PkgConfigDependency, 'python3', env, kwargs)) -- cgit v1.2.3