summaryrefslogtreecommitdiff
path: root/mesonbuild/interpreter/interpreter.py
diff options
context:
space:
mode:
authorDylan Baker <dylan@pnwbakers.com>2024-12-06 12:38:28 -0800
committerDylan Baker <dylan@pnwbakers.com>2025-10-20 15:15:53 -0700
commit8b1c5c9944ba0b28524d11a8d274f81733e4149b (patch)
tree975cd03b29a80a2580ea5245ca7cb0d6db17a32f /mesonbuild/interpreter/interpreter.py
parenta9c157b7c30534a47ae2963e542fc60a80d61584 (diff)
downloadmeson-8b1c5c9944ba0b28524d11a8d274f81733e4149b.tar.gz
interpreter: port dependency include_type to typed_kargs
The cleanup this allows lower down points out that we don't properly validate the value passed to `as_system()`. I have no idea what happens if you pass a non-valid value, but it's a bug and I've simply made it a hard error. We can re-assess if necessary.
Diffstat (limited to 'mesonbuild/interpreter/interpreter.py')
-rw-r--r--mesonbuild/interpreter/interpreter.py5
1 files changed, 1 insertions, 4 deletions
diff --git a/mesonbuild/interpreter/interpreter.py b/mesonbuild/interpreter/interpreter.py
index 648278426..c58824206 100644
--- a/mesonbuild/interpreter/interpreter.py
+++ b/mesonbuild/interpreter/interpreter.py
@@ -1788,7 +1788,6 @@ class Interpreter(InterpreterBase, HoldableObject):
search_dirs=search_dirs)
# When adding kwargs, please check if they make sense in dependencies.get_dep_identifier()
- @FeatureNewKwargs('dependency', '0.52.0', ['include_type'])
@FeatureNewKwargs('dependency', '0.50.0', ['not_found_message'])
@FeatureNewKwargs('dependency', '0.49.0', ['disabler'])
@FeatureNewKwargs('dependency', '0.40.0', ['method'])
@@ -1817,10 +1816,8 @@ class Interpreter(InterpreterBase, HoldableObject):
if not d.found() and not_found_message:
self.message_impl([not_found_message])
# Ensure the correct include type
- if 'include_type' in kwargs:
+ if kwargs['include_type'] != 'preserve':
wanted = kwargs['include_type']
- if not isinstance(wanted, str):
- raise InvalidArguments('The `include_type` kwarg must be a string')
actual = d.get_include_type()
if wanted != actual:
mlog.debug(f'Current include type of {args[0]} is {actual}. Converting to requested {wanted}')