33"""
44The ``relenv build`` command.
55"""
6- import sys
7- import random
6+ from __future__ import annotations
7+
8+ import argparse
89import codecs
10+ import random
911import signal
12+ import sys
13+ from types import ModuleType
1014
11- from . import linux , darwin , windows
12- from .common import builds , CHECK_VERSIONS_SUPPORT
13-
14- from ..pyversions import python_versions , Version
15-
16- from ..common import build_arch , DEFAULT_PYTHON
15+ from . import darwin , linux , windows
16+ from .common import CHECK_VERSIONS_SUPPORT , builds
17+ from ..common import DEFAULT_PYTHON , build_arch
18+ from ..pyversions import Version , python_versions
1719
1820
19- def platform_module ():
21+ def platform_module () -> ModuleType :
2022 """
2123 Return the right module based on `sys.platform`.
2224 """
@@ -26,9 +28,12 @@ def platform_module():
2628 return linux
2729 elif sys .platform == "win32" :
2830 return windows
31+ raise RuntimeError (f"Unsupported platform: { sys .platform } " )
2932
3033
31- def setup_parser (subparsers ):
34+ def setup_parser (
35+ subparsers : argparse ._SubParsersAction [argparse .ArgumentParser ],
36+ ) -> None :
3237 """
3338 Setup the subparser for the ``build`` command.
3439
@@ -124,7 +129,7 @@ def setup_parser(subparsers):
124129 )
125130
126131
127- def main (args ) :
132+ def main (args : argparse . Namespace ) -> None :
128133 """
129134 The entrypoint to the ``build`` command.
130135
0 commit comments