From 7e0492b8edd6eb43e4c5cdffee501a228f3b39f8 Mon Sep 17 00:00:00 2001 From: Dylan Baker Date: Fri, 6 Dec 2024 14:42:19 -0800 Subject: [PATCH] interpreter: remove dependency_kwargs Since it's basically unusued, but the DEPENDENCY_KWS can be used instead --- mesonbuild/dependencies/detect.py | 3 +-- mesonbuild/interpreter/__init__.py | 5 ++--- mesonbuild/interpreter/interpreter.py | 22 ---------------------- 3 files changed, 3 insertions(+), 27 deletions(-) diff --git a/mesonbuild/dependencies/detect.py b/mesonbuild/dependencies/detect.py index f043034a13d5..3784cc0d2840 100644 --- a/mesonbuild/dependencies/detect.py +++ b/mesonbuild/dependencies/detect.py @@ -44,8 +44,7 @@ def get_dep_identifier(name: str, kwargs: T.Dict[str, T.Any]) -> 'TV_DepID': nkwargs = {k.name: k.default for k in DEPENDENCY_KWS} nkwargs.update(kwargs) - from ..interpreter import permitted_dependency_kwargs - assert len(permitted_dependency_kwargs) == 19, \ + assert len(DEPENDENCY_KWS) == 20, \ 'Extra kwargs have been added to dependency(), please review if it makes sense to handle it here' for key, value in nkwargs.items(): # 'version' is irrelevant for caching; the caller must check version matches diff --git a/mesonbuild/interpreter/__init__.py b/mesonbuild/interpreter/__init__.py index e2ccce479093..12469b5b69cd 100644 --- a/mesonbuild/interpreter/__init__.py +++ b/mesonbuild/interpreter/__init__.py @@ -1,12 +1,11 @@ # SPDX-license-identifier: Apache-2.0 # Copyright 2012-2021 The Meson development team -# Copyright © 2021-2023 Intel Corporation +# Copyright © 2021-2024 Intel Corporation """Meson interpreter.""" __all__ = [ 'Interpreter', - 'permitted_dependency_kwargs', 'CompilerHolder', @@ -30,7 +29,7 @@ 'StringHolder', ] -from .interpreter import Interpreter, permitted_dependency_kwargs +from .interpreter import Interpreter from .compiler import CompilerHolder from .interpreterobjects import (ExecutableHolder, BuildTargetHolder, CustomTargetHolder, CustomTargetIndexHolder, MachineHolder, Test, diff --git a/mesonbuild/interpreter/interpreter.py b/mesonbuild/interpreter/interpreter.py index 087184ba71a6..195699888430 100644 --- a/mesonbuild/interpreter/interpreter.py +++ b/mesonbuild/interpreter/interpreter.py @@ -235,28 +235,6 @@ class InterpreterRuleRelaxation(Enum): ALLOW_BUILD_DIR_FILE_REFERENCES = 1 -permitted_dependency_kwargs = { - 'allow_fallback', - 'cmake_args', - 'cmake_module_path', - 'cmake_package_version', - 'components', - 'default_options', - 'fallback', - 'include_type', - 'language', - 'main', - 'method', - 'modules', - 'native', - 'not_found_message', - 'optional_modules', - 'private_headers', - 'required', - 'static', - 'version', -} - implicit_check_false_warning = """You should add the boolean check kwarg to the run_command call. It currently defaults to false, but it will default to true in meson 2.0.