diff options
author | Tristan Partin <tristan@partin.io> | 2023-07-12 17:47:12 -0500 |
---|---|---|
committer | Tristan Partin <tristan@partin.io> | 2023-07-12 18:56:06 -0500 |
commit | d4bcf05c39e650d9651b5f2c60e7c12d59367e9c (patch) | |
tree | 1d635627d62aba0d77142583c7d1479d5e7b4d31 /mesonbuild/linkers | |
parent | 921c2370a722cbaa42bd256c699fae3185084939 (diff) | |
download | meson-d4bcf05c39e650d9651b5f2c60e7c12d59367e9c.zip meson-d4bcf05c39e650d9651b5f2c60e7c12d59367e9c.tar.gz meson-d4bcf05c39e650d9651b5f2c60e7c12d59367e9c.tar.bz2 |
Annotate naked fundamental Python types
Although mypy wasn't complaining, pyright was.
Diffstat (limited to 'mesonbuild/linkers')
-rw-r--r-- | mesonbuild/linkers/linkers.py | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/mesonbuild/linkers/linkers.py b/mesonbuild/linkers/linkers.py index 4b52c26..8675766 100644 --- a/mesonbuild/linkers/linkers.py +++ b/mesonbuild/linkers/linkers.py @@ -374,7 +374,7 @@ class DynamicLinker(metaclass=abc.ABCMeta): return args elif isinstance(self.prefix_arg, str): return [self.prefix_arg + arg for arg in args] - ret = [] + ret: T.List[str] = [] for arg in args: ret += self.prefix_arg + [arg] return ret @@ -670,14 +670,14 @@ class GnuLikeDynamicLinkerMixin: return ([], set()) if not rpath_paths and not install_rpath and not build_rpath: return ([], set()) - args = [] + args: T.List[str] = [] origin_placeholder = '$ORIGIN' processed_rpaths = prepare_rpaths(rpath_paths, build_dir, from_dir) # Need to deduplicate rpaths, as macOS's install_name_tool # is *very* allergic to duplicate -delete_rpath arguments # when calling depfixer on installation. all_paths = mesonlib.OrderedSet([os.path.join(origin_placeholder, p) for p in processed_rpaths]) - rpath_dirs_to_remove = set() + rpath_dirs_to_remove: T.Set[bytes] = set() for p in all_paths: rpath_dirs_to_remove.add(p.encode('utf8')) # Build_rpath is used as-is (it is usually absolute). @@ -812,7 +812,7 @@ class AppleDynamicLinker(PosixDynamicLinkerMixin, DynamicLinker): install_rpath: str) -> T.Tuple[T.List[str], T.Set[bytes]]: if not rpath_paths and not install_rpath and not build_rpath: return ([], set()) - args = [] + args: T.List[str] = [] # @loader_path is the equivalent of $ORIGIN on macOS # https://stackoverflow.com/q/26280738 origin_placeholder = '@loader_path' @@ -1152,7 +1152,7 @@ class NAGDynamicLinker(PosixDynamicLinkerMixin, DynamicLinker): install_rpath: str) -> T.Tuple[T.List[str], T.Set[bytes]]: if not rpath_paths and not install_rpath and not build_rpath: return ([], set()) - args = [] + args: T.List[str] = [] origin_placeholder = '$ORIGIN' processed_rpaths = prepare_rpaths(rpath_paths, build_dir, from_dir) all_paths = mesonlib.OrderedSet([os.path.join(origin_placeholder, p) for p in processed_rpaths]) @@ -1409,7 +1409,7 @@ class SolarisDynamicLinker(PosixDynamicLinkerMixin, DynamicLinker): return ([], set()) processed_rpaths = prepare_rpaths(rpath_paths, build_dir, from_dir) all_paths = mesonlib.OrderedSet([os.path.join('$ORIGIN', p) for p in processed_rpaths]) - rpath_dirs_to_remove = set() + rpath_dirs_to_remove: T.Set[bytes] = set() for p in all_paths: rpath_dirs_to_remove.add(p.encode('utf8')) if build_rpath != '': |