summaryrefslogtreecommitdiff
path: root/mesonbuild/minit.py
diff options
context:
space:
mode:
authorDaniel Mensinger <daniel@mensinger-ka.de>2020-08-30 13:26:41 +0200
committerDaniel Mensinger <daniel@mensinger-ka.de>2020-09-08 20:15:57 +0200
commitc637b913c94817c81e9a35287b995741a7089413 (patch)
tree903baf75b3d7e9cd3610e31614f29d1e53433a59 /mesonbuild/minit.py
parent6b1b995b32a867614535ba1d1c80844b273fc053 (diff)
downloadmeson-c637b913c94817c81e9a35287b995741a7089413.tar.gz
typing: fully annotate mcompile, minit, and msetup
Diffstat (limited to 'mesonbuild/minit.py')
-rw-r--r--mesonbuild/minit.py12
1 files changed, 8 insertions, 4 deletions
diff --git a/mesonbuild/minit.py b/mesonbuild/minit.py
index 06e6dd4f3..4a38313a1 100644
--- a/mesonbuild/minit.py
+++ b/mesonbuild/minit.py
@@ -25,6 +25,10 @@ from glob import glob
from mesonbuild import mesonlib
from mesonbuild.environment import detect_ninja
from mesonbuild.templates.samplefactory import sameple_generator
+import typing as T
+
+if T.TYPE_CHECKING:
+ import argparse
'''
we currently have one meson template at this time.
@@ -49,7 +53,7 @@ meson compile -C builddir
'''
-def create_sample(options) -> None:
+def create_sample(options: 'argparse.Namespace') -> None:
'''
Based on what arguments are passed we check for a match in language
then check for project type and create new Meson samples project.
@@ -63,7 +67,7 @@ def create_sample(options) -> None:
raise RuntimeError('Unreachable code')
print(INFO_MESSAGE)
-def autodetect_options(options, sample: bool = False) -> None:
+def autodetect_options(options: 'argparse.Namespace', sample: bool = False) -> None:
'''
Here we autodetect options for args not passed in so don't have to
think about it.
@@ -129,7 +133,7 @@ def autodetect_options(options, sample: bool = False) -> None:
raise SystemExit("Can't autodetect language, please specify it with -l.")
print("Detected language: " + options.language)
-def add_arguments(parser):
+def add_arguments(parser: 'argparse.ArgumentParser') -> None:
'''
Here we add args for that the user can passed when making a new
Meson project.
@@ -146,7 +150,7 @@ def add_arguments(parser):
parser.add_argument('--type', default=DEFAULT_PROJECT, choices=('executable', 'library'), help="project type. default: {} based project".format(DEFAULT_PROJECT))
parser.add_argument('--version', default=DEFAULT_VERSION, help="project version. default: {}".format(DEFAULT_VERSION))
-def run(options) -> int:
+def run(options: 'argparse.Namespace') -> int:
'''
Here we generate the new Meson sample project.
'''