formats/v1: add type hints

Add type hints to most arguments and return types to aid editors
and type checking.
This commit is contained in:
Christian Kellner 2020-12-16 14:58:52 +01:00 committed by Tom Gundersen
parent aaf61ce9fc
commit b49ee53d0a

View file

@ -1,9 +1,10 @@
# Version 1 of the manifest description
from typing import Dict
from ..pipeline import Pipeline, detect_host_runner
def load_build(description, sources_options):
def load_build(description: Dict, sources_options: Dict):
pipeline = description.get("pipeline")
if pipeline:
build_pipeline = load(pipeline, sources_options)
@ -13,7 +14,7 @@ def load_build(description, sources_options):
return build_pipeline, description["runner"]
def load(description, sources_options):
def load(description: Dict, sources_options: Dict) -> Pipeline:
build = description.get("build")
if build:
build_pipeline, runner = load_build(build, sources_options)