diff options
author | Dylan Baker <dylan@pnwbakers.com> | 2021-06-07 10:03:55 -0700 |
---|---|---|
committer | Daniel Mensinger <daniel@mensinger-ka.de> | 2021-06-08 11:00:55 +0200 |
commit | 3f9a81e7f14e166934b6fd44a1236aa808555656 (patch) | |
tree | 114fa5f7515d8682bf8999398d08f604d14d394b /mesonbuild/interpreter/kwargs.py | |
parent | 3e998527a350cb197ca61b59c0a98cb6681b5fdd (diff) | |
download | meson-3f9a81e7f14e166934b6fd44a1236aa808555656.zip meson-3f9a81e7f14e166934b6fd44a1236aa808555656.tar.gz meson-3f9a81e7f14e166934b6fd44a1236aa808555656.tar.bz2 |
interpreter: use typed_kwargs for the add_*_arguments family
This makes use of the new convertor and validator arguments, so that we
can check that the languages passed are in fact vaild, and then convert
the native boolean into a MachineChoice internally.
Diffstat (limited to 'mesonbuild/interpreter/kwargs.py')
-rw-r--r-- | mesonbuild/interpreter/kwargs.py | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/mesonbuild/interpreter/kwargs.py b/mesonbuild/interpreter/kwargs.py new file mode 100644 index 0000000..d5d9990 --- /dev/null +++ b/mesonbuild/interpreter/kwargs.py @@ -0,0 +1,26 @@ +# SPDX-License-Identifier: Apache-2.0 +# Copyright © 2021 The Meson Developers +# Copyright © 2021 Intel Corporation + +"""Keyword Argument type annotations.""" + +import typing as T + +from typing_extensions import TypedDict + +from ..mesonlib import MachineChoice + + +class FuncAddProjectArgs(TypedDict): + + """Keyword Arguments for the add_*_arguments family of arguments. + + including `add_global_arguments`, `add_project_arguments`, and their + link variants + + Because of the use of a convertor function, we get the native keyword as + a MachineChoice instance already. + """ + + native: MachineChoice + language: T.List[str] |