diff options
-rwxr-xr-x | meson.py | 4 | ||||
-rw-r--r-- | mesonbuild/backend/vs2010backend.py | 2 | ||||
-rw-r--r-- | mesonbuild/backend/xcodebackend.py | 2 | ||||
-rw-r--r-- | mesonbuild/compilers/cpp.py | 2 | ||||
-rw-r--r-- | mesonbuild/dependencies/ui.py | 1 | ||||
-rw-r--r-- | mesonbuild/interpreter.py | 2 | ||||
-rw-r--r-- | mesonbuild/interpreterbase.py | 2 | ||||
-rw-r--r-- | mesonbuild/minit.py | 27 | ||||
-rw-r--r-- | mesonbuild/modules/python3.py | 1 | ||||
-rw-r--r-- | mesonbuild/modules/unstable_icestorm.py | 13 | ||||
-rwxr-xr-x | msi/createmsi.py | 5 | ||||
-rwxr-xr-x | run_unittests.py | 10 | ||||
-rw-r--r-- | test cases/common/98 gen extra/srcgen3.py | 1 |
13 files changed, 31 insertions, 41 deletions
@@ -14,8 +14,8 @@ # See the License for the specific language governing permissions and # limitations under the License. -from mesonbuild import mesonmain, mesonlib -import sys, os, locale +from mesonbuild import mesonmain +import sys, os def main(): # Always resolve the command path so Ninja can find it for regen, tests, etc. diff --git a/mesonbuild/backend/vs2010backend.py b/mesonbuild/backend/vs2010backend.py index 057e7c9..7f4c2ef 100644 --- a/mesonbuild/backend/vs2010backend.py +++ b/mesonbuild/backend/vs2010backend.py @@ -12,7 +12,7 @@ # See the License for the specific language governing permissions and # limitations under the License. -import os, sys +import os import pickle import xml.dom.minidom import xml.etree.ElementTree as ET diff --git a/mesonbuild/backend/xcodebackend.py b/mesonbuild/backend/xcodebackend.py index 3ae31e4..fae5889 100644 --- a/mesonbuild/backend/xcodebackend.py +++ b/mesonbuild/backend/xcodebackend.py @@ -16,7 +16,7 @@ from . import backends from .. import build from .. import dependencies from .. import mesonlib -import uuid, os, sys +import uuid, os from ..mesonlib import MesonException diff --git a/mesonbuild/compilers/cpp.py b/mesonbuild/compilers/cpp.py index c10f38e..1fa6f15 100644 --- a/mesonbuild/compilers/cpp.py +++ b/mesonbuild/compilers/cpp.py @@ -112,7 +112,7 @@ class GnuCPPCompiler(GnuCompiler, CPPCompiler): if self.gcc_type == GCC_MINGW: opts.update({ 'cpp_winlibs': coredata.UserArrayOption('cpp_winlibs', 'Standard Win libraries to link against', - gnu_winlibs), }) + gnu_winlibs), }) return opts def get_option_compile_args(self, options): diff --git a/mesonbuild/dependencies/ui.py b/mesonbuild/dependencies/ui.py index 3e2d170..a84decf 100644 --- a/mesonbuild/dependencies/ui.py +++ b/mesonbuild/dependencies/ui.py @@ -17,7 +17,6 @@ import os import re -import shutil import subprocess from collections import OrderedDict diff --git a/mesonbuild/interpreter.py b/mesonbuild/interpreter.py index e3680ac..7a76fad 100644 --- a/mesonbuild/interpreter.py +++ b/mesonbuild/interpreter.py @@ -2339,7 +2339,7 @@ root and issuing %s. cmds = [] command_templ = 'meson wrap promote ' for l in found: - cmds.append(command_templ + l[len(self.source_root)+1:]) + cmds.append(command_templ + l[len(self.source_root) + 1:]) final_message = message + '\n'.join(cmds) print(final_message) diff --git a/mesonbuild/interpreterbase.py b/mesonbuild/interpreterbase.py index 0539b14..170df29 100644 --- a/mesonbuild/interpreterbase.py +++ b/mesonbuild/interpreterbase.py @@ -408,7 +408,7 @@ The result of this is undefined and will become a hard error in a future Meson r varname = node.var_name addition = self.evaluate_statement(node.value) if is_disabler(addition): - set_variable(varname, addition) + self.set_variable(varname, addition) return # Remember that all variables are immutable. We must always create a # full new variable and then assign it. diff --git a/mesonbuild/minit.py b/mesonbuild/minit.py index 98817cb..4459a05 100644 --- a/mesonbuild/minit.py +++ b/mesonbuild/minit.py @@ -1,5 +1,4 @@ # Copyright 2017 The Meson development team -from pyclbr import Function # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -15,7 +14,7 @@ from pyclbr import Function """Code that creates simple startup projects.""" -import os, sys, argparse, re +import sys, argparse, re from glob import glob lib_h_template = '''#pragma once @@ -107,7 +106,7 @@ pkg_mod.generate( ) ''' -hello_c_template = '''#include <stdio.h> +hello_c_template = '''#include <stdio.h> #define PROJECT_NAME "{project_name}" @@ -128,11 +127,11 @@ hello_c_meson_template = '''project('{project_name}', 'c', exe = executable('{exe_name}', '{source_name}', install : true) - + test('basic', exe) ''' -hello_cpp_template = '''#include <iostream> +hello_cpp_template = '''#include <iostream> #define PROJECT_NAME "{project_name}" @@ -152,7 +151,7 @@ hello_cpp_meson_template = '''project('{project_name}', 'cpp', exe = executable('{exe_name}', '{source_name}', install : true) - + test('basic', exe) ''' @@ -178,9 +177,9 @@ class {utoken}_PUBLIC {class_name} {{ public: {class_name}(); int get_number() const; - + private: - + int number; }}; @@ -270,7 +269,6 @@ ninja -C builddir def create_exe_c_sample(project_name, project_version): lowercase_token = re.sub(r'[^a-z0-9]', '_', project_name.lower()) - uppercase_token = lowercase_token.upper() source_name = lowercase_token + '.c' open(source_name, 'w').write(hello_c_template.format(project_name=project_name)) open('meson.build', 'w').write(hello_c_meson_template.format(project_name=project_name, @@ -291,7 +289,7 @@ def create_lib_c_sample(project_name, version): 'function_name': function_name, 'header_file': lib_h_name, 'source_file': lib_c_name, - 'test_source_file': test_c_name, + 'test_source_file': test_c_name, 'test_exe_name': lowercase_token, 'project_name': project_name, 'lib_name': lowercase_token, @@ -305,13 +303,12 @@ def create_lib_c_sample(project_name, version): def create_exe_cpp_sample(project_name, project_version): lowercase_token = re.sub(r'[^a-z0-9]', '_', project_name.lower()) - uppercase_token = lowercase_token.upper() source_name = lowercase_token + '.cpp' open(source_name, 'w').write(hello_cpp_template.format(project_name=project_name)) open('meson.build', 'w').write(hello_cpp_meson_template.format(project_name=project_name, - exe_name=lowercase_token, - source_name=source_name, - version=project_version)) + exe_name=lowercase_token, + source_name=source_name, + version=project_version)) def create_lib_cpp_sample(project_name, version): lowercase_token = re.sub(r'[^a-z0-9]', '_', project_name.lower()) @@ -328,7 +325,7 @@ def create_lib_cpp_sample(project_name, version): 'namespace': namespace, 'header_file': lib_h_name, 'source_file': lib_c_name, - 'test_source_file': test_c_name, + 'test_source_file': test_c_name, 'test_exe_name': lowercase_token, 'project_name': project_name, 'lib_name': lowercase_token, diff --git a/mesonbuild/modules/python3.py b/mesonbuild/modules/python3.py index 989e839..9fd9f80 100644 --- a/mesonbuild/modules/python3.py +++ b/mesonbuild/modules/python3.py @@ -12,7 +12,6 @@ # See the License for the specific language governing permissions and # limitations under the License. -import sys import sysconfig from .. import mesonlib, dependencies diff --git a/mesonbuild/modules/unstable_icestorm.py b/mesonbuild/modules/unstable_icestorm.py index 0b7b339..1f548b6 100644 --- a/mesonbuild/modules/unstable_icestorm.py +++ b/mesonbuild/modules/unstable_icestorm.py @@ -12,7 +12,7 @@ # See the License for the specific language governing permissions and # limitations under the License. -from .. import mesonlib, compilers, mlog +from .. import mesonlib from . import ExtensionModule @@ -33,7 +33,6 @@ class IceStormModule(ExtensionModule): def project(self, interpreter, state, args, kwargs): if not self.yosys_bin: self.detect_binaries(interpreter) - result = [] if not len(args): raise mesonlib.MesonException('Project requires at least one argument, which is the project name.') proj_name = args[0] @@ -46,7 +45,7 @@ class IceStormModule(ExtensionModule): all_sources = interpreter.source_strings_to_files(interpreter.flatten(arg_sources + kwarg_sources)) if 'constraint_file' not in kwargs: raise mesonlib.MesonException('Constraint file not specified.') - + constraint_file = interpreter.source_strings_to_files(kwargs['constraint_file']) if len(constraint_file) != 1: raise mesonlib.MesonException('Constraint file must contain one and only one entry.') @@ -73,13 +72,13 @@ class IceStormModule(ExtensionModule): 'input': asc_target, 'output': bin_fname, 'command': [self.icepack_bin, '@INPUT@', '@OUTPUT@'], - 'build_by_default' : True}) + 'build_by_default': True}) - up_target = interpreter.func_run_target(None, [upload_name], { + interpreter.func_run_target(None, [upload_name], { 'command': [self.iceprog_bin, bin_target]}) - time_target = interpreter.func_run_target(None, [time_name], { - 'command' : [self.icetime_bin, bin_target]}) + interpreter.func_run_target(None, [time_name], { + 'command': [self.icetime_bin, bin_target]}) def initialize(): return IceStormModule() diff --git a/msi/createmsi.py b/msi/createmsi.py index ec0340d..499f4b0 100755 --- a/msi/createmsi.py +++ b/msi/createmsi.py @@ -153,7 +153,7 @@ class PackageGenerator: 'SourceFile': self.redist_path, 'DiskId': '1', 'Language': '0', - }) + }) ET.SubElement(product, 'Property', { 'Id': 'WIXUI_INSTALLDIR', @@ -185,7 +185,7 @@ class PackageGenerator: 'AllowAdvertise': 'no', 'Display': 'hidden', 'Level': '1', - }) + }) ET.SubElement(vcredist_feature, 'MergeRef', {'Id': 'VCRedist'}) ET.ElementTree(self.root).write(self.main_xml, encoding='utf-8', xml_declaration=True) # ElementTree can not do prettyprinting so do it manually @@ -223,7 +223,6 @@ class PackageGenerator: }) self.component_num += 1 for f in cur_node.files: - file_source = os.path.join(current_dir, f).replace('\\', '\\\\') file_id = os.path.join(current_dir, f).replace('\\', '_').replace('#', '_').replace('-', '_') ET.SubElement(comp_xml_node, 'File', { 'Id': file_id, diff --git a/run_unittests.py b/run_unittests.py index 6312353..c2299ca 100755 --- a/run_unittests.py +++ b/run_unittests.py @@ -21,7 +21,6 @@ import tempfile import textwrap import os import shutil -import sys import unittest from unittest import mock from configparser import ConfigParser @@ -1360,9 +1359,9 @@ class AllPlatformTests(BasePlatformTests): subprocess.check_call(['git', 'config', 'user.email', 'teh_coderz@example.com'], cwd=project_dir) subprocess.check_call(['git', 'add', 'meson.build', 'distexe.c'], cwd=project_dir, - stdout=subprocess.DEVNULL) + stdout=subprocess.DEVNULL) subprocess.check_call(['git', 'commit', '-a', '-m', 'I am a project'], cwd=project_dir, - stdout=subprocess.DEVNULL) + stdout=subprocess.DEVNULL) try: self.dist_impl(git_init) @@ -1503,7 +1502,6 @@ int main(int argc, char **argv) { cmd += ['-c', source, '-o', objectfile] + extra_args subprocess.check_call(cmd, stdout=subprocess.DEVNULL, stderr=subprocess.DEVNULL) - def test_prebuilt_object(self): (compiler, _, object_suffix, _) = self.detect_prebuild_env() tdir = os.path.join(self.unit_test_dir, '14 prebuilt object') @@ -1995,8 +1993,8 @@ class FailureTests(BasePlatformTests): env = Environment('', self.builddir, self.meson_command, get_fake_options(self.prefix), []) try: - objc = env.detect_objc_compiler(False) - objcpp = env.detect_objcpp_compiler(False) + env.detect_objc_compiler(False) + env.detect_objcpp_compiler(False) except EnvironmentException: code = "add_languages('objc')\nadd_languages('objcpp')" self.assertMesonRaises(code, "Unknown compiler") diff --git a/test cases/common/98 gen extra/srcgen3.py b/test cases/common/98 gen extra/srcgen3.py index ad0a5cb..b737114 100644 --- a/test cases/common/98 gen extra/srcgen3.py +++ b/test cases/common/98 gen extra/srcgen3.py @@ -1,6 +1,5 @@ #!/usr/bin/env python3 -import os import sys import argparse |