diff --git a/mesonbuild/backend/backends.py b/mesonbuild/backend/backends.py index bc2b74ac3..6218156f2 100644 --- a/mesonbuild/backend/backends.py +++ b/mesonbuild/backend/backends.py @@ -1347,7 +1347,6 @@ class Backend: incs += compiler.get_include_args(i, False) return incs - def eval_custom_target_command( self, target: build.CustomTarget, absolute_outputs: bool = False) -> \ T.Tuple[T.List[str], T.List[str], T.List[str]]: diff --git a/mesonbuild/backend/ninjabackend.py b/mesonbuild/backend/ninjabackend.py index 59f94b1b4..2e2ff6d1b 100644 --- a/mesonbuild/backend/ninjabackend.py +++ b/mesonbuild/backend/ninjabackend.py @@ -2149,7 +2149,6 @@ https://gcc.gnu.org/bugzilla/show_bug.cgi?id=47485''')) self.add_rule(NinjaRule(rule, command, [], description, deps=deps, depfile=depfile)) - def generate_scanner_rules(self): rulename = 'depscan' if rulename in self.ruledict: @@ -2162,7 +2161,6 @@ https://gcc.gnu.org/bugzilla/show_bug.cgi?id=47485''')) rule = NinjaRule(rulename, command, args, description) self.add_rule(rule) - def generate_compile_rules(self): for for_machine in MachineChoice: clist = self.environment.coredata.compilers[for_machine] diff --git a/mesonbuild/backend/xcodebackend.py b/mesonbuild/backend/xcodebackend.py index 080a184bd..3732570fd 100644 --- a/mesonbuild/backend/xcodebackend.py +++ b/mesonbuild/backend/xcodebackend.py @@ -451,7 +451,6 @@ class XCodeBackend(backends.Backend): self.generator_buildfile_ids[k] = buildfile_ids self.generator_fileref_ids[k] = fileref_ids - def generate_native_frameworks_map(self): self.native_frameworks = {} self.native_frameworks_fileref = {} @@ -1027,7 +1026,6 @@ class XCodeBackend(backends.Backend): if i: children_array.add_item(i) - def generate_project_tree(self): tree_info = FileTreeEntry() for tname, t in self.build_targets.items(): @@ -1275,7 +1273,6 @@ class XCodeBackend(backends.Backend): gen_dict.add_item('shellScript', cmdstr) gen_dict.add_item('showEnvVarsInLog', 0) - def generate_pbx_sources_build_phase(self, objects_dict): for name in self.source_phase: phase_dict = PbxDict() @@ -1392,7 +1389,6 @@ class XCodeBackend(backends.Backend): settings_dict.add_item('SYMROOT', '"%s/build"' % self.environment.get_build_dir()) bt_dict.add_item('name', f'"{buildtype}"') - def determine_internal_dep_link_args(self, target, buildtype): links_dylib = False dep_libs = [] diff --git a/mesonbuild/compilers/c.py b/mesonbuild/compilers/c.py index e56d29e73..0a8f814c5 100644 --- a/mesonbuild/compilers/c.py +++ b/mesonbuild/compilers/c.py @@ -52,7 +52,6 @@ else: CompilerMixinBase = object - class CCompiler(CLikeCompiler, Compiler): @staticmethod diff --git a/mesonbuild/compilers/cpp.py b/mesonbuild/compilers/cpp.py index bd893b2ce..badd8cc23 100644 --- a/mesonbuild/compilers/cpp.py +++ b/mesonbuild/compilers/cpp.py @@ -554,7 +554,6 @@ class IntelCPPCompiler(IntelGnuLikeCompiler, CPPCompiler): c_stds += ['c++2a'] g_stds += ['gnu++2a'] - key = OptionKey('std', machine=self.for_machine, lang=self.language) opts.update({ key.evolve('eh'): coredata.UserComboOption( diff --git a/mesonbuild/compilers/cuda.py b/mesonbuild/compilers/cuda.py index 485bbfb1e..af607a5df 100644 --- a/mesonbuild/compilers/cuda.py +++ b/mesonbuild/compilers/cuda.py @@ -356,7 +356,6 @@ class CudaCompiler(Compiler): xflags.append(flag) continue - # Handle breakup of flag-values into a flag-part and value-part. if flag[:1] not in '-/': # This is not a flag. It's probably a file input. Pass it through. @@ -425,10 +424,8 @@ class CudaCompiler(Compiler): # The above should securely handle GCC's -Wl, -Wa, -Wp, arguments. continue - assert val is not None # Should only trip if there is a missing argument. - # Take care of the various NVCC-supported flags that need special handling. flag = self._FLAG_LONG2SHORT_WITHARGS.get(flag,flag) diff --git a/mesonbuild/compilers/detect.py b/mesonbuild/compilers/detect.py index efeb83c89..a8392791f 100644 --- a/mesonbuild/compilers/detect.py +++ b/mesonbuild/compilers/detect.py @@ -144,7 +144,6 @@ if T.TYPE_CHECKING: from ..programs import ExternalProgram - # Default compilers and linkers # ============================= @@ -340,7 +339,6 @@ def detect_static_linker(env: 'Environment', compiler: Compiler) -> StaticLinker _handle_exceptions(popen_exceptions, linkers, 'linker') - # Compilers # ========= @@ -618,7 +616,6 @@ def _detect_c_or_cpp_compiler(env: 'Environment', lang: str, for_machine: Machin ccache + compiler, version, for_machine, is_cross, info, exe_wrap, full_version=full_version, linker=linker) - _handle_exceptions(popen_exceptions, compilers) raise EnvironmentException(f'Unknown compiler {compilers}') diff --git a/mesonbuild/compilers/objcpp.py b/mesonbuild/compilers/objcpp.py index 63036557d..e52068de8 100644 --- a/mesonbuild/compilers/objcpp.py +++ b/mesonbuild/compilers/objcpp.py @@ -85,7 +85,6 @@ class ClangObjCPPCompiler(ClangCompiler, ObjCPPCompiler): '2': default_warn_args + ['-Wextra'], '3': default_warn_args + ['-Wextra', '-Wpedantic']} - def get_options(self) -> 'coredata.KeyedOptionDictType': opts = super().get_options() opts.update({ diff --git a/mesonbuild/environment.py b/mesonbuild/environment.py index 2369439a0..f095bfb8f 100644 --- a/mesonbuild/environment.py +++ b/mesonbuild/environment.py @@ -545,7 +545,6 @@ class Environment: self.options[key.as_build()] = value self._load_machine_file_options(config, properties.host, MachineChoice.HOST) - ## "freeze" now initialized configuration, and "save" to the class. self.machines = machines.default_missing() diff --git a/mesonbuild/interpreter/interpreter.py b/mesonbuild/interpreter/interpreter.py index 877326999..b2774f6ec 100644 --- a/mesonbuild/interpreter/interpreter.py +++ b/mesonbuild/interpreter/interpreter.py @@ -2512,7 +2512,6 @@ Try setting b_lundef to false instead.'''.format(self.coredata.options[OptionKey if project_root / self.subproject_dir in norm.parents: raise InterpreterException(f'Sandbox violation: Tried to grab {inputtype} {norm.name} from a nested subproject.') - @T.overload def source_strings_to_files(self, sources: T.List['mesonlib.FileOrString']) -> T.List['mesonlib.File']: ... diff --git a/mesonbuild/interpreter/mesonmain.py b/mesonbuild/interpreter/mesonmain.py index 15c108281..c35fddcad 100644 --- a/mesonbuild/interpreter/mesonmain.py +++ b/mesonbuild/interpreter/mesonmain.py @@ -435,7 +435,6 @@ class MesonMain(MesonInterpreterObject): propname, fallback = args return self.__get_external_property_impl(propname, fallback, kwargs['native']) - @FeatureNew('meson.has_external_property', '0.58.0') @typed_pos_args('meson.has_external_property', str) @typed_kwargs('meson.has_external_property', NATIVE_KW) diff --git a/mesonbuild/interpreter/primitives/integer.py b/mesonbuild/interpreter/primitives/integer.py index 296a3ca24..9252c687f 100644 --- a/mesonbuild/interpreter/primitives/integer.py +++ b/mesonbuild/interpreter/primitives/integer.py @@ -29,7 +29,6 @@ class IntegerHolder(ObjectHolder[int]): 'to_string': self.to_string_method, }) - self.trivial_operators.update({ # Arithmetic MesonOperator.UMINUS: (None, lambda x: -self.held_object), diff --git a/mesonbuild/interpreter/primitives/string.py b/mesonbuild/interpreter/primitives/string.py index d9c441a9a..aad28af01 100644 --- a/mesonbuild/interpreter/primitives/string.py +++ b/mesonbuild/interpreter/primitives/string.py @@ -52,7 +52,6 @@ class StringHolder(ObjectHolder[str]): 'version_compare': self.version_compare_method, }) - self.trivial_operators.update({ # Arithmetic MesonOperator.PLUS: (str, lambda x: self.held_object + x), @@ -169,7 +168,6 @@ class StringHolder(ObjectHolder[str]): def version_compare_method(self, args: T.Tuple[str], kwargs: TYPE_kwargs) -> bool: return version_compare(self.held_object, args[0]) - @FeatureNew('/ with string arguments', '0.49.0') @typed_operator(MesonOperator.DIV, str) def op_div(self, other: str) -> str: diff --git a/mesonbuild/interpreter/type_checking.py b/mesonbuild/interpreter/type_checking.py index 0b40611a8..310f28115 100644 --- a/mesonbuild/interpreter/type_checking.py +++ b/mesonbuild/interpreter/type_checking.py @@ -157,7 +157,6 @@ def _env_validator(value: T.Union[EnvironmentVariables, T.List['TYPE_var'], T.Di return None - def split_equal_string(input: str) -> T.Tuple[str, str]: """Split a string in the form `x=y` diff --git a/mesonbuild/interpreterbase/baseobjects.py b/mesonbuild/interpreterbase/baseobjects.py index 62a2381b4..caeb47b88 100644 --- a/mesonbuild/interpreterbase/baseobjects.py +++ b/mesonbuild/interpreterbase/baseobjects.py @@ -100,7 +100,6 @@ class InterpreterObject: return self.operators[operator](other) raise InvalidCode(f'Object {self} of type {self.display_name()} does not support the `{operator.value}` operator.') - # Default comparison operator support def _throw_comp_exception(self, other: TYPE_var, opt_type: str) -> T.NoReturn: raise InvalidArguments(textwrap.dedent( diff --git a/mesonbuild/interpreterbase/decorators.py b/mesonbuild/interpreterbase/decorators.py index 88449ed02..4c8d82454 100644 --- a/mesonbuild/interpreterbase/decorators.py +++ b/mesonbuild/interpreterbase/decorators.py @@ -426,7 +426,6 @@ class KwargInfo(T.Generic[_T]): ) - def typed_kwargs(name: str, *types: KwargInfo) -> T.Callable[..., T.Any]: """Decorator for type checking keyword arguments. diff --git a/mesonbuild/mesonlib/universal.py b/mesonbuild/mesonlib/universal.py index f81c01a25..9cf1cf0ca 100644 --- a/mesonbuild/mesonlib/universal.py +++ b/mesonbuild/mesonlib/universal.py @@ -586,7 +586,6 @@ class PerMachineDefaultable(PerMachine[T.Optional[_T]]): return m.default_missing() - class PerThreeMachineDefaultable(PerMachineDefaultable, PerThreeMachine[T.Optional[_T]]): """Extends `PerThreeMachine` with the ability to default from `None`s. """ @@ -1299,7 +1298,6 @@ def replace_if_different(dst: str, dst_tmp: str) -> None: os.unlink(dst_tmp) - def listify(item: T.Any, flatten: bool = True) -> T.List[T.Any]: ''' Returns a list with all args embedded in a list if they are not a list. diff --git a/mesonbuild/scripts/depscan.py b/mesonbuild/scripts/depscan.py index c80a5bc27..7f28f1ddf 100644 --- a/mesonbuild/scripts/depscan.py +++ b/mesonbuild/scripts/depscan.py @@ -106,7 +106,6 @@ class DependencyScanner: else: self.needs[fname] = [parent_module_name_full] - def scan_cpp_file(self, fname: str) -> None: fpath = pathlib.Path(fname) for line in fpath.read_text(encoding='utf-8').split('\n'):