diff options
author | Dylan Baker <dylan@pnwbakers.com> | 2022-05-26 12:47:22 -0700 |
---|---|---|
committer | Eli Schwartz <eschwartz93@gmail.com> | 2022-06-01 22:49:10 -0400 |
commit | 503a061e6866bd2999505f92e6e44b51988472e8 (patch) | |
tree | 6186314960061ea5ba7a76a095a3f127f5cc9013 /mesonbuild/build.py | |
parent | 2a0082b13a19833ad3e09589df51a1535b925cf6 (diff) | |
download | meson-503a061e6866bd2999505f92e6e44b51988472e8.zip meson-503a061e6866bd2999505f92e6e44b51988472e8.tar.gz meson-503a061e6866bd2999505f92e6e44b51988472e8.tar.bz2 |
targets: Fix annotations of get_install_dir to be accurate
Diffstat (limited to 'mesonbuild/build.py')
-rw-r--r-- | mesonbuild/build.py | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/mesonbuild/build.py b/mesonbuild/build.py index f47279e..2f2163f 100644 --- a/mesonbuild/build.py +++ b/mesonbuild/build.py @@ -607,10 +607,10 @@ class Target(HoldableObject): def get_default_install_dir(self) -> T.Tuple[str, str]: raise NotImplementedError - def get_custom_install_dir(self) -> T.List[T.Union[str, bool]]: + def get_custom_install_dir(self) -> T.List[T.Union[str, Literal[False]]]: raise NotImplementedError - def get_install_dir(self) -> T.Tuple[T.Any, str, bool]: + def get_install_dir(self) -> T.Tuple[T.List[T.Union[str, Literal[False]]], str, Literal[False]]: # Find the installation directory. default_install_dir, install_dir_name = self.get_default_install_dir() outdirs = self.get_custom_install_dir() @@ -734,7 +734,7 @@ class Target(HoldableObject): class BuildTarget(Target): known_kwargs = known_build_target_kwargs - install_dir: T.List[T.Union[str, bool]] + install_dir: T.List[T.Union[str, Literal[False]]] def __init__(self, name: str, subdir: str, subproject: SubProject, for_machine: MachineChoice, sources: T.List['SourceOutputs'], structured_sources: T.Optional[StructuredSources], @@ -1085,7 +1085,7 @@ class BuildTarget(Target): def get_default_install_dir(self) -> T.Tuple[str, str]: return self.environment.get_libdir(), '{libdir}' - def get_custom_install_dir(self) -> T.List[T.Union[str, bool]]: + def get_custom_install_dir(self) -> T.List[T.Union[str, Literal[False]]]: return self.install_dir def get_custom_install_mode(self) -> T.Optional['FileMode']: @@ -2421,7 +2421,7 @@ class CustomTarget(Target, CommandBase): env: T.Optional[EnvironmentVariables] = None, feed: bool = False, install: bool = False, - install_dir: T.Optional[T.Sequence[T.Union[str, bool]]] = None, + install_dir: T.Optional[T.Sequence[T.Union[str, Literal[False]]]] = None, install_mode: T.Optional[FileMode] = None, install_tag: T.Optional[T.Sequence[T.Optional[str]]] = None, absolute_paths: bool = False, @@ -2499,7 +2499,7 @@ class CustomTarget(Target, CommandBase): def should_install(self) -> bool: return self.install - def get_custom_install_dir(self) -> T.List[T.Union[str, bool]]: + def get_custom_install_dir(self) -> T.List[T.Union[str, Literal[False]]]: return self.install_dir def get_custom_install_mode(self) -> T.Optional['FileMode']: @@ -2774,7 +2774,7 @@ class CustomTargetIndex(HoldableObject): def extract_all_objects_recurse(self) -> T.List[T.Union[str, 'ExtractedObjects']]: return self.target.extract_all_objects_recurse() - def get_custom_install_dir(self) -> T.List[T.Union[str, bool]]: + def get_custom_install_dir(self) -> T.List[T.Union[str, Literal[False]]]: return self.target.get_custom_install_dir() class ConfigurationData(HoldableObject): |