summaryrefslogtreecommitdiff
path: root/mesonbuild/mintro.py
diff options
context:
space:
mode:
authorVolker Weißmann <volker.weissmann@gmx.de>2025-03-09 17:15:52 +0100
committerDylan Baker <dylan@pnwbakers.com>2025-05-29 09:20:27 -0700
commit792db9439b30b64449097eb5e5fc940148cacaab (patch)
tree18caa6ae9e1ef35cb479ab42dead3eb79cdc2183 /mesonbuild/mintro.py
parent81558a0e39e969d9059e004088cc0e32b93e5f05 (diff)
downloadmeson-792db9439b30b64449097eb5e5fc940148cacaab.tar.gz
rewriter: Add IntrospectionDependency
To improve type-safety and readability we replace a dictionary with a new class `IntrospectionDependency`.
Diffstat (limited to 'mesonbuild/mintro.py')
-rw-r--r--mesonbuild/mintro.py19
1 files changed, 9 insertions, 10 deletions
diff --git a/mesonbuild/mintro.py b/mesonbuild/mintro.py
index ed4ccb7e2..94ecaf9d0 100644
--- a/mesonbuild/mintro.py
+++ b/mesonbuild/mintro.py
@@ -380,17 +380,16 @@ def list_compilers(coredata: cdata.CoreData) -> T.Dict[str, T.Dict[str, T.Dict[s
}
return compilers
-def list_deps_from_source(intr: IntrospectionInterpreter) -> T.List[T.Dict[str, T.Union[str, bool]]]:
- result: T.List[T.Dict[str, T.Union[str, bool]]] = []
+def list_deps_from_source(intr: IntrospectionInterpreter) -> T.List[T.Dict[str, T.Union[str, bool, T.List[str]]]]:
+ result: T.List[T.Dict[str, T.Union[str, bool, T.List[str]]]] = []
for i in intr.dependencies:
- keys = [
- 'name',
- 'required',
- 'version',
- 'has_fallback',
- 'conditional',
- ]
- result += [{k: v for k, v in i.items() if k in keys}]
+ result += [{
+ 'name': i.name,
+ 'required': i.required,
+ 'version': i.version,
+ 'has_fallback': i.has_fallback,
+ 'conditional': i.conditional,
+ }]
return result
def list_deps(coredata: cdata.CoreData, backend: backends.Backend) -> T.List[T.Dict[str, T.Union[str, T.List[str]]]]: