aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rwxr-xr-xghwt.py4
-rw-r--r--mesonbuild/ast/interpreter.py12
-rw-r--r--mesonbuild/ast/introspection.py2
-rw-r--r--mesonbuild/backend/backends.py14
-rw-r--r--mesonbuild/backend/ninjabackend.py10
-rw-r--r--mesonbuild/backend/vs2010backend.py2
-rw-r--r--mesonbuild/backend/xcodebackend.py32
-rw-r--r--mesonbuild/build.py12
-rw-r--r--mesonbuild/cmake/fileapi.py10
-rw-r--r--mesonbuild/cmake/interpreter.py10
-rw-r--r--mesonbuild/cmake/traceparser.py4
-rw-r--r--mesonbuild/compilers/cpp.py4
-rw-r--r--mesonbuild/compilers/d.py4
-rw-r--r--mesonbuild/compilers/mixins/clike.py2
-rw-r--r--mesonbuild/compilers/mixins/visualstudio.py4
-rw-r--r--mesonbuild/coredata.py4
-rw-r--r--mesonbuild/dependencies/boost.py2
-rw-r--r--mesonbuild/dependencies/detect.py2
-rw-r--r--mesonbuild/interpreter/interpreter.py4
-rw-r--r--mesonbuild/interpreterbase/decorators.py2
-rw-r--r--mesonbuild/interpreterbase/interpreterbase.py20
-rw-r--r--mesonbuild/linkers/linkers.py2
-rw-r--r--mesonbuild/mesonlib/universal.py2
-rw-r--r--mesonbuild/mesonmain.py2
-rw-r--r--mesonbuild/modules/__init__.py2
-rw-r--r--mesonbuild/modules/cmake.py6
-rw-r--r--mesonbuild/mparser.py10
-rw-r--r--mesonbuild/rewriter.py10
-rw-r--r--mesonbuild/scripts/depfixer.py2
-rw-r--r--mesonbuild/scripts/depscan.py4
-rw-r--r--mesonbuild/scripts/symbolextractor.py6
-rw-r--r--mesonbuild/wrap/wraptool.py2
-rwxr-xr-xpackaging/createpkg.py2
-rw-r--r--test cases/common/14 configure file/check_file.py2
-rwxr-xr-xtest cases/common/14 configure file/generator.py2
-rwxr-xr-xtest cases/common/49 custom target/my_compiler.py2
-rwxr-xr-xtest cases/common/71 ctarget dependency/gen2.py2
-rwxr-xr-xtest cases/common/86 private include/stlib/compiler.py2
-rw-r--r--test cases/frameworks/1 boost/test_python_module.py4
-rw-r--r--test cases/frameworks/7 gnome/resources/resources.py2
-rwxr-xr-xtest cases/unit/2 testsetups/envcheck.py2
-rw-r--r--test cases/unit/49 testsetup default/envcheck.py6
-rwxr-xr-xtest cases/unit/68 test env value/test.py2
-rwxr-xr-xtest cases/unit/91 devenv/test-devenv.py8
-rwxr-xr-xtools/build_website.py4
-rw-r--r--unittests/allplatformstests.py2
46 files changed, 125 insertions, 125 deletions
diff --git a/ghwt.py b/ghwt.py
index 6f9373b..fc6db5d 100755
--- a/ghwt.py
+++ b/ghwt.py
@@ -45,7 +45,7 @@ def unpack(sproj, branch):
shutil.rmtree(tmpdir, ignore_errors=True)
subprocess.check_call(['git', 'clone', '-b', branch, f'https://github.com/mesonbuild/{sproj}.git', tmpdir])
usfile = os.path.join(tmpdir, 'upstream.wrap')
- assert(os.path.isfile(usfile))
+ assert os.path.isfile(usfile)
config = configparser.ConfigParser(interpolation=None)
config.read(usfile)
outdir = os.path.join(spdir, sproj)
@@ -74,7 +74,7 @@ def unpack(sproj, branch):
shutil.unpack_archive(ofilename, outdir)
else:
shutil.unpack_archive(ofilename, spdir)
- assert(os.path.isdir(outdir))
+ assert os.path.isdir(outdir)
shutil.move(os.path.join(tmpdir, '.git'), outdir)
subprocess.check_call(['git', 'reset', '--hard'], cwd=outdir)
shutil.rmtree(tmpdir)
diff --git a/mesonbuild/ast/interpreter.py b/mesonbuild/ast/interpreter.py
index 0299014..8c2be37 100644
--- a/mesonbuild/ast/interpreter.py
+++ b/mesonbuild/ast/interpreter.py
@@ -182,7 +182,7 @@ class AstInterpreter(InterpreterBase):
return
with open(absname, encoding='utf-8') as f:
code = f.read()
- assert(isinstance(code, str))
+ assert isinstance(code, str)
try:
codeblock = mparser.Parser(code, absname).parse()
except mesonlib.MesonException as me:
@@ -199,7 +199,7 @@ class AstInterpreter(InterpreterBase):
return True
def evaluate_fstring(self, node: mparser.FormatStringNode) -> str:
- assert(isinstance(node, mparser.FormatStringNode))
+ assert isinstance(node, mparser.FormatStringNode)
return node.value
def evaluate_arithmeticstatement(self, cur: ArithmeticNode) -> int:
@@ -212,7 +212,7 @@ class AstInterpreter(InterpreterBase):
return 0
def evaluate_ternary(self, node: TernaryNode) -> None:
- assert(isinstance(node, TernaryNode))
+ assert isinstance(node, TernaryNode)
self.evaluate_statement(node.condition)
self.evaluate_statement(node.trueblock)
self.evaluate_statement(node.falseblock)
@@ -223,7 +223,7 @@ class AstInterpreter(InterpreterBase):
return node.value
return '__AST_UNKNOWN__'
arguments, kwargs = self.reduce_arguments(node.args, key_resolver=resolve_key)
- assert (not arguments)
+ assert not arguments
self.argument_depth += 1
for key, value in kwargs.items():
if isinstance(key, BaseNode):
@@ -232,7 +232,7 @@ class AstInterpreter(InterpreterBase):
return {}
def evaluate_plusassign(self, node: PlusAssignmentNode) -> None:
- assert(isinstance(node, PlusAssignmentNode))
+ assert isinstance(node, PlusAssignmentNode)
# Cheat by doing a reassignment
self.assignments[node.var_name] = node.value # Save a reference to the value node
if node.value.ast_id:
@@ -298,7 +298,7 @@ class AstInterpreter(InterpreterBase):
return 0
def assignment(self, node: AssignmentNode) -> None:
- assert(isinstance(node, AssignmentNode))
+ assert isinstance(node, AssignmentNode)
self.assignments[node.var_name] = node.value # Save a reference to the value node
if node.value.ast_id:
self.reverse_assignment[node.value.ast_id] = node
diff --git a/mesonbuild/ast/introspection.py b/mesonbuild/ast/introspection.py
index 42813db..9bd73d7 100644
--- a/mesonbuild/ast/introspection.py
+++ b/mesonbuild/ast/introspection.py
@@ -211,7 +211,7 @@ class IntrospectionInterpreter(AstInterpreter):
while inqueue:
curr = inqueue.pop(0)
arg_node = None
- assert(isinstance(curr, BaseNode))
+ assert isinstance(curr, BaseNode)
if isinstance(curr, FunctionNode):
arg_node = curr.args
elif isinstance(curr, ArrayNode):
diff --git a/mesonbuild/backend/backends.py b/mesonbuild/backend/backends.py
index d71cae3..b119377 100644
--- a/mesonbuild/backend/backends.py
+++ b/mesonbuild/backend/backends.py
@@ -179,7 +179,7 @@ class ExecutableSerialisation:
self.cmd_args = cmd_args
self.env = env
if exe_wrapper is not None:
- assert(isinstance(exe_wrapper, programs.ExternalProgram))
+ assert isinstance(exe_wrapper, programs.ExternalProgram)
self.exe_runner = exe_wrapper
self.workdir = workdir
self.extra_paths = extra_paths
@@ -205,7 +205,7 @@ class TestSerialisation:
self.fname = fname
self.is_cross_built = is_cross_built
if exe_wrapper is not None:
- assert(isinstance(exe_wrapper, programs.ExternalProgram))
+ assert isinstance(exe_wrapper, programs.ExternalProgram)
self.exe_runner = exe_wrapper
self.is_parallel = is_parallel
self.cmd_args = cmd_args
@@ -288,7 +288,7 @@ class Backend:
elif isinstance(t, build.CustomTargetIndex):
filename = t.get_outputs()[0]
else:
- assert(isinstance(t, build.BuildTarget))
+ assert isinstance(t, build.BuildTarget)
filename = t.get_filename()
return os.path.join(self.get_target_dir(t), filename)
@@ -985,7 +985,7 @@ class Backend:
def build_target_link_arguments(self, compiler: 'Compiler', deps: T.List[build.Target]) -> T.List[str]:
args: T.List[str] = []
for d in deps:
- if not (d.is_linkable_target()):
+ if not d.is_linkable_target():
raise RuntimeError(f'Tried to link with a non-library target "{d.get_basename()}".')
arg = self.get_target_filename_for_linking(d)
if not arg:
@@ -1127,7 +1127,7 @@ class Backend:
def construct_target_rel_path(self, a: build.Target, workdir: T.Optional[str]) -> str:
if workdir is None:
return self.get_target_filename(a)
- assert(os.path.isabs(workdir))
+ assert os.path.isabs(workdir)
abs_path = self.get_target_filename_abs(a)
return os.path.relpath(abs_path, workdir)
@@ -1653,12 +1653,12 @@ class Backend:
srcdir = self.environment.get_source_dir()
builddir = self.environment.get_build_dir()
for de in data:
- assert(isinstance(de, build.Data))
+ assert isinstance(de, build.Data)
subdir = de.install_dir
if not subdir:
subdir = os.path.join(self.environment.get_datadir(), self.interpreter.build.project_name)
for src_file, dst_name in zip(de.sources, de.rename):
- assert(isinstance(src_file, mesonlib.File))
+ assert isinstance(src_file, mesonlib.File)
dst_abs = os.path.join(subdir, dst_name)
tag = de.install_tag or self.guess_install_tag(dst_abs)
i = InstallDataBase(src_file.absolute_path(srcdir, builddir), dst_abs, de.install_mode, de.subproject, tag=tag)
diff --git a/mesonbuild/backend/ninjabackend.py b/mesonbuild/backend/ninjabackend.py
index dc5b5df..ca9ab9a 100644
--- a/mesonbuild/backend/ninjabackend.py
+++ b/mesonbuild/backend/ninjabackend.py
@@ -252,7 +252,7 @@ class NinjaRule:
outfile.write(' rspfile = $out.rsp\n')
outfile.write(' rspfile_content = {}\n'.format(' '.join([self._quoter(x, rspfile_quote_func) for x in self.args])))
else:
- outfile.write(' command = {}\n'.format(' '.join([self._quoter(x) for x in (self.command + self.args)])))
+ outfile.write(' command = {}\n'.format(' '.join([self._quoter(x) for x in self.command + self.args])))
if self.deps:
outfile.write(f' deps = {self.deps}\n')
if self.depfile:
@@ -302,7 +302,7 @@ class NinjaBuildElement:
self.outfilenames = [outfilenames]
else:
self.outfilenames = outfilenames
- assert(isinstance(rulename, str))
+ assert isinstance(rulename, str)
self.rulename = rulename
if isinstance(infilenames, str):
self.infilenames = [infilenames]
@@ -2619,8 +2619,8 @@ https://gcc.gnu.org/bugzilla/show_bug.cgi?id=47485'''))
self.add_dependency_scanner_entries_to_element(target, compiler, element, src)
self.add_build(element)
- assert(isinstance(rel_obj, str))
- assert(isinstance(rel_src, str))
+ assert isinstance(rel_obj, str)
+ assert isinstance(rel_src, str)
return (rel_obj, rel_src.replace('\\', '/'))
def add_dependency_scanner_entries_to_element(self, target, compiler, element, src):
@@ -2903,7 +2903,7 @@ https://gcc.gnu.org/bugzilla/show_bug.cgi?id=47485'''))
return guessed_dependencies + absolute_libs
def generate_prelink(self, target, obj_list):
- assert(isinstance(target, build.StaticLibrary))
+ assert isinstance(target, build.StaticLibrary)
prelink_name = os.path.join(self.get_target_private_dir(target), target.name + '-prelink.o')
elem = NinjaBuildElement(self.all_outputs, [prelink_name], 'CUSTOM_COMMAND', obj_list)
diff --git a/mesonbuild/backend/vs2010backend.py b/mesonbuild/backend/vs2010backend.py
index 0a6e7cd..0cf0b72 100644
--- a/mesonbuild/backend/vs2010backend.py
+++ b/mesonbuild/backend/vs2010backend.py
@@ -1228,7 +1228,7 @@ class Vs2010Backend(backends.Backend):
additional_links.append(self.relpath(lib, self.get_target_dir(target)))
additional_objects = []
for o in self.flatten_object_list(target, down):
- assert(isinstance(o, str))
+ assert isinstance(o, str)
additional_objects.append(o)
for o in custom_objs:
additional_objects.append(o)
diff --git a/mesonbuild/backend/xcodebackend.py b/mesonbuild/backend/xcodebackend.py
index b1a8956..1139f79 100644
--- a/mesonbuild/backend/xcodebackend.py
+++ b/mesonbuild/backend/xcodebackend.py
@@ -104,8 +104,8 @@ class PbxArrayItem:
class PbxComment:
def __init__(self, text):
- assert(isinstance(text, str))
- assert('/*' not in text)
+ assert isinstance(text, str)
+ assert '/*' not in text
self.text = f'/* {text} */'
def write(self, ofile, indent_level):
@@ -132,7 +132,7 @@ class PbxDict:
def add_item(self, key, value, comment=''):
item = PbxDictItem(key, value, comment)
- assert(key not in self.keys)
+ assert key not in self.keys
self.keys.add(key)
self.items.append(item)
@@ -143,7 +143,7 @@ class PbxDict:
if isinstance(comment, str):
self.items.append(PbxComment(str))
else:
- assert(isinstance(comment, PbxComment))
+ assert isinstance(comment, PbxComment)
self.items.append(comment)
def write(self, ofile, indent_level):
@@ -434,14 +434,14 @@ class XCodeBackend(backends.Backend):
def gen_single_target_map(self, genlist, tname, t, generator_id):
k = (tname, generator_id)
- assert(k not in self.shell_targets)
+ assert k not in self.shell_targets
self.shell_targets[k] = self.gen_id()
ofile_abs = []
for i in genlist.get_inputs():
for o_base in genlist.get_outputs_for(i):
o = os.path.join(self.get_target_private_dir(t), o_base)
ofile_abs.append(os.path.join(self.environment.get_build_dir(), o))
- assert(k not in self.generator_outputs)
+ assert k not in self.generator_outputs
self.generator_outputs[k] = ofile_abs
buildfile_ids = []
fileref_ids = []
@@ -472,11 +472,11 @@ class XCodeBackend(backends.Backend):
continue
else:
k = (tname, target.get_basename())
- assert(k not in self.target_dependency_map)
+ assert k not in self.target_dependency_map
self.target_dependency_map[k] = self.gen_id()
for tname, t in self.custom_targets.items():
k = tname
- assert(k not in self.target_dependency_map)
+ assert k not in self.target_dependency_map
self.target_dependency_map[k] = self.gen_id()
def generate_pbxdep_map(self):
@@ -504,9 +504,9 @@ class XCodeBackend(backends.Backend):
if not isinstance(s, str):
continue
k = (tname, s)
- assert(k not in self.buildfile_ids)
+ assert k not in self.buildfile_ids
self.buildfile_ids[k] = self.gen_id()
- assert(k not in self.fileref_ids)
+ assert k not in self.fileref_ids
self.fileref_ids[k] = self.gen_id()
if not hasattr(t, 'objects'):
continue
@@ -519,16 +519,16 @@ class XCodeBackend(backends.Backend):
if isinstance(o, str):
o = os.path.join(t.subdir, o)
k = (tname, o)
- assert(k not in self.buildfile_ids)
+ assert k not in self.buildfile_ids
self.buildfile_ids[k] = self.gen_id()
- assert(k not in self.fileref_ids)
+ assert k not in self.fileref_ids
self.fileref_ids[k] = self.gen_id()
else:
raise RuntimeError('Unknown input type ' + str(o))
def generate_build_file_maps(self):
for buildfile in self.interpreter.get_build_def_files():
- assert(isinstance(buildfile, str))
+ assert isinstance(buildfile, str)
self.buildfile_ids[buildfile] = self.gen_id()
self.fileref_ids[buildfile] = self.gen_id()
@@ -641,7 +641,7 @@ class XCodeBackend(backends.Backend):
idval = self.buildfile_ids[(tname, o)]
k = (tname, o)
fileref = self.fileref_ids[k]
- assert(o not in self.filemap)
+ assert o not in self.filemap
self.filemap[o] = idval
fullpath = os.path.join(self.environment.get_source_dir(), o)
fullpath2 = fullpath
@@ -677,7 +677,7 @@ class XCodeBackend(backends.Backend):
def create_generator_shellphase(self, objects_dict, tname, generator_id):
file_ids = self.generator_buildfile_ids[(tname, generator_id)]
ref_ids = self.generator_fileref_ids[(tname, generator_id)]
- assert(len(ref_ids) == len(file_ids))
+ assert len(ref_ids) == len(file_ids)
for i in range(len(file_ids)):
file_o = file_ids[i]
ref_id = ref_ids[i]
@@ -757,7 +757,7 @@ class XCodeBackend(backends.Backend):
continue
outputs = self.generator_outputs[(tname, generator_id)]
ref_ids = self.generator_fileref_ids[tname, generator_id]
- assert(len(ref_ids) == len(outputs))
+ assert len(ref_ids) == len(outputs)
for i in range(len(outputs)):
o = outputs[i]
ref_id = ref_ids[i]
diff --git a/mesonbuild/build.py b/mesonbuild/build.py
index bc4065b..c6a6994 100644
--- a/mesonbuild/build.py
+++ b/mesonbuild/build.py
@@ -695,7 +695,7 @@ class BuildTarget(Target):
mlog.warning('Unknown keyword argument(s) in target {}: {}.'.format(self.name, ', '.join(unknowns)))
def process_objectlist(self, objects):
- assert(isinstance(objects, list))
+ assert isinstance(objects, list)
for s in objects:
if isinstance(s, (str, File, ExtractedObjects)):
self.objects.append(s)
@@ -850,7 +850,7 @@ class BuildTarget(Target):
m += '\n'.join([repr(c) for c in check_sources])
raise InvalidArguments(m)
# CSharp and Java targets can't contain any other file types
- assert(len(self.compilers) == 1)
+ assert len(self.compilers) == 1
return
def process_link_depends(self, sources, environment):
@@ -1054,9 +1054,9 @@ class BuildTarget(Target):
raise InvalidArguments('Argument win_subsystem can only be used on executables.')
extra_files = extract_as_list(kwargs, 'extra_files')
for i in extra_files:
- assert(isinstance(i, File))
+ assert isinstance(i, File)
trial = os.path.join(environment.get_source_dir(), i.subdir, i.fname)
- if not(os.path.isfile(trial)):
+ if not os.path.isfile(trial):
raise InvalidArguments(f'Tried to add non-existing extra file {i}.')
self.extra_files = extra_files
self.install_rpath: str = kwargs.get('install_rpath', '')
@@ -1324,7 +1324,7 @@ You probably should put it in link_with instead.''')
else:
raise InvalidArguments(f'PCH argument {pchlist[0]} is of unknown type.')
- if (os.path.dirname(pchlist[0]) != os.path.dirname(pchlist[1])):
+ if os.path.dirname(pchlist[0]) != os.path.dirname(pchlist[1]):
raise InvalidArguments('PCH files must be stored in the same folder.')
mlog.warning('PCH source files are deprecated, only a single header file should be used.')
@@ -2296,7 +2296,7 @@ class CustomTarget(Target, CommandBase):
inputs = get_sources_string_names(self.sources, backend)
values = get_filenames_templates_dict(inputs, [])
for i in self.outputs:
- if not(isinstance(i, str)):
+ if not isinstance(i, str):
raise InvalidArguments('Output argument not a string.')
if i == '':
raise InvalidArguments('Output must not be empty.')
diff --git a/mesonbuild/cmake/fileapi.py b/mesonbuild/cmake/fileapi.py
index 5d4d01a..710e4ed 100644
--- a/mesonbuild/cmake/fileapi.py
+++ b/mesonbuild/cmake/fileapi.py
@@ -80,15 +80,15 @@ class CMakeFileAPI:
# parse the JSON
for i in index['objects']:
- assert(isinstance(i, dict))
- assert('kind' in i)
- assert(i['kind'] in self.kind_resolver_map)
+ assert isinstance(i, dict)
+ assert 'kind' in i
+ assert i['kind'] in self.kind_resolver_map
self.kind_resolver_map[i['kind']](i)
def _parse_codemodel(self, data: T.Dict[str, T.Any]) -> None:
- assert('configurations' in data)
- assert('paths' in data)
+ assert 'configurations' in data
+ assert 'paths' in data
source_dir = data['paths']['source']
build_dir = data['paths']['build']
diff --git a/mesonbuild/cmake/interpreter.py b/mesonbuild/cmake/interpreter.py
index fe66bec..aca8769 100644
--- a/mesonbuild/cmake/interpreter.py
+++ b/mesonbuild/cmake/interpreter.py
@@ -736,7 +736,7 @@ class ConverterCustomTarget:
# Check if the command is a build target
commands = [] # type: T.List[T.List[T.Union[str, ConverterTarget]]]
for curr_cmd in self._raw_target.command:
- assert(isinstance(curr_cmd, list))
+ assert isinstance(curr_cmd, list)
cmd = [] # type: T.List[T.Union[str, ConverterTarget]]
for j in curr_cmd:
@@ -1139,7 +1139,7 @@ class CMakeInterpreter:
tgt_name = tgt.name
elif isinstance(tgt, CustomTargetReference):
tgt_name = tgt.ctgt.name
- assert(tgt_name is not None and tgt_name in processed)
+ assert tgt_name is not None and tgt_name in processed
res_var = processed[tgt_name]['tgt']
return id_node(res_var) if res_var else None
@@ -1167,12 +1167,12 @@ class CMakeInterpreter:
custom_targets = [] # type: T.List[ConverterCustomTarget]
dependencies = [] # type: T.List[IdNode]
for i in tgt.link_with:
- assert(isinstance(i, ConverterTarget))
+ assert isinstance(i, ConverterTarget)
if i.name not in processed:
process_target(i)
link_with += [extract_tgt(i)]
for i in tgt.object_libs:
- assert(isinstance(i, ConverterTarget))
+ assert isinstance(i, ConverterTarget)
if i.name not in processed:
process_target(i)
objec_libs += [extract_tgt(i)]
@@ -1361,7 +1361,7 @@ class CMakeInterpreter:
# check if there exists a name mapping
if target in self.internal_name_map:
target = self.internal_name_map[target]
- assert(target in self.generated_targets)
+ assert target in self.generated_targets
return self.generated_targets[target]
return None
diff --git a/mesonbuild/cmake/traceparser.py b/mesonbuild/cmake/traceparser.py
index 4ddc915..66dd4ef 100644
--- a/mesonbuild/cmake/traceparser.py
+++ b/mesonbuild/cmake/traceparser.py
@@ -180,7 +180,7 @@ class CMakeTraceParser:
# "Execute" the CMake function if supported
fn = self.functions.get(l.func, None)
- if(fn):
+ if fn:
fn(l)
# Postprocess
@@ -638,7 +638,7 @@ class CMakeTraceParser:
def _meson_ps_execute_delayed_calls(self, tline: CMakeTraceLine) -> None:
for l in self.stored_commands:
fn = self.functions.get(l.func, None)
- if(fn):
+ if fn:
fn(l)
# clear the stored commands
diff --git a/mesonbuild/compilers/cpp.py b/mesonbuild/compilers/cpp.py
index 1e46f26..168ba7a 100644
--- a/mesonbuild/compilers/cpp.py
+++ b/mesonbuild/compilers/cpp.py
@@ -119,7 +119,7 @@ class CPPCompiler(CLikeCompiler, Compiler):
def _test_cpp_std_arg(self, cpp_std_value: str) -> bool:
# Test whether the compiler understands a -std=XY argument
- assert(cpp_std_value.startswith('-std='))
+ assert cpp_std_value.startswith('-std=')
# This test does not use has_multi_arguments() for two reasons:
# 1. has_multi_arguments() requires an env argument, which the compiler
@@ -155,7 +155,7 @@ class CPPCompiler(CLikeCompiler, Compiler):
}
# Currently, remapping is only supported for Clang, Elbrus and GCC
- assert(self.id in frozenset(['clang', 'lcc', 'gcc', 'emscripten']))
+ assert self.id in frozenset(['clang', 'lcc', 'gcc', 'emscripten'])
if cpp_std not in CPP_FALLBACKS:
# 'c++03' and 'c++98' don't have fallback types
diff --git a/mesonbuild/compilers/d.py b/mesonbuild/compilers/d.py
index eb1cf74..19706c5 100644
--- a/mesonbuild/compilers/d.py
+++ b/mesonbuild/compilers/d.py
@@ -443,7 +443,7 @@ class DmdLikeCompilerMixin(CompilerMixinBase):
if crt_val in self.mscrt_args:
return self.mscrt_args[crt_val]
- assert(crt_val in ['from_buildtype', 'static_from_buildtype'])
+ assert crt_val in ['from_buildtype', 'static_from_buildtype']
dbg = 'mdd'
rel = 'md'
@@ -463,7 +463,7 @@ class DmdLikeCompilerMixin(CompilerMixinBase):
elif buildtype == 'minsize':
return self.mscrt_args[rel]
else:
- assert(buildtype == 'custom')
+ assert buildtype == 'custom'
raise EnvironmentException('Requested C runtime based on buildtype, but buildtype is "custom".')
def get_soname_args(self, env: 'Environment', prefix: str, shlib_name: str,
diff --git a/mesonbuild/compilers/mixins/clike.py b/mesonbuild/compilers/mixins/clike.py
index ccf14a4..d978f69 100644
--- a/mesonbuild/compilers/mixins/clike.py
+++ b/mesonbuild/compilers/mixins/clike.py
@@ -456,7 +456,7 @@ class CLikeCompiler(Compiler):
# on MSVC compiler and linker flags must be separated by the "/link" argument
# at this point, the '/link' argument may already be part of extra_args, otherwise, it is added here
- if self.linker_to_compiler_args([]) == ['/link'] and largs != [] and not ('/link' in extra_args):
+ if self.linker_to_compiler_args([]) == ['/link'] and largs != [] and not '/link' in extra_args:
extra_args += ['/link']
args = cargs + extra_args + largs
diff --git a/mesonbuild/compilers/mixins/visualstudio.py b/mesonbuild/compilers/mixins/visualstudio.py
index e911f64..eb81764 100644
--- a/mesonbuild/compilers/mixins/visualstudio.py
+++ b/mesonbuild/compilers/mixins/visualstudio.py
@@ -342,7 +342,7 @@ class VisualStudioLikeCompiler(Compiler, metaclass=abc.ABCMeta):
def get_crt_compile_args(self, crt_val: str, buildtype: str) -> T.List[str]:
if crt_val in self.crt_args:
return self.crt_args[crt_val]
- assert(crt_val in ['from_buildtype', 'static_from_buildtype'])
+ assert crt_val in ['from_buildtype', 'static_from_buildtype']
dbg = 'mdd'
rel = 'md'
if crt_val == 'static_from_buildtype':
@@ -360,7 +360,7 @@ class VisualStudioLikeCompiler(Compiler, metaclass=abc.ABCMeta):
elif buildtype == 'minsize':
return self.crt_args[rel]
else:
- assert(buildtype == 'custom')
+ assert buildtype == 'custom'
raise mesonlib.EnvironmentException('Requested C runtime based on buildtype, but buildtype is "custom".')
def has_func_attribute(self, name: str, env: 'Environment') -> T.Tuple[bool, bool]:
diff --git a/mesonbuild/coredata.py b/mesonbuild/coredata.py
index 3436515..2679313 100644
--- a/mesonbuild/coredata.py
+++ b/mesonbuild/coredata.py
@@ -663,7 +663,7 @@ class CoreData:
opt = 's'
debug = True
else:
- assert(value == 'custom')
+ assert value == 'custom'
return []
actual_opt = self.options[OptionKey('optimization')].value
actual_debug = self.options[OptionKey('debug')].value
@@ -690,7 +690,7 @@ class CoreData:
opt = 's'
debug = True
else:
- assert(value == 'custom')
+ assert value == 'custom'
return
self.options[OptionKey('optimization')].set_value(opt)
self.options[OptionKey('debug')].set_value(debug)
diff --git a/mesonbuild/dependencies/boost.py b/mesonbuild/dependencies/boost.py
index 5935b61..038ea17 100644
--- a/mesonbuild/dependencies/boost.py
+++ b/mesonbuild/dependencies/boost.py
@@ -429,7 +429,7 @@ class BoostDependency(SystemDependency):
rootdir = props.get('boost_root')
# It shouldn't be possible to get here without something in boost_root
- assert(rootdir)
+ assert rootdir
raw_paths = mesonlib.stringlistify(rootdir)
paths = [Path(x) for x in raw_paths]
diff --git a/mesonbuild/dependencies/detect.py b/mesonbuild/dependencies/detect.py
index c6865d5..3dc2e3f 100644
--- a/mesonbuild/dependencies/detect.py
+++ b/mesonbuild/dependencies/detect.py
@@ -82,7 +82,7 @@ display_name_map = {
}
def find_external_dependency(name: str, env: 'Environment', kwargs: T.Dict[str, object]) -> T.Union['ExternalDependency', NotFoundDependency]:
- assert(name)
+ assert name
required = kwargs.get('required', True)
if not isinstance(required, bool):
raise DependencyException('Keyword "required" must be a boolean.')
diff --git a/mesonbuild/interpreter/interpreter.py b/mesonbuild/interpreter/interpreter.py
index c21b90e..1a34885 100644
--- a/mesonbuild/interpreter/interpreter.py
+++ b/mesonbuild/interpreter/interpreter.py
@@ -1667,7 +1667,7 @@ This will become a hard error in the future.''' % kwargs['input'], location=self
tg = build.RunTarget(name, cleaned_args, cleaned_deps, self.subdir, self.subproject, env)
self.add_target(name, tg)
full_name = (self.subproject, name)
- assert(full_name not in self.build.run_target_names)
+ assert full_name not in self.build.run_target_names
self.build.run_target_names.add(full_name)
return tg
@@ -1865,7 +1865,7 @@ This will become a hard error in the future.''' % kwargs['input'], location=self
raise InterpreterException(f"Non-existent build file '{buildfilename!s}'")
with open(absname, encoding='utf-8') as f:
code = f.read()
- assert(isinstance(code, str))
+ assert isinstance(code, str)
try:
codeblock = mparser.Parser(code, absname).parse()
except mesonlib.MesonException as me:
diff --git a/mesonbuild/interpreterbase/decorators.py b/mesonbuild/interpreterbase/decorators.py
index d8551aa..33892be 100644
--- a/mesonbuild/interpreterbase/decorators.py
+++ b/mesonbuild/interpreterbase/decorators.py
@@ -63,7 +63,7 @@ def stringArgs(f: TV_func) -> TV_func:
@wraps(f)
def wrapped(*wrapped_args: T.Any, **wrapped_kwargs: T.Any) -> T.Any:
args = get_callee_args(wrapped_args)[1]
- assert(isinstance(args, list))
+ assert isinstance(args, list)
check_stringlist(args)
return f(*wrapped_args, **wrapped_kwargs)
return T.cast(TV_func, wrapped)
diff --git a/mesonbuild/interpreterbase/interpreterbase.py b/mesonbuild/interpreterbase/interpreterbase.py
index 9ab6ee0..2fa77ee 100644
--- a/mesonbuild/interpreterbase/interpreterbase.py
+++ b/mesonbuild/interpreterbase/interpreterbase.py
@@ -99,7 +99,7 @@ class InterpreterBase:
code = mf.read()
if code.isspace():
raise InvalidCode('Builder file is empty.')
- assert(isinstance(code, str))
+ assert isinstance(code, str)
try:
self.ast = mparser.Parser(code, mesonfile).parse()
except mesonlib.MesonException as me:
@@ -254,7 +254,7 @@ class InterpreterBase:
return not v
def evaluate_if(self, node: mparser.IfClauseNode) -> T.Optional[Disabler]:
- assert(isinstance(node, mparser.IfClauseNode))
+ assert isinstance(node, mparser.IfClauseNode)
for i in node.ifs:
# Reset self.tmp_meson_version to know if it gets set during this
# statement evaluation.
@@ -262,7 +262,7 @@ class InterpreterBase:
result = self.evaluate_statement(i.condition)
if isinstance(result, Disabler):
return result
- if not(isinstance(result, bool)):
+ if not isinstance(result, bool):
raise InvalidCode(f'If clause {result!r} does not evaluate to true or false.')
if result:
prev_meson_version = mesonlib.project_meson_versions[self.subproject]
@@ -426,7 +426,7 @@ The result of this is undefined and will become a hard error in a future Meson r
raise InvalidCode('You broke me.')
def evaluate_ternary(self, node: mparser.TernaryNode) -> T.Union[TYPE_var, InterpreterObject]:
- assert(isinstance(node, mparser.TernaryNode))
+ assert isinstance(node, mparser.TernaryNode)
result = self.evaluate_statement(node.condition)
if isinstance(result, Disabler):
return result
@@ -439,7 +439,7 @@ The result of this is undefined and will become a hard error in a future Meson r
@FeatureNew('format strings', '0.58.0')
def evaluate_fstring(self, node: mparser.FormatStringNode) -> TYPE_var:
- assert(isinstance(node, mparser.FormatStringNode))
+ assert isinstance(node, mparser.FormatStringNode)
def replace(match: T.Match[str]) -> str:
var = str(match.group(1))
@@ -456,7 +456,7 @@ The result of this is undefined and will become a hard error in a future Meson r
return re.sub(r'@([_a-zA-Z][_0-9a-zA-Z]*)@', replace, node.value)
def evaluate_foreach(self, node: mparser.ForeachClauseNode) -> None:
- assert(isinstance(node, mparser.ForeachClauseNode))
+ assert isinstance(node, mparser.ForeachClauseNode)
items = self.evaluate_statement(node.items)
if isinstance(items, (list, RangeHolder)):
@@ -487,7 +487,7 @@ The result of this is undefined and will become a hard error in a future Meson r
raise InvalidArguments('Items of foreach loop must be an array or a dict')
def evaluate_plusassign(self, node: mparser.PlusAssignmentNode) -> None:
- assert(isinstance(node, mparser.PlusAssignmentNode))
+ assert isinstance(node, mparser.PlusAssignmentNode)
varname = node.var_name
addition = self.evaluate_statement(node.value)
@@ -518,7 +518,7 @@ The result of this is undefined and will become a hard error in a future Meson r
self.set_variable(varname, new_value)
def evaluate_indexing(self, node: mparser.IndexNode) -> T.Union[TYPE_elementary, InterpreterObject]:
- assert(isinstance(node, mparser.IndexNode))
+ assert isinstance(node, mparser.IndexNode)
iobject = self.evaluate_statement(node.iobject)
if isinstance(iobject, Disabler):
return iobject
@@ -885,7 +885,7 @@ The result of this is undefined and will become a hard error in a future Meson r
T.List[T.Union[TYPE_var, InterpreterObject]],
T.Dict[str, T.Union[TYPE_var, InterpreterObject]]
]:
- assert(isinstance(args, mparser.ArgumentNode))
+ assert isinstance(args, mparser.ArgumentNode)
if args.incorrect_order():
raise InvalidArguments('All keyword arguments must be after positional arguments.')
self.argument_depth += 1
@@ -917,7 +917,7 @@ The result of this is undefined and will become a hard error in a future Meson r
return kwargs
def assignment(self, node: mparser.AssignmentNode) -> None:
- assert(isinstance(node, mparser.AssignmentNode))
+ assert isinstance(node, mparser.AssignmentNode)
if self.argument_depth != 0:
raise InvalidArguments('''Tried to assign values inside an argument list.
To specify a keyword argument, use : instead of =.''')
diff --git a/mesonbuild/linkers/linkers.py b/mesonbuild/linkers/linkers.py
index db85007..e84d0a4 100644
--- a/mesonbuild/linkers/linkers.py
+++ b/mesonbuild/linkers/linkers.py
@@ -812,7 +812,7 @@ class LLVMDynamicLinker(GnuLikeDynamicLinkerMixin, PosixDynamicLinkerMixin, Dyna
# Some targets don't seem to support this argument (windows, wasm, ...)
_, _, e = mesonlib.Popen_safe(self.exelist + self._apply_prefix('--allow-shlib-undefined'))
- self.has_allow_shlib_undefined = not ('unknown argument: --allow-shlib-undefined' in e)
+ self.has_allow_shlib_undefined = 'unknown argument: --allow-shlib-undefined' not in e
def get_allow_undefined_args(self) -> T.List[str]:
if self.has_allow_shlib_undefined:
diff --git a/mesonbuild/mesonlib/universal.py b/mesonbuild/mesonlib/universal.py
index b807377..63e754b 100644
--- a/mesonbuild/mesonlib/universal.py
+++ b/mesonbuild/mesonlib/universal.py
@@ -1059,7 +1059,7 @@ if is_windows():
if c == '\\':
num_backslashes += 1
else:
- if c == '"' and not (num_backslashes % 2):
+ if c == '"' and not num_backslashes % 2:
# unescaped quote, eat it
arg += (num_backslashes // 2) * '\\'
num_quotes += 1
diff --git a/mesonbuild/mesonmain.py b/mesonbuild/mesonmain.py
index 8b7c9c1..5d84b37 100644
--- a/mesonbuild/mesonmain.py
+++ b/mesonbuild/mesonmain.py
@@ -319,7 +319,7 @@ def main():
setup_vsenv()
# Always resolve the command path so Ninja can find it for regen, tests, etc.
if 'meson.exe' in sys.executable:
- assert(os.path.isabs(sys.executable))
+ assert os.path.isabs(sys.executable)
launcher = sys.executable
else:
launcher = os.path.realpath(sys.argv[0])
diff --git a/mesonbuild/modules/__init__.py b/mesonbuild/modules/__init__.py
index 85bb99d..652110e 100644
--- a/mesonbuild/modules/__init__.py
+++ b/mesonbuild/modules/__init__.py
@@ -187,7 +187,7 @@ def is_module_library(fname):
class ModuleReturnValue:
def __init__(self, return_value: T.Optional['TYPE_var'], new_objects: T.List['TYPE_var']) -> None:
self.return_value = return_value
- assert(isinstance(new_objects, list))
+ assert isinstance(new_objects, list)
self.new_objects = new_objects
class GResourceTarget(build.CustomTarget):
diff --git a/mesonbuild/modules/cmake.py b/mesonbuild/modules/cmake.py
index cc259dc..d0b6065 100644
--- a/mesonbuild/modules/cmake.py
+++ b/mesonbuild/modules/cmake.py
@@ -71,8 +71,8 @@ endmacro()
class CMakeSubproject(ModuleObject):
def __init__(self, subp, pv):
- assert(isinstance(subp, SubprojectHolder))
- assert(hasattr(subp, 'cm_interpreter'))
+ assert isinstance(subp, SubprojectHolder)
+ assert hasattr(subp, 'cm_interpreter')
super().__init__()
self.subp = subp
self.methods.update({'get_variable': self.get_variable,
@@ -96,7 +96,7 @@ class CMakeSubproject(ModuleObject):
' message(\'CMaket targets:\\n - \' + \'\\n - \'.join(<cmake_subproject>.target_list()))')
# Make sure that all keys are present (if not this is a bug)
- assert(all([x in res for x in ['inc', 'src', 'dep', 'tgt', 'func']]))
+ assert all([x in res for x in ['inc', 'src', 'dep', 'tgt', 'func']])
return res
@noKwargs
diff --git a/mesonbuild/mparser.py b/mesonbuild/mparser.py
index 1617dd1..c470e29 100644
--- a/mesonbuild/mparser.py
+++ b/mesonbuild/mparser.py
@@ -406,28 +406,28 @@ class MethodNode(BaseNode):
super().__init__(lineno, colno, filename)
self.source_object = source_object # type: BaseNode
self.name = name # type: str
- assert(isinstance(self.name, str))
+ assert isinstance(self.name, str)
self.args = args # type: ArgumentNode
class FunctionNode(BaseNode):
def __init__(self, filename: str, lineno: int, colno: int, end_lineno: int, end_colno: int, func_name: str, args: ArgumentNode):
super().__init__(lineno, colno, filename, end_lineno=end_lineno, end_colno=end_colno)
self.func_name = func_name # type: str
- assert(isinstance(func_name, str))
+ assert isinstance(func_name, str)
self.args = args # type: ArgumentNode
class AssignmentNode(BaseNode):
def __init__(self, filename: str, lineno: int, colno: int, var_name: str, value: BaseNode):
super().__init__(lineno, colno, filename)
self.var_name = var_name # type: str
- assert(isinstance(var_name, str))
+ assert isinstance(var_name, str)
self.value = value # type: BaseNode
class PlusAssignmentNode(BaseNode):
def __init__(self, filename: str, lineno: int, colno: int, var_name: str, value: BaseNode):
super().__init__(lineno, colno, filename)
self.var_name = var_name # type: str
- assert(isinstance(var_name, str))
+ assert isinstance(var_name, str)
self.value = value # type: BaseNode
class ForeachClauseNode(BaseNode):
@@ -727,7 +727,7 @@ class Parser:
def method_call(self, source_object: BaseNode) -> MethodNode:
methodname = self.e9()
- if not(isinstance(methodname, IdNode)):
+ if not isinstance(methodname, IdNode):
raise ParseException('Method name must be plain id',
self.getline(), self.current.lineno, self.current.colno)
assert isinstance(methodname.value, str)
diff --git a/mesonbuild/rewriter.py b/mesonbuild/rewriter.py
index d95b539..67cd871 100644
--- a/mesonbuild/rewriter.py
+++ b/mesonbuild/rewriter.py
@@ -698,7 +698,7 @@ class Rewriter:
arg_node = root.args
elif isinstance(root, ArgumentNode):
arg_node = root
- assert(arg_node is not None)
+ assert arg_node is not None
mlog.log(' -- Removing source', mlog.green(i), 'from',
mlog.yellow(f'{string_node.filename}:{string_node.lineno}'))
arg_node.arguments.remove(string_node)
@@ -782,10 +782,10 @@ class Rewriter:
self.functions[cmd['type']](cmd)
def apply_changes(self):
- assert(all(hasattr(x, 'lineno') and hasattr(x, 'colno') and hasattr(x, 'filename') for x in self.modified_nodes))
- assert(all(hasattr(x, 'lineno') and hasattr(x, 'colno') and hasattr(x, 'filename') for x in self.to_remove_nodes))
- assert(all(isinstance(x, (ArrayNode, FunctionNode)) for x in self.modified_nodes))
- assert(all(isinstance(x, (ArrayNode, AssignmentNode, FunctionNode)) for x in self.to_remove_nodes))
+ assert all(hasattr(x, 'lineno') and hasattr(x, 'colno') and hasattr(x, 'filename') for x in self.modified_nodes)
+ assert all(hasattr(x, 'lineno') and hasattr(x, 'colno') and hasattr(x, 'filename') for x in self.to_remove_nodes)
+ assert all(isinstance(x, (ArrayNode, FunctionNode)) for x in self.modified_nodes)
+ assert all(isinstance(x, (ArrayNode, AssignmentNode, FunctionNode)) for x in self.to_remove_nodes)
# Sort based on line and column in reversed order
work_nodes = [{'node': x, 'action': 'modify'} for x in self.modified_nodes]
work_nodes += [{'node': x, 'action': 'rm'} for x in self.to_remove_nodes]
diff --git a/mesonbuild/scripts/depfixer.py b/mesonbuild/scripts/depfixer.py
index 52c7ba9..4e75536 100644
--- a/mesonbuild/scripts/depfixer.py
+++ b/mesonbuild/scripts/depfixer.py
@@ -315,7 +315,7 @@ class Elf(DataSizes):
basename = name.split(b'/')[-1]
padding = b'\0' * (len(name) - len(basename))
newname = basename + padding
- assert(len(newname) == len(name))
+ assert len(newname) == len(name)
self.bf.seek(offset)
self.bf.write(newname)
diff --git a/mesonbuild/scripts/depscan.py b/mesonbuild/scripts/depscan.py
index 68e7dc4..f2ec0bd 100644
--- a/mesonbuild/scripts/depscan.py
+++ b/mesonbuild/scripts/depscan.py
@@ -73,7 +73,7 @@ class DependencyScanner:
self.needs[fname] = [needed]
if export_match:
exported_module = export_match.group(1).lower()
- assert(exported_module not in modules_in_this_file)
+ assert exported_module not in modules_in_this_file
modules_in_this_file.add(exported_module)
if exported_module in self.provided_by:
raise RuntimeError(f'Multiple files provide module {exported_module}.')
@@ -128,7 +128,7 @@ class DependencyScanner:
def objname_for(self, src: str) -> str:
objname = self.target_data.source2object[src]
- assert(isinstance(objname, str))
+ assert isinstance(objname, str)
return objname
def module_name_for(self, src: str) -> str:
diff --git a/mesonbuild/scripts/symbolextractor.py b/mesonbuild/scripts/symbolextractor.py
index 17501e2..231cb45 100644
--- a/mesonbuild/scripts/symbolextractor.py
+++ b/mesonbuild/scripts/symbolextractor.py
@@ -104,7 +104,7 @@ def gnu_syms(libfilename: str, outfilename: str) -> None:
dummy_syms(outfilename)
return
result = [x for x in output.split('\n') if 'SONAME' in x]
- assert(len(result) <= 1)
+ assert len(result) <= 1
# Get a list of all symbols exported
output = call_tool('nm', ['--dynamic', '--extern-only', '--defined-only',
'--format=posix', libfilename])
@@ -161,7 +161,7 @@ def openbsd_syms(libfilename: str, outfilename: str) -> None:
dummy_syms(outfilename)
return
result = [x for x in output.split('\n') if 'SONAME' in x]
- assert(len(result) <= 1)
+ assert len(result) <= 1
# Get a list of all symbols exported
output = call_tool('nm', ['-D', '-P', '-g', libfilename])
if not output:
@@ -178,7 +178,7 @@ def freebsd_syms(libfilename: str, outfilename: str) -> None:
dummy_syms(outfilename)
return
result = [x for x in output.split('\n') if 'SONAME' in x]
- assert(len(result) <= 1)
+ assert len(result) <= 1
# Get a list of all symbols exported
output = call_tool('nm', ['--dynamic', '--extern-only', '--defined-only',
'--format=posix', libfilename])
diff --git a/mesonbuild/wrap/wraptool.py b/mesonbuild/wrap/wraptool.py
index 222996d..a6648a7 100644
--- a/mesonbuild/wrap/wraptool.py
+++ b/mesonbuild/wrap/wraptool.py
@@ -164,7 +164,7 @@ def info(options: 'argparse.Namespace') -> None:
def do_promotion(from_path: str, spdir_name: str) -> None:
if os.path.isfile(from_path):
- assert(from_path.endswith('.wrap'))
+ assert from_path.endswith('.wrap')
shutil.copy(from_path, spdir_name)
elif os.path.isdir(from_path):
sproj_name = os.path.basename(from_path)
diff --git a/packaging/createpkg.py b/packaging/createpkg.py
index 95a7094..793d4bf 100755
--- a/packaging/createpkg.py
+++ b/packaging/createpkg.py
@@ -57,7 +57,7 @@ class PkgGenerator:
os.makedirs(self.bindir)
ln_base = os.path.relpath(self.mesonstashdir, self.bindir)
ninja_bin = shutil.which('ninja')
- assert(ninja_bin)
+ assert ninja_bin
shutil.copy(ninja_bin, self.bindir)
subprocess.check_call(['strip', os.path.join(self.bindir, 'ninja')])
os.symlink(os.path.join(ln_base, 'meson'), os.path.join(self.bindir, 'meson'))
diff --git a/test cases/common/14 configure file/check_file.py b/test cases/common/14 configure file/check_file.py
index a966147..7d96b2a 100644
--- a/test cases/common/14 configure file/check_file.py
+++ b/test cases/common/14 configure file/check_file.py
@@ -14,7 +14,7 @@ def permit_osx_workaround(m1, m2):
return True
if len(sys.argv) == 2:
- assert(os.path.exists(sys.argv[1]))
+ assert os.path.exists(sys.argv[1])
elif len(sys.argv) == 3:
f1 = sys.argv[1]
f2 = sys.argv[2]
diff --git a/test cases/common/14 configure file/generator.py b/test cases/common/14 configure file/generator.py
index e3cc881..832a7b8 100755
--- a/test cases/common/14 configure file/generator.py
+++ b/test cases/common/14 configure file/generator.py
@@ -11,7 +11,7 @@ subdir = Path(os.environ['MESON_SUBDIR'])
inputf = Path(sys.argv[1])
outputf = Path(sys.argv[2])
-assert(inputf.exists())
+assert inputf.exists()
with outputf.open('w') as ofile:
ofile.write("#define ZERO_RESULT 0\n")
diff --git a/test cases/common/49 custom target/my_compiler.py b/test cases/common/49 custom target/my_compiler.py
index 9869111..a32cbdb 100755
--- a/test cases/common/49 custom target/my_compiler.py
+++ b/test cases/common/49 custom target/my_compiler.py
@@ -3,7 +3,7 @@
import os
import sys
-assert(os.path.exists(sys.argv[3]))
+assert os.path.exists(sys.argv[3])
args = sys.argv[:-1]
diff --git a/test cases/common/71 ctarget dependency/gen2.py b/test cases/common/71 ctarget dependency/gen2.py
index dc6525b..6fde556 100755
--- a/test cases/common/71 ctarget dependency/gen2.py
+++ b/test cases/common/71 ctarget dependency/gen2.py
@@ -4,7 +4,7 @@ import sys, os
from glob import glob
files = glob(os.path.join(sys.argv[1], '*.tmp'))
-assert(len(files) == 1)
+assert len(files) == 1
with open(files[0]) as ifile, open(sys.argv[2], 'w') as ofile:
ofile.write(ifile.read())
diff --git a/test cases/common/86 private include/stlib/compiler.py b/test cases/common/86 private include/stlib/compiler.py
index c8597dd..7a2effa 100755
--- a/test cases/common/86 private include/stlib/compiler.py
+++ b/test cases/common/86 private include/stlib/compiler.py
@@ -2,7 +2,7 @@
import sys, os
-assert(len(sys.argv) == 3)
+assert len(sys.argv) == 3
h_templ = '''#pragma once
unsigned int %s(void);
diff --git a/test cases/frameworks/1 boost/test_python_module.py b/test cases/frameworks/1 boost/test_python_module.py
index acf6e42..8ef96d2 100644
--- a/test cases/frameworks/1 boost/test_python_module.py
+++ b/test cases/frameworks/1 boost/test_python_module.py
@@ -19,9 +19,9 @@ def run():
w.set(msg)
- assert(msg == w.greet())
+ assert msg == w.greet()
version_string = str(sys.version_info[0]) + "." + str(sys.version_info[1])
- assert(version_string == w.version())
+ assert version_string == w.version()
if __name__ == '__main__':
run()
diff --git a/test cases/frameworks/7 gnome/resources/resources.py b/test cases/frameworks/7 gnome/resources/resources.py
index b351b04..0855ef7 100644
--- a/test cases/frameworks/7 gnome/resources/resources.py
+++ b/test cases/frameworks/7 gnome/resources/resources.py
@@ -7,4 +7,4 @@ if __name__ == '__main__':
Gio.Resource._register(res)
data = Gio.resources_lookup_data('/com/example/myprog/res1.txt', Gio.ResourceLookupFlags.NONE)
- assert(data.get_data() == b'This is a resource.\n')
+ assert data.get_data() == b'This is a resource.\n'
diff --git a/test cases/unit/2 testsetups/envcheck.py b/test cases/unit/2 testsetups/envcheck.py
index af39c4e..e41a715 100755
--- a/test cases/unit/2 testsetups/envcheck.py
+++ b/test cases/unit/2 testsetups/envcheck.py
@@ -2,4 +2,4 @@
import os
-assert('PATH' in os.environ)
+assert 'PATH' in os.environ
diff --git a/test cases/unit/49 testsetup default/envcheck.py b/test cases/unit/49 testsetup default/envcheck.py
index 6ba3093..34ad76d 100644
--- a/test cases/unit/49 testsetup default/envcheck.py
+++ b/test cases/unit/49 testsetup default/envcheck.py
@@ -2,9 +2,9 @@
import os
-assert('ENV_A' in os.environ)
-assert('ENV_B' in os.environ)
-assert('ENV_C' in os.environ)
+assert 'ENV_A' in os.environ
+assert 'ENV_B' in os.environ
+assert 'ENV_C' in os.environ
print('ENV_A is', os.environ['ENV_A'])
print('ENV_B is', os.environ['ENV_B'])
diff --git a/test cases/unit/68 test env value/test.py b/test cases/unit/68 test env value/test.py
index 0cc7645..4adf62c 100755
--- a/test cases/unit/68 test env value/test.py
+++ b/test cases/unit/68 test env value/test.py
@@ -3,4 +3,4 @@
import os
import sys
-assert(os.environ['TEST_VAR'] == sys.argv[1])
+assert os.environ['TEST_VAR'] == sys.argv[1]
diff --git a/test cases/unit/91 devenv/test-devenv.py b/test cases/unit/91 devenv/test-devenv.py
index 4e5be97..9f84f97 100755
--- a/test cases/unit/91 devenv/test-devenv.py
+++ b/test cases/unit/91 devenv/test-devenv.py
@@ -2,7 +2,7 @@
import os
-assert(os.environ['MESON_DEVENV'] == '1')
-assert(os.environ['MESON_PROJECT_NAME'] == 'devenv')
-assert(os.environ['TEST_A'] == '1')
-assert(os.environ['TEST_B'] == '1+2+3')
+assert os.environ['MESON_DEVENV'] == '1'
+assert os.environ['MESON_PROJECT_NAME'] == 'devenv'
+assert os.environ['TEST_A'] == '1'
+assert os.environ['TEST_B'] == '1+2+3'
diff --git a/tools/build_website.py b/tools/build_website.py
index baf81db..50dfc48 100755
--- a/tools/build_website.py
+++ b/tools/build_website.py
@@ -2,7 +2,7 @@
import os, sys, subprocess, shutil
-assert(os.getcwd() == '/home/jpakkane')
+assert os.getcwd() == '/home/jpakkane'
from glob import glob
@@ -37,7 +37,7 @@ def update() -> None:
if base == 'CNAME' or base == 'favicon.png':
continue
subprocess.check_call(['git', 'rm', '-rf', base], cwd=webdir)
- assert(os.path.isdir(webdir))
+ assert os.path.isdir(webdir)
new_entries = glob(os.path.join(htmldir, '*'))
for e in new_entries:
shutil.move(e, webdir)
diff --git a/unittests/allplatformstests.py b/unittests/allplatformstests.py
index ee199f1..828ca58 100644
--- a/unittests/allplatformstests.py
+++ b/unittests/allplatformstests.py
@@ -2621,7 +2621,7 @@ class AllPlatformTests(BasePlatformTests):
for i in targets:
for out in i['filename']:
- assert(os.path.relpath(out, self.builddir).startswith('meson-out'))
+ assert os.path.relpath(out, self.builddir).startswith('meson-out')
def test_introspect_json_dump(self):
testdir = os.path.join(self.unit_test_dir, '57 introspection')