summaryrefslogtreecommitdiff
path: root/mesonbuild/dependencies/python.py
diff options
context:
space:
mode:
authorDylan Baker <dylan@pnwbakers.com>2025-10-27 10:07:48 -0700
committerDylan Baker <dylan@pnwbakers.com>2025-12-17 14:47:18 -0800
commit4abca7cad31d68dc453d533858e5b6ed1468d660 (patch)
treeda7659ac6b87be49b85e771f18591184de77061f /mesonbuild/dependencies/python.py
parent195dab0ea81986fe8cdcec6072fa67f978af3135 (diff)
downloadmeson-4abca7cad31d68dc453d533858e5b6ed1468d660.tar.gz
dependencies: Remove `log_tried` method
It's now only used to populate the DependencyCandidate, so we can remove it and just calculate the same information from the `type_name` parameter. This reduces code and the number of method calls.
Diffstat (limited to 'mesonbuild/dependencies/python.py')
-rw-r--r--mesonbuild/dependencies/python.py11
1 files changed, 4 insertions, 7 deletions
diff --git a/mesonbuild/dependencies/python.py b/mesonbuild/dependencies/python.py
index 9614196d9..0e40d481f 100644
--- a/mesonbuild/dependencies/python.py
+++ b/mesonbuild/dependencies/python.py
@@ -559,10 +559,6 @@ class PythonSystemDependency(SystemDependency, _PythonDependencyBase):
if not self.clib_compiler.has_header('Python.h', '', extra_args=self.compile_args)[0]:
self.is_found = False
- @staticmethod
- def log_tried() -> str:
- return 'sysconfig'
-
def python_factory(env: Environment, kwargs: DependencyObjectKWs,
installation: T.Optional['BasicPythonExternalProgram'] = None) -> T.List['DependencyGenerator']:
# We can't use the factory_methods decorator here, as we need to pass the
@@ -579,15 +575,16 @@ def python_factory(env: Environment, kwargs: DependencyObjectKWs,
if from_installation:
candidates.append(DependencyCandidate(
functools.partial(PythonPkgConfigDependency, installation=installation),
- 'python3', PythonPkgConfigDependency.log_tried(), arguments=(env, kwargs)))
+ 'python3', PythonPkgConfigDependency.type_name, arguments=(env, kwargs)))
else:
candidates.append(DependencyCandidate.from_dependency(
'python3', PkgConfigDependency, (env, kwargs)))
if DependencyMethods.SYSTEM in methods:
+ # This is a unique log-tried.
candidates.append(DependencyCandidate(
functools.partial(PythonSystemDependency, installation=installation),
- 'python', PythonSystemDependency.log_tried(), arguments=(env, kwargs)))
+ 'python', 'sysconfig', arguments=(env, kwargs)))
if DependencyMethods.EXTRAFRAMEWORK in methods:
nkwargs = kwargs.copy()
@@ -597,7 +594,7 @@ def python_factory(env: Environment, kwargs: DependencyObjectKWs,
nkwargs['paths'] = ['/Library/Frameworks']
candidates.append(DependencyCandidate(
functools.partial(PythonFrameworkDependency, installation=installation),
- 'python', PythonFrameworkDependency.log_tried(), arguments=(env, nkwargs)))
+ 'python', PythonPkgConfigDependency.type_name, arguments=(env, nkwargs)))
return candidates