aboutsummaryrefslogtreecommitdiff
path: root/mesonbuild/cmake
diff options
context:
space:
mode:
authorEli Schwartz <eschwartz@archlinux.org>2023-08-10 20:51:45 -0400
committerEli Schwartz <eschwartz@archlinux.org>2023-08-11 13:37:17 -0400
commita01418db0a37908cc2504adbb0cf56d333348f9a (patch)
tree6463a2f91154092fd7f1aeeb72f744258daa6ff8 /mesonbuild/cmake
parent03a2a3a6773785e087b296e9e6ff6791c6068f60 (diff)
downloadmeson-a01418db0a37908cc2504adbb0cf56d333348f9a.zip
meson-a01418db0a37908cc2504adbb0cf56d333348f9a.tar.gz
meson-a01418db0a37908cc2504adbb0cf56d333348f9a.tar.bz2
remove useless type annotations
These annotations all had a default initializer of the correct type, or a parent class annotation.
Diffstat (limited to 'mesonbuild/cmake')
-rw-r--r--mesonbuild/cmake/common.py24
-rw-r--r--mesonbuild/cmake/generator.py12
-rw-r--r--mesonbuild/cmake/traceparser.py6
3 files changed, 21 insertions, 21 deletions
diff --git a/mesonbuild/cmake/common.py b/mesonbuild/cmake/common.py
index 3de6c16..002cda7 100644
--- a/mesonbuild/cmake/common.py
+++ b/mesonbuild/cmake/common.py
@@ -167,10 +167,10 @@ class CMakeInclude:
class CMakeFileGroup:
def __init__(self, data: T.Dict[str, T.Any]) -> None:
self.defines = data.get('defines', '') # type: str
- self.flags = _flags_to_list(data.get('compileFlags', '')) # type: T.List[str]
+ self.flags = _flags_to_list(data.get('compileFlags', ''))
self.is_generated = data.get('isGenerated', False) # type: bool
self.language = data.get('language', 'C') # type: str
- self.sources = [Path(x) for x in data.get('sources', [])] # type: T.List[Path]
+ self.sources = [Path(x) for x in data.get('sources', [])]
# Fix the include directories
self.includes = [] # type: T.List[CMakeInclude]
@@ -196,18 +196,18 @@ class CMakeFileGroup:
class CMakeTarget:
def __init__(self, data: T.Dict[str, T.Any]) -> None:
- self.artifacts = [Path(x) for x in data.get('artifacts', [])] # type: T.List[Path]
- self.src_dir = Path(data.get('sourceDirectory', '')) # type: Path
- self.build_dir = Path(data.get('buildDirectory', '')) # type: Path
+ self.artifacts = [Path(x) for x in data.get('artifacts', [])]
+ self.src_dir = Path(data.get('sourceDirectory', ''))
+ self.build_dir = Path(data.get('buildDirectory', ''))
self.name = data.get('name', '') # type: str
self.full_name = data.get('fullName', '') # type: str
self.install = data.get('hasInstallRule', False) # type: bool
- self.install_paths = [Path(x) for x in set(data.get('installPaths', []))] # type: T.List[Path]
+ self.install_paths = [Path(x) for x in set(data.get('installPaths', []))]
self.link_lang = data.get('linkerLanguage', '') # type: str
- self.link_libraries = _flags_to_list(data.get('linkLibraries', '')) # type: T.List[str]
- self.link_flags = _flags_to_list(data.get('linkFlags', '')) # type: T.List[str]
- self.link_lang_flags = _flags_to_list(data.get('linkLanguageFlags', '')) # type: T.List[str]
- # self.link_path = Path(data.get('linkPath', '')) # type: Path
+ self.link_libraries = _flags_to_list(data.get('linkLibraries', ''))
+ self.link_flags = _flags_to_list(data.get('linkFlags', ''))
+ self.link_lang_flags = _flags_to_list(data.get('linkLanguageFlags', ''))
+ # self.link_path = Path(data.get('linkPath', ''))
self.type = data.get('type', 'EXECUTABLE') # type: str
# self.is_generator_provided = data.get('isGeneratorProvided', False) # type: bool
self.files = [] # type: T.List[CMakeFileGroup]
@@ -237,8 +237,8 @@ class CMakeTarget:
class CMakeProject:
def __init__(self, data: T.Dict[str, T.Any]) -> None:
- self.src_dir = Path(data.get('sourceDirectory', '')) # type: Path
- self.build_dir = Path(data.get('buildDirectory', '')) # type: Path
+ self.src_dir = Path(data.get('sourceDirectory', ''))
+ self.build_dir = Path(data.get('buildDirectory', ''))
self.name = data.get('name', '') # type: str
self.targets = [] # type: T.List[CMakeTarget]
diff --git a/mesonbuild/cmake/generator.py b/mesonbuild/cmake/generator.py
index 5b83479..f47625c 100644
--- a/mesonbuild/cmake/generator.py
+++ b/mesonbuild/cmake/generator.py
@@ -38,8 +38,8 @@ def parse_generator_expressions(
if '$<' not in raw:
return raw
- out = '' # type: str
- i = 0 # type: int
+ out = ''
+ i = 0
def equal(arg: str) -> str:
col_pos = arg.find(',')
@@ -147,10 +147,10 @@ def parse_generator_expressions(
nonlocal i
i += 2
- func = '' # type: str
- args = '' # type: str
- res = '' # type: str
- exp = '' # type: str
+ func = ''
+ args = ''
+ res = ''
+ exp = ''
# Determine the body of the expression
while i < len(raw):
diff --git a/mesonbuild/cmake/traceparser.py b/mesonbuild/cmake/traceparser.py
index 7f31f13..92ff780 100644
--- a/mesonbuild/cmake/traceparser.py
+++ b/mesonbuild/cmake/traceparser.py
@@ -107,8 +107,8 @@ class CMakeTraceParser:
self.custom_targets = [] # type: T.List[CMakeGeneratorTarget]
self.env = env
- self.permissive = permissive # type: bool
- self.cmake_version = cmake_version # type: str
+ self.permissive = permissive
+ self.cmake_version = cmake_version
self.trace_file = 'cmake_trace.txt'
self.trace_file_path = build_dir / self.trace_file
self.trace_format = 'json-v1' if version_compare(cmake_version, '>=3.17') else 'human'
@@ -785,7 +785,7 @@ class CMakeTraceParser:
fixed_list = [] # type: T.List[str]
curr_str = None # type: T.Optional[str]
- path_found = False # type: bool
+ path_found = False
for i in broken_list:
if curr_str is None: