1
1
"""
2
2
This module pulls together this package: create and parse CLI arguments for tox.
3
3
"""
4
+ from __future__ import annotations
4
5
5
- from typing import Dict , Optional , Sequence , Tuple , cast
6
+ from typing import Dict , Sequence , cast
6
7
7
8
from tox .config .source import Source , discover_source
8
9
from tox .report import ToxHandler , setup_report
12
13
Handlers = Dict [str , Handler ]
13
14
14
15
15
- def get_options (* args : str ) -> Tuple [Parsed , Handlers , Optional [ Sequence [str ]] , ToxHandler , Source ]:
16
- pos_args : Optional [ Tuple [ str , ...]] = None
16
+ def get_options (* args : str ) -> tuple [Parsed , Handlers , Sequence [str ] | None , ToxHandler , Source ]:
17
+ pos_args : tuple [ str , ...] | None = None
17
18
try : # remove positional arguments passed to parser if specified, they are pulled directly from sys.argv
18
19
pos_arg_at = args .index ("--" )
19
20
except ValueError :
@@ -29,7 +30,7 @@ def get_options(*args: str) -> Tuple[Parsed, Handlers, Optional[Sequence[str]],
29
30
return parsed , cmd_handlers , pos_args , log_handler , source
30
31
31
32
32
- def _get_base (args : Sequence [str ]) -> Tuple [int , ToxHandler , Source ]:
33
+ def _get_base (args : Sequence [str ]) -> tuple [int , ToxHandler , Source ]:
33
34
"""First just load the base options (verbosity+color) to setup the logging framework."""
34
35
tox_parser = ToxParser .base ()
35
36
parsed , _ = tox_parser .parse_known_args (args )
@@ -44,7 +45,7 @@ def _get_base(args: Sequence[str]) -> Tuple[int, ToxHandler, Source]:
44
45
return guess_verbosity , handler , source
45
46
46
47
47
- def _get_all (args : Sequence [str ]) -> Tuple [Parsed , Handlers ]:
48
+ def _get_all (args : Sequence [str ]) -> tuple [Parsed , Handlers ]:
48
49
"""Parse all the options."""
49
50
tox_parser = _get_parser ()
50
51
parsed = cast (Parsed , tox_parser .parse_args (args ))
0 commit comments