|
40 | 40 | from itertools import chain |
41 | 41 | from pathlib import PurePath |
42 | 42 | import functools |
43 | | -import typing |
| 43 | +from typing import Sequence, List, Union, Optional, Iterator, Dict, Any |
44 | 44 |
|
45 | 45 | import importlib |
46 | 46 |
|
@@ -874,10 +874,10 @@ def __repr__(self): |
874 | 874 | return r.format(self.__class__.__name__, h.get_id(), h.command) |
875 | 875 |
|
876 | 876 | class Test(InterpreterObject): |
877 | | - def __init__(self, name: str, project: str, suite: typing.List[str], exe: build.Executable, |
878 | | - depends: typing.List[typing.Union[build.CustomTarget, build.BuildTarget]], |
879 | | - is_parallel: bool, cmd_args: typing.List[str], env: build.EnvironmentVariables, |
880 | | - should_fail: bool, timeout: int, workdir: typing.Optional[str], protocol: str): |
| 877 | + def __init__(self, name: str, project: str, suite: List[str], exe: build.Executable, |
| 878 | + depends: List[Union[build.CustomTarget, build.BuildTarget]], |
| 879 | + is_parallel: bool, cmd_args: List[str], env: build.EnvironmentVariables, |
| 880 | + should_fail: bool, timeout: int, workdir: Optional[str], protocol: str): |
881 | 881 | InterpreterObject.__init__(self) |
882 | 882 | self.name = name |
883 | 883 | self.suite = suite |
@@ -2773,7 +2773,7 @@ def func_exception(self, node, args, kwargs): |
2773 | 2773 | self.validate_arguments(args, 0, []) |
2774 | 2774 | raise Exception() |
2775 | 2775 |
|
2776 | | - def add_languages(self, args, required): |
| 2776 | + def add_languages(self, args: Sequence[str], required: bool) -> bool: |
2777 | 2777 | success = self.add_languages_for(args, required, MachineChoice.BUILD) |
2778 | 2778 | success &= self.add_languages_for(args, required, MachineChoice.HOST) |
2779 | 2779 | return success |
@@ -3831,7 +3831,7 @@ def func_add_test_setup(self, node, args, kwargs): |
3831 | 3831 |
|
3832 | 3832 | # TODO make cross agnostic, just taking into account for_machine |
3833 | 3833 | # TODO PerMachine[T], Iterator[T] |
3834 | | - def get_argdict_on_crossness(self, dicts_per_machine: PerMachine, kwargs) -> typing.Iterator: |
| 3834 | + def get_argdict_on_crossness(self, dicts_per_machine: PerMachine, kwargs) -> Iterator: |
3835 | 3835 | for_native = kwargs.get('native', not self.environment.is_cross_build()) |
3836 | 3836 | if not isinstance(for_native, bool): |
3837 | 3837 | raise InterpreterException('Keyword native must be a boolean.') |
@@ -4218,7 +4218,7 @@ def func_is_variable(self, node, args, kwargs): |
4218 | 4218 | return varname in self.variables |
4219 | 4219 |
|
4220 | 4220 | @staticmethod |
4221 | | - def machine_from_native_kwarg(kwargs: typing.Dict[str, typing.Any]) -> MachineChoice: |
| 4221 | + def machine_from_native_kwarg(kwargs: Dict[str, Any]) -> MachineChoice: |
4222 | 4222 | native = kwargs.get('native', False) |
4223 | 4223 | if not isinstance(native, bool): |
4224 | 4224 | raise InvalidArguments('Argument to "native" must be a boolean.') |
|
0 commit comments