From dc488653a4612b2d8f2fcc75ea1269e1a9d2235f Mon Sep 17 00:00:00 2001 From: William Deegan Date: Wed, 18 Dec 2019 15:34:20 -0500 Subject: Add new paths for mingw and msys64 for appveyor VS2019 image. Hopefully doens't break other images --- .appveyor.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.appveyor.yml b/.appveyor.yml index 09cd996..b1b718d 100644 --- a/.appveyor.yml +++ b/.appveyor.yml @@ -19,7 +19,7 @@ install: - cmd: "C:\\%WINPYTHON%\\python.exe --version" - cmd: for /F "tokens=*" %%g in ('C:\\%WINPYTHON%\\python.exe -m site --user-site') do (set PYSITEDIR=%%g) # use mingw 32 bit until #3291 is resolved - - cmd: "set PATH=C:\\%WINPYTHON%;C:\\%WINPYTHON%\\Scripts;C:\\ProgramData\\chocolatey\\bin;C:\\MinGW\\bin;C:\\MinGW\\msys\\1.0\\bin;C:\\cygwin\\bin;%PATH%" + - cmd: "set PATH=C:\\%WINPYTHON%;C:\\%WINPYTHON%\\Scripts;C:\\ProgramData\\chocolatey\\bin;C:\\MinGW\\bin;C:\\MinGW\\msys\\1.0\\bin;C:\\cygwin\\bin;C:\msys64\usr\bin;C:\msys64\mingw64\bin;%PATH%" - cmd: "C:\\%WINPYTHON%\\python.exe -m pip install -U --progress-bar off pip setuptools wheel " - cmd: "C:\\%WINPYTHON%\\python.exe -m pip install -U --progress-bar off pypiwin32 coverage codecov" - cmd: set STATIC_DEPS=true & C:\\%WINPYTHON%\\python.exe -m pip install -U --progress-bar off lxml -- cgit v0.12 From 4d53fb2838087c2284cf5756a3be69adc2c67245 Mon Sep 17 00:00:00 2001 From: William Deegan Date: Wed, 18 Dec 2019 15:55:00 -0500 Subject: [travis skip] Fix YAML escaping --- .appveyor.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.appveyor.yml b/.appveyor.yml index b1b718d..9a94529 100644 --- a/.appveyor.yml +++ b/.appveyor.yml @@ -19,7 +19,7 @@ install: - cmd: "C:\\%WINPYTHON%\\python.exe --version" - cmd: for /F "tokens=*" %%g in ('C:\\%WINPYTHON%\\python.exe -m site --user-site') do (set PYSITEDIR=%%g) # use mingw 32 bit until #3291 is resolved - - cmd: "set PATH=C:\\%WINPYTHON%;C:\\%WINPYTHON%\\Scripts;C:\\ProgramData\\chocolatey\\bin;C:\\MinGW\\bin;C:\\MinGW\\msys\\1.0\\bin;C:\\cygwin\\bin;C:\msys64\usr\bin;C:\msys64\mingw64\bin;%PATH%" + - cmd: "set PATH=C:\\%WINPYTHON%;C:\\%WINPYTHON%\\Scripts;C:\\ProgramData\\chocolatey\\bin;C:\\MinGW\\bin;C:\\MinGW\\msys\\1.0\\bin;C:\\cygwin\\bin;C:\\msys64\\usr\\bin;C:\\msys64\\mingw64\\bin;%PATH%" - cmd: "C:\\%WINPYTHON%\\python.exe -m pip install -U --progress-bar off pip setuptools wheel " - cmd: "C:\\%WINPYTHON%\\python.exe -m pip install -U --progress-bar off pypiwin32 coverage codecov" - cmd: set STATIC_DEPS=true & C:\\%WINPYTHON%\\python.exe -m pip install -U --progress-bar off lxml -- cgit v0.12 From c13b879fa7014a7a3e195bdc845fbf5527cca6aa Mon Sep 17 00:00:00 2001 From: Mats Wichmann Date: Fri, 20 Dec 2019 12:04:35 -0700 Subject: Remove deprecated SourceCode func/method Signed-off-by: Mats Wichmann --- doc/user/builders-writing.xml | 31 ----- doc/user/main.xml | 7 -- doc/user/sourcecode.xml | 185 ----------------------------- src/CHANGES.txt | 3 + src/engine/SCons/Environment.py | 31 ----- src/engine/SCons/Environment.xml | 131 -------------------- src/engine/SCons/EnvironmentTests.py | 19 --- src/engine/SCons/Script/__init__.py | 1 - test/Deprecated/SourceCode/SourceCode.py | 123 ------------------- test/Removed/SourceCode/Old/SourceCode.py | 123 +++++++++++++++++++ test/Removed/SourceCode/Old/sconstest.skip | 0 test/Removed/SourceCode/README.md | 6 + test/Removed/SourceCode/SConstruct.global | 2 + test/Removed/SourceCode/SConstruct.method | 3 + test/Removed/SourceCode/SourceCode.py | 73 ++++++++++++ 15 files changed, 210 insertions(+), 528 deletions(-) delete mode 100644 doc/user/sourcecode.xml delete mode 100644 test/Deprecated/SourceCode/SourceCode.py create mode 100644 test/Removed/SourceCode/Old/SourceCode.py create mode 100644 test/Removed/SourceCode/Old/sconstest.skip create mode 100644 test/Removed/SourceCode/README.md create mode 100644 test/Removed/SourceCode/SConstruct.global create mode 100644 test/Removed/SourceCode/SConstruct.method create mode 100644 test/Removed/SourceCode/SourceCode.py diff --git a/doc/user/builders-writing.xml b/doc/user/builders-writing.xml index a906df8..76fa794 100644 --- a/doc/user/builders-writing.xml +++ b/doc/user/builders-writing.xml @@ -1079,35 +1079,4 @@ from SCons.Script import * - - - diff --git a/doc/user/main.xml b/doc/user/main.xml index 42724d1..85dcf00 100644 --- a/doc/user/main.xml +++ b/doc/user/main.xml @@ -147,13 +147,6 @@ - - - diff --git a/doc/user/sourcecode.xml b/doc/user/sourcecode.xml deleted file mode 100644 index 5905cc5..0000000 --- a/doc/user/sourcecode.xml +++ /dev/null @@ -1,185 +0,0 @@ - - - %scons; - - - %builders-mod; - - %functions-mod; - - %tools-mod; - - %variables-mod; -]> - - -Fetching Files From Source Code Management Systems - - - - - - - - XXX - - - -
- Fetching Source Code From BitKeeper - - - - XXX - - - - - -env = Environment() -env.SourceCode('.', env.BitKeeper()) -env.Program('hello.c') - - -s.hello.c - - - - - scons -Q - - -
- -
- Fetching Source Code From CVS - - - - XXX - - - - - -env = Environment() -env.SourceCode('.', env.CVS('/usr/local/CVS')) -env.Program('hello.c') - - - - - scons -Q - - -
- -
- Fetching Source Code From RCS - - - - XXX - - - - - -env = Environment() -env.SourceCode('.', env.RCS()) -env.Program('hello.c') - - -hello.c,v - - - - - scons -Q - - -
- -
- Fetching Source Code From SCCS - - - - XXX - - - - - -env = Environment() -env.SourceCode('.', env.SCCS()) -env.Program('hello.c') - - -s.hello.c - - - - - scons -Q - - -
- - - -
diff --git a/src/CHANGES.txt b/src/CHANGES.txt index 96465d6..79a65fb 100755 --- a/src/CHANGES.txt +++ b/src/CHANGES.txt @@ -13,6 +13,9 @@ RELEASE VERSION/DATE TO BE FILLED IN LATER allocations by no longer defining the *Subber classes inside of their respective function calls. + From Mats Wichmann: + - Remove deprecated SourceCode + RELEASE 3.1.2 - Mon, 17 Dec 2019 02:06:27 +0000 diff --git a/src/engine/SCons/Environment.py b/src/engine/SCons/Environment.py index 27179c3..36b7c3d 100644 --- a/src/engine/SCons/Environment.py +++ b/src/engine/SCons/Environment.py @@ -2199,37 +2199,6 @@ class Base(SubstitutionEnvironment): target.side_effects.append(side_effect) return side_effects - def SourceCode(self, entry, builder): - """Arrange for a source code builder for (part of) a tree.""" - msg = """SourceCode() has been deprecated and there is no replacement. -\tIf you need this function, please contact scons-dev@scons.org""" - SCons.Warnings.warn(SCons.Warnings.DeprecatedSourceCodeWarning, msg) - entries = self.arg2nodes(entry, self.fs.Entry) - for entry in entries: - entry.set_src_builder(builder) - return entries - - def Split(self, arg): - """This function converts a string or list into a list of strings - or Nodes. This makes things easier for users by allowing files to - be specified as a white-space separated list to be split. - - The input rules are: - - A single string containing names separated by spaces. These will be - split apart at the spaces. - - A single Node instance - - A list containing either strings or Node instances. Any strings - in the list are not split at spaces. - - In all cases, the function returns a list of Nodes and strings.""" - - if SCons.Util.is_List(arg): - return list(map(self.subst, arg)) - elif SCons.Util.is_String(arg): - return self.subst(arg).split() - else: - return [self.subst(arg)] - def Value(self, value, built_value=None): """ """ diff --git a/src/engine/SCons/Environment.xml b/src/engine/SCons/Environment.xml index 6f263a4..b1c2039 100644 --- a/src/engine/SCons/Environment.xml +++ b/src/engine/SCons/Environment.xml @@ -2879,137 +2879,6 @@ function. - - -(entries, builder) - - - -This function and its associate factory functions are deprecated. -There is no replacement. -The intended use was to keep a local tree in sync with an archive, -but in actuality the function only causes the archive -to be fetched on the first run. -Synchronizing with the archive is best done external to &SCons;. - - - -Arrange for non-existent source files to -be fetched from a source code management system -using the specified -builder. -The specified -entries -may be a Node, string or list of both, -and may represent either individual -source files or directories in which -source files can be found. - - - -For any non-existent source files, -&scons; -will search up the directory tree -and use the first -&f-SourceCode; -builder it finds. -The specified -builder -may be -None, -in which case -&scons; -will not use a builder to fetch -source files for the specified -entries, -even if a -&f-SourceCode; -builder has been specified -for a directory higher up the tree. - - - -&scons; -will, by default, -fetch files from SCCS or RCS subdirectories -without explicit configuration. -This takes some extra processing time -to search for the necessary -source code management files on disk. -You can avoid these extra searches -and speed up your build a little -by disabling these searches as follows: - - - -env.SourceCode('.', None) - - - -Note that if the specified -builder -is one you create by hand, -it must have an associated -construction environment to use -when fetching a source file. - - - -&scons; -provides a set of canned factory -functions that return appropriate -Builders for various popular -source code management systems. -Canonical examples of invocation include: - - - -env.SourceCode('.', env.BitKeeper('/usr/local/BKsources')) -env.SourceCode('src', env.CVS('/usr/local/CVSROOT')) -env.SourceCode('/', env.RCS()) -env.SourceCode(['f1.c', 'f2.c'], env.SCCS()) -env.SourceCode('no_source.c', None) - - - - - - - - - -(arg) - - - -Returns a list of file names or other objects. -If arg is a string, -it will be split on strings of white-space characters -within the string, -making it easier to write long lists of file names. -If arg is already a list, -the list will be returned untouched. -If arg is any other type of object, -it will be returned as a list -containing just the object. - - - -Example: - - - -files = Split("f1.c f2.c f3.c") -files = env.Split("f4.c f5.c f6.c") -files = Split(""" - f7.c - f8.c - f9.c -""") - - - - (input, [raw, target, source, conv]) diff --git a/src/engine/SCons/EnvironmentTests.py b/src/engine/SCons/EnvironmentTests.py index b2f2bd5..52ab859 100644 --- a/src/engine/SCons/EnvironmentTests.py +++ b/src/engine/SCons/EnvironmentTests.py @@ -3255,25 +3255,6 @@ def generate(env): assert ggg.side_effects == [s], ggg.side_effects assert ccc.side_effects == [s], ccc.side_effects - def test_SourceCode(self): - """Test the SourceCode() method.""" - env = self.TestEnvironment(FOO='mmm', BAR='nnn') - e = env.SourceCode('foo', None)[0] - assert e.get_internal_path() == 'foo' - s = e.src_builder() - assert s is None, s - - b = Builder() - e = env.SourceCode(e, b)[0] - assert e.get_internal_path() == 'foo' - s = e.src_builder() - assert s is b, s - - e = env.SourceCode('$BAR$FOO', None)[0] - assert e.get_internal_path() == 'nnnmmm' - s = e.src_builder() - assert s is None, s - def test_Split(self): """Test the Split() method""" env = self.TestEnvironment(FOO = 'fff', BAR = 'bbb') diff --git a/src/engine/SCons/Script/__init__.py b/src/engine/SCons/Script/__init__.py index 9947943..8f526be 100644 --- a/src/engine/SCons/Script/__init__.py +++ b/src/engine/SCons/Script/__init__.py @@ -344,7 +344,6 @@ GlobalDefaultEnvironmentFunctions = [ 'Requires', 'SConsignFile', 'SideEffect', - 'SourceCode', 'Split', 'Tag', 'Value', diff --git a/test/Deprecated/SourceCode/SourceCode.py b/test/Deprecated/SourceCode/SourceCode.py deleted file mode 100644 index b7f1305..0000000 --- a/test/Deprecated/SourceCode/SourceCode.py +++ /dev/null @@ -1,123 +0,0 @@ -#!/usr/bin/env python -# -# __COPYRIGHT__ -# -# Permission is hereby granted, free of charge, to any person obtaining -# a copy of this software and associated documentation files (the -# "Software"), to deal in the Software without restriction, including -# without limitation the rights to use, copy, modify, merge, publish, -# distribute, sublicense, and/or sell copies of the Software, and to -# permit persons to whom the Software is furnished to do so, subject to -# the following conditions: -# -# The above copyright notice and this permission notice shall be included -# in all copies or substantial portions of the Software. -# -# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY -# KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE -# WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND -# NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE -# LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION -# OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION -# WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - -__revision__ = "__FILE__ __REVISION__ __DATE__ __DEVELOPER__" - -""" -Test fetching source files using the SourceCode() method. -""" - -import os - -import TestSCons - -test = TestSCons.TestSCons(match = TestSCons.match_re_dotall) - -test.write('SConscript', """ -SourceCode('.', None) -""") - -msg = """SourceCode() has been deprecated and there is no replacement. -\tIf you need this function, please contact scons-dev@scons.org""" -warning = test.deprecated_warning('deprecated-source-code', msg) - -test.subdir('sub', 'sub2') - -test.write('SConstruct', """\ -SetOption('warn', 'deprecated-source-code') -import os - -def cat(env, source, target): - target = str(target[0]) - with open(target, "wb") as ofp: - for src in source: - with open(str(src), "rb") as ifp: - ofp.write(ifp.read()) - -def sc_cat(env, source, target): - source = [] - for t in target: - head, tail = os.path.split(str(t)) - source.append(os.path.join(head, 'sc-' + tail)) - cat(env, source, target) - -env = Environment(BUILDERS={'Cat':Builder(action=cat)}, SUBDIR='sub') -env.SourceCode('$SUBDIR', Builder(action=sc_cat, env=env)) -env.Cat('aaa.out', 'sub/aaa.in') -bbb_in = File('sub/bbb.in') -bbb_in.is_derived() -env.Cat('bbb.out', bbb_in) -env.Cat('ccc.out', 'sub/ccc.in') -env.Cat('all', ['aaa.out', 'bbb.out', 'ccc.out']) -SConscript('sub/SConscript', "env") - -SourceCode('sub2', Builder(action=sc_cat, env=env)) -env.Cat('ddd.out', 'sub2/ddd.in') -""") - -test.write(['sub', 'sc-aaa.in'], "sub/sc-aaa.in\n") -test.write(['sub', 'sc-bbb.in'], "sub/sc-bbb.in\n") -test.write(['sub', 'sc-ccc.in'], "sub/sc-ccc.in\n") -test.write(['sub2', 'sc-ddd.in'], "sub2/sc-ddd.in\n") - -test.write(['sub', 'sc-SConscript'], "'sub/sc-SConscript'\n") - -read_str = """\ -sc_cat(["%s"], []) -""" % (os.path.join('sub', 'SConscript')) - -build_str = """\ -sc_cat(["%s"], []) -cat(["aaa.out"], ["%s"]) -sc_cat(["%s"], []) -cat(["bbb.out"], ["%s"]) -sc_cat(["%s"], []) -cat(["ccc.out"], ["%s"]) -cat(["all"], ["aaa.out", "bbb.out", "ccc.out"]) -sc_cat(["%s"], []) -cat(["ddd.out"], ["%s"]) -""" % (os.path.join('sub', 'aaa.in'), - os.path.join('sub', 'aaa.in'), - os.path.join('sub', 'bbb.in'), - os.path.join('sub', 'bbb.in'), - os.path.join('sub', 'ccc.in'), - os.path.join('sub', 'ccc.in'), - os.path.join('sub2', 'ddd.in'), - os.path.join('sub2', 'ddd.in')) - -stdout = TestSCons.re_escape(test.wrap_stdout(read_str = read_str, - build_str = build_str)) - -test.run(arguments = '.', stdout = stdout, stderr = 2*warning) - -test.must_match(['sub', 'SConscript'], "'sub/sc-SConscript'\n") -test.must_match('all', "sub/sc-aaa.in\nsub/sc-bbb.in\nsub/sc-ccc.in\n") -test.must_match('ddd.out', "sub2/sc-ddd.in\n") - -test.pass_test() - -# Local Variables: -# tab-width:4 -# indent-tabs-mode:nil -# End: -# vim: set expandtab tabstop=4 shiftwidth=4: diff --git a/test/Removed/SourceCode/Old/SourceCode.py b/test/Removed/SourceCode/Old/SourceCode.py new file mode 100644 index 0000000..b7f1305 --- /dev/null +++ b/test/Removed/SourceCode/Old/SourceCode.py @@ -0,0 +1,123 @@ +#!/usr/bin/env python +# +# __COPYRIGHT__ +# +# Permission is hereby granted, free of charge, to any person obtaining +# a copy of this software and associated documentation files (the +# "Software"), to deal in the Software without restriction, including +# without limitation the rights to use, copy, modify, merge, publish, +# distribute, sublicense, and/or sell copies of the Software, and to +# permit persons to whom the Software is furnished to do so, subject to +# the following conditions: +# +# The above copyright notice and this permission notice shall be included +# in all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY +# KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE +# WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND +# NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE +# LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION +# OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION +# WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + +__revision__ = "__FILE__ __REVISION__ __DATE__ __DEVELOPER__" + +""" +Test fetching source files using the SourceCode() method. +""" + +import os + +import TestSCons + +test = TestSCons.TestSCons(match = TestSCons.match_re_dotall) + +test.write('SConscript', """ +SourceCode('.', None) +""") + +msg = """SourceCode() has been deprecated and there is no replacement. +\tIf you need this function, please contact scons-dev@scons.org""" +warning = test.deprecated_warning('deprecated-source-code', msg) + +test.subdir('sub', 'sub2') + +test.write('SConstruct', """\ +SetOption('warn', 'deprecated-source-code') +import os + +def cat(env, source, target): + target = str(target[0]) + with open(target, "wb") as ofp: + for src in source: + with open(str(src), "rb") as ifp: + ofp.write(ifp.read()) + +def sc_cat(env, source, target): + source = [] + for t in target: + head, tail = os.path.split(str(t)) + source.append(os.path.join(head, 'sc-' + tail)) + cat(env, source, target) + +env = Environment(BUILDERS={'Cat':Builder(action=cat)}, SUBDIR='sub') +env.SourceCode('$SUBDIR', Builder(action=sc_cat, env=env)) +env.Cat('aaa.out', 'sub/aaa.in') +bbb_in = File('sub/bbb.in') +bbb_in.is_derived() +env.Cat('bbb.out', bbb_in) +env.Cat('ccc.out', 'sub/ccc.in') +env.Cat('all', ['aaa.out', 'bbb.out', 'ccc.out']) +SConscript('sub/SConscript', "env") + +SourceCode('sub2', Builder(action=sc_cat, env=env)) +env.Cat('ddd.out', 'sub2/ddd.in') +""") + +test.write(['sub', 'sc-aaa.in'], "sub/sc-aaa.in\n") +test.write(['sub', 'sc-bbb.in'], "sub/sc-bbb.in\n") +test.write(['sub', 'sc-ccc.in'], "sub/sc-ccc.in\n") +test.write(['sub2', 'sc-ddd.in'], "sub2/sc-ddd.in\n") + +test.write(['sub', 'sc-SConscript'], "'sub/sc-SConscript'\n") + +read_str = """\ +sc_cat(["%s"], []) +""" % (os.path.join('sub', 'SConscript')) + +build_str = """\ +sc_cat(["%s"], []) +cat(["aaa.out"], ["%s"]) +sc_cat(["%s"], []) +cat(["bbb.out"], ["%s"]) +sc_cat(["%s"], []) +cat(["ccc.out"], ["%s"]) +cat(["all"], ["aaa.out", "bbb.out", "ccc.out"]) +sc_cat(["%s"], []) +cat(["ddd.out"], ["%s"]) +""" % (os.path.join('sub', 'aaa.in'), + os.path.join('sub', 'aaa.in'), + os.path.join('sub', 'bbb.in'), + os.path.join('sub', 'bbb.in'), + os.path.join('sub', 'ccc.in'), + os.path.join('sub', 'ccc.in'), + os.path.join('sub2', 'ddd.in'), + os.path.join('sub2', 'ddd.in')) + +stdout = TestSCons.re_escape(test.wrap_stdout(read_str = read_str, + build_str = build_str)) + +test.run(arguments = '.', stdout = stdout, stderr = 2*warning) + +test.must_match(['sub', 'SConscript'], "'sub/sc-SConscript'\n") +test.must_match('all', "sub/sc-aaa.in\nsub/sc-bbb.in\nsub/sc-ccc.in\n") +test.must_match('ddd.out', "sub2/sc-ddd.in\n") + +test.pass_test() + +# Local Variables: +# tab-width:4 +# indent-tabs-mode:nil +# End: +# vim: set expandtab tabstop=4 shiftwidth=4: diff --git a/test/Removed/SourceCode/Old/sconstest.skip b/test/Removed/SourceCode/Old/sconstest.skip new file mode 100644 index 0000000..e69de29 diff --git a/test/Removed/SourceCode/README.md b/test/Removed/SourceCode/README.md new file mode 100644 index 0000000..c584dc9 --- /dev/null +++ b/test/Removed/SourceCode/README.md @@ -0,0 +1,6 @@ +SourceCode.py is the "new" test for SourceCode making sure we +get a NameError. + +The Old directory is the former tests from the deprecated state, +preserved here for reference; the presence of an scontest.skip file +means they are never executed. diff --git a/test/Removed/SourceCode/SConstruct.global b/test/Removed/SourceCode/SConstruct.global new file mode 100644 index 0000000..321fe7e --- /dev/null +++ b/test/Removed/SourceCode/SConstruct.global @@ -0,0 +1,2 @@ +DefaultEnvironment(tools=[]) +SourceCode('no_source.c', None) diff --git a/test/Removed/SourceCode/SConstruct.method b/test/Removed/SourceCode/SConstruct.method new file mode 100644 index 0000000..94a4916 --- /dev/null +++ b/test/Removed/SourceCode/SConstruct.method @@ -0,0 +1,3 @@ +DefaultEnvironment(tools=[]) +env = Environment(tools=["textfile"]) +env.SourceCode('no_source.c', None) diff --git a/test/Removed/SourceCode/SourceCode.py b/test/Removed/SourceCode/SourceCode.py new file mode 100644 index 0000000..30499af --- /dev/null +++ b/test/Removed/SourceCode/SourceCode.py @@ -0,0 +1,73 @@ +""" +NameError: name 'SourceCode' is not defined: + File "/tmp/testcmd.193317.nqan7rtg/SConstruct", line 4: + SConscript('SConscript') + File "/home/mats/github/scons/src/engine/SCons/Script/SConscript.py", line 660: + return method(*args, **kw) + File "/home/mats/github/scons/src/engine/SCons/Script/SConscript.py", line 597: + return _SConscript(self.fs, *files, **subst_kw) + File "/home/mats/github/scons/src/engine/SCons/Script/SConscript.py", line 286: + exec(compile(scriptdata, scriptname, 'exec'), call_stack[-1].globals) + File "/tmp/testcmd.193317.nqan7rtg/SConscript", line 2: + SourceCode('.', None) +""" +#!/usr/bin/env python +# +# __COPYRIGHT__ +# +# Permission is hereby granted, free of charge, to any person obtaining +# a copy of this software and associated documentation files (the +# "Software"), to deal in the Software without restriction, including +# without limitation the rights to use, copy, modify, merge, publish, +# distribute, sublicense, and/or sell copies of the Software, and to +# permit persons to whom the Software is furnished to do so, subject to +# the following conditions: +# +# The above copyright notice and this permission notice shall be included +# in all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY +# KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE +# WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND +# NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE +# LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION +# OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION +# WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + +__revision__ = "__FILE__ __REVISION__ __DATE__ __DEVELOPER__" + +""" +Test the removed SourceCode() method errors out if used. +""" + +import os + +import TestSCons + +test = TestSCons.TestSCons(match=TestSCons.match_exact) + +test.subdir('src') + +test.file_fixture('SConstruct.global', 'SConstruct') +expect = """\ +NameError: name 'SourceCode' is not defined: + File "{}", line 2: + SourceCode('no_source.c', None) +""".format(test.workpath('SConstruct')) +test.run(arguments='-Q -s', status=2, stderr=expect) + +test.file_fixture('SConstruct.method', 'SConstruct') +expect = """\ +AttributeError: 'SConsEnvironment' object has no attribute 'SourceCode': + File "{}", line 3: + env.SourceCode('no_source.c', None) +""".format(test.workpath('SConstruct')) +test.run(arguments='-Q -s', status=2, stderr=expect) + +test.pass_test() + +# Local Variables: +# tab-width:4 +# indent-tabs-mode:nil +# End: +# vim: set expandtab tabstop=4 shiftwidth=4: -- cgit v0.12 From 1b177138a204de2000cc490a96050e54e4626166 Mon Sep 17 00:00:00 2001 From: Mats Wichmann Date: Fri, 20 Dec 2019 12:21:29 -0700 Subject: [PR #3506] fix sider complaint Signed-off-by: Mats Wichmann --- test/Removed/SourceCode/SourceCode.py | 2 -- 1 file changed, 2 deletions(-) diff --git a/test/Removed/SourceCode/SourceCode.py b/test/Removed/SourceCode/SourceCode.py index 30499af..8ac54d4 100644 --- a/test/Removed/SourceCode/SourceCode.py +++ b/test/Removed/SourceCode/SourceCode.py @@ -40,8 +40,6 @@ __revision__ = "__FILE__ __REVISION__ __DATE__ __DEVELOPER__" Test the removed SourceCode() method errors out if used. """ -import os - import TestSCons test = TestSCons.TestSCons(match=TestSCons.match_exact) -- cgit v0.12 From f6d44c83fc88a3feffa88f747c5cceb875453059 Mon Sep 17 00:00:00 2001 From: Mats Wichmann Date: Fri, 20 Dec 2019 12:52:01 -0700 Subject: [PR #3506] restore accidentally removed Split Oops! somehow removed an extra function block. Signed-off-by: Mats Wichmann --- src/engine/SCons/Environment.py | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/src/engine/SCons/Environment.py b/src/engine/SCons/Environment.py index 36b7c3d..2c80424 100644 --- a/src/engine/SCons/Environment.py +++ b/src/engine/SCons/Environment.py @@ -2199,6 +2199,27 @@ class Base(SubstitutionEnvironment): target.side_effects.append(side_effect) return side_effects + def Split(self, arg): + """This function converts a string or list into a list of strings + or Nodes. This makes things easier for users by allowing files to + be specified as a white-space separated list to be split. + + The input rules are: + - A single string containing names separated by spaces. These will be + split apart at the spaces. + - A single Node instance + - A list containing either strings or Node instances. Any strings + in the list are not split at spaces. + + In all cases, the function returns a list of Nodes and strings.""" + + if SCons.Util.is_List(arg): + return list(map(self.subst, arg)) + elif SCons.Util.is_String(arg): + return self.subst(arg).split() + else: + return [self.subst(arg)] + def Value(self, value, built_value=None): """ """ -- cgit v0.12 From c1d1e5492069b799a5e7a9689bf940d34b9a526a Mon Sep 17 00:00:00 2001 From: Mats Wichmann Date: Fri, 20 Dec 2019 13:19:43 -0700 Subject: [PR #3506] fix remnamt docstring and speed up left a pasted traceback in the SourceCode.py test, got rid of. applied "standard" speedup of dropping tools in DefaultEnvironmment and Environment, speeds up windows a lot (individual Removed tests running in 1 sec instead of 15) Signed-off-by: Mats Wichmann --- test/Removed/BuildDir/BuildDir.py | 2 +- test/Removed/BuildDir/SConscript-build_dir.py | 2 +- test/Removed/BuildDir/SConstruct.global | 1 + test/Removed/BuildDir/SConstruct.kwarg | 1 + test/Removed/BuildDir/SConstruct.method | 4 ++-- test/Removed/Copy-Method/Copy-Method.py | 2 +- test/Removed/Copy-Method/SConstruct.method | 3 ++- test/Removed/SourceCode/SourceCode.py | 13 ------------- test/Removed/SourceSignatures/SConstruct.method | 1 + test/Removed/SourceSignatures/SConstruct.setopt | 1 + test/Removed/SourceSignatures/SourceSignatures.py | 2 +- test/Removed/TargetSignatures/SConstruct.method | 1 + test/Removed/TargetSignatures/SConstruct.setopt | 1 + test/Removed/TargetSignatures/TargetSignatures.py | 2 +- 14 files changed, 15 insertions(+), 21 deletions(-) diff --git a/test/Removed/BuildDir/BuildDir.py b/test/Removed/BuildDir/BuildDir.py index 43c8b8b..589b89a 100644 --- a/test/Removed/BuildDir/BuildDir.py +++ b/test/Removed/BuildDir/BuildDir.py @@ -38,7 +38,7 @@ test.subdir('src') test.file_fixture('SConstruct.global', 'SConstruct') expect = """\ NameError: name 'BuildDir' is not defined: - File "{}", line 1: + File "{}", line 2: BuildDir('build', 'src') """.format(test.workpath('SConstruct')) test.run(arguments='-Q -s', status=2, stderr=expect) diff --git a/test/Removed/BuildDir/SConscript-build_dir.py b/test/Removed/BuildDir/SConscript-build_dir.py index 5a8d1ca..77b6ee4 100644 --- a/test/Removed/BuildDir/SConscript-build_dir.py +++ b/test/Removed/BuildDir/SConscript-build_dir.py @@ -43,7 +43,7 @@ test.write(['src', 'SConscript'], """ # this doesn't work yet expect = """\ TypeError: SConscript() got an unexpected keyword argument 'build_dir': - File "{}", line 1: + File "{}", line 2: SConscript('src/SConscript', build_dir='build') """.format(test.workpath('SConstruct')) test.run(arguments='-Q -s', status=2, stderr=expect) diff --git a/test/Removed/BuildDir/SConstruct.global b/test/Removed/BuildDir/SConstruct.global index 086fbae..7dddf29 100644 --- a/test/Removed/BuildDir/SConstruct.global +++ b/test/Removed/BuildDir/SConstruct.global @@ -1 +1,2 @@ +DefaultEnvironment(tools=[]) BuildDir('build', 'src') diff --git a/test/Removed/BuildDir/SConstruct.kwarg b/test/Removed/BuildDir/SConstruct.kwarg index a5c46fb..2288669 100644 --- a/test/Removed/BuildDir/SConstruct.kwarg +++ b/test/Removed/BuildDir/SConstruct.kwarg @@ -1 +1,2 @@ +DefaultEnvironment(tools=[]) SConscript('src/SConscript', build_dir='build') diff --git a/test/Removed/BuildDir/SConstruct.method b/test/Removed/BuildDir/SConstruct.method index afea459..ddf2324 100644 --- a/test/Removed/BuildDir/SConstruct.method +++ b/test/Removed/BuildDir/SConstruct.method @@ -1,3 +1,3 @@ -env = Environment(BUILD='build', SRC='src') - +DefaultEnvironment(tools=[]) +env = Environment(BUILD='build', SRC='src', tools=[]) env.BuildDir('build', 'src') diff --git a/test/Removed/Copy-Method/Copy-Method.py b/test/Removed/Copy-Method/Copy-Method.py index bca10fe..4c7c386 100644 --- a/test/Removed/Copy-Method/Copy-Method.py +++ b/test/Removed/Copy-Method/Copy-Method.py @@ -35,7 +35,7 @@ test = TestSCons.TestSCons(match = TestSCons.match_re_dotall) test.file_fixture('SConstruct.method', 'SConstruct') expect = """\ AttributeError: 'SConsEnvironment' object has no attribute 'Copy': - File "{}", line 2: + File "{}", line 3: env.Copy() """.format(test.workpath('SConstruct')) test.run(arguments='-Q -s', status=2, stderr=expect, match=TestSCons.match_exact) diff --git a/test/Removed/Copy-Method/SConstruct.method b/test/Removed/Copy-Method/SConstruct.method index 99737e1..5a59bd6 100644 --- a/test/Removed/Copy-Method/SConstruct.method +++ b/test/Removed/Copy-Method/SConstruct.method @@ -1,2 +1,3 @@ -env = Environment() +DefaultEnvironment(tools=[]) +env = Environment(tools=["textfile"]) env.Copy() diff --git a/test/Removed/SourceCode/SourceCode.py b/test/Removed/SourceCode/SourceCode.py index 8ac54d4..f586ef6 100644 --- a/test/Removed/SourceCode/SourceCode.py +++ b/test/Removed/SourceCode/SourceCode.py @@ -1,16 +1,3 @@ -""" -NameError: name 'SourceCode' is not defined: - File "/tmp/testcmd.193317.nqan7rtg/SConstruct", line 4: - SConscript('SConscript') - File "/home/mats/github/scons/src/engine/SCons/Script/SConscript.py", line 660: - return method(*args, **kw) - File "/home/mats/github/scons/src/engine/SCons/Script/SConscript.py", line 597: - return _SConscript(self.fs, *files, **subst_kw) - File "/home/mats/github/scons/src/engine/SCons/Script/SConscript.py", line 286: - exec(compile(scriptdata, scriptname, 'exec'), call_stack[-1].globals) - File "/tmp/testcmd.193317.nqan7rtg/SConscript", line 2: - SourceCode('.', None) -""" #!/usr/bin/env python # # __COPYRIGHT__ diff --git a/test/Removed/SourceSignatures/SConstruct.method b/test/Removed/SourceSignatures/SConstruct.method index e68d6bf..99ef2d2 100644 --- a/test/Removed/SourceSignatures/SConstruct.method +++ b/test/Removed/SourceSignatures/SConstruct.method @@ -1 +1,2 @@ +DefaultEnvironment(tools=[]) SourceSignatures('MD5') diff --git a/test/Removed/SourceSignatures/SConstruct.setopt b/test/Removed/SourceSignatures/SConstruct.setopt index 6e1161f..f4b278e 100644 --- a/test/Removed/SourceSignatures/SConstruct.setopt +++ b/test/Removed/SourceSignatures/SConstruct.setopt @@ -1 +1,2 @@ +DefaultEnvironment(tools=[]) SetOption('warn', 'deprecated-source-signatures') diff --git a/test/Removed/SourceSignatures/SourceSignatures.py b/test/Removed/SourceSignatures/SourceSignatures.py index 014c163..04d2ed7 100644 --- a/test/Removed/SourceSignatures/SourceSignatures.py +++ b/test/Removed/SourceSignatures/SourceSignatures.py @@ -36,7 +36,7 @@ test = TestSCons.TestSCons() test.file_fixture('SConstruct.method', 'SConstruct') expect = """\ NameError: name 'SourceSignatures' is not defined: - File "{}", line 1: + File "{}", line 2: SourceSignatures('MD5') """.format(test.workpath('SConstruct')) test.run(arguments='-Q -s', status=2, stdout=None, stderr=expect) diff --git a/test/Removed/TargetSignatures/SConstruct.method b/test/Removed/TargetSignatures/SConstruct.method index 5e974b6..9f82f9b 100644 --- a/test/Removed/TargetSignatures/SConstruct.method +++ b/test/Removed/TargetSignatures/SConstruct.method @@ -1 +1,2 @@ +DefaultEnvironment(tools=[]) TargetSignatures('MD5') diff --git a/test/Removed/TargetSignatures/SConstruct.setopt b/test/Removed/TargetSignatures/SConstruct.setopt index c887ce4..5576ba8 100644 --- a/test/Removed/TargetSignatures/SConstruct.setopt +++ b/test/Removed/TargetSignatures/SConstruct.setopt @@ -1 +1,2 @@ +DefaultEnvironment(tools=[]) SetOption('warn', 'deprecated-target-signatures') diff --git a/test/Removed/TargetSignatures/TargetSignatures.py b/test/Removed/TargetSignatures/TargetSignatures.py index 889f992..edd60a2 100644 --- a/test/Removed/TargetSignatures/TargetSignatures.py +++ b/test/Removed/TargetSignatures/TargetSignatures.py @@ -36,7 +36,7 @@ test = TestSCons.TestSCons() test.file_fixture('SConstruct.method', 'SConstruct') expect = """\ NameError: name 'TargetSignatures' is not defined: - File "{}", line 1: + File "{}", line 2: TargetSignatures('MD5') """.format(test.workpath('SConstruct')) test.run(arguments='-Q -s', status=2, stdout=None, stderr=expect) -- cgit v0.12 From c73104adc3624503764ff4585b8ba22b62ee4c3b Mon Sep 17 00:00:00 2001 From: Mats Wichmann Date: Sat, 21 Dec 2019 07:12:38 -0700 Subject: Fix two small syntax errors in string formatting Signed-off-by: Mats Wichmann --- src/CHANGES.txt | 1 + src/engine/SCons/Tool/install.py | 4 ++-- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/src/CHANGES.txt b/src/CHANGES.txt index 79a65fb..87980a8 100755 --- a/src/CHANGES.txt +++ b/src/CHANGES.txt @@ -15,6 +15,7 @@ RELEASE VERSION/DATE TO BE FILLED IN LATER From Mats Wichmann: - Remove deprecated SourceCode + - str.format syntax errors fixed RELEASE 3.1.2 - Mon, 17 Dec 2019 02:06:27 +0000 diff --git a/src/engine/SCons/Tool/install.py b/src/engine/SCons/Tool/install.py index c0a193b..dcb3581 100644 --- a/src/engine/SCons/Tool/install.py +++ b/src/engine/SCons/Tool/install.py @@ -168,7 +168,7 @@ def installShlibLinks(dest, source, env): Verbose = False symlinks = listShlibLinksToInstall(dest, source, env) if Verbose: - print('installShlibLinks: symlinks={:r}'.format(SCons.Tool.StringizeLibSymlinks(symlinks))) + print('installShlibLinks: symlinks={!r}'.format(SCons.Tool.StringizeLibSymlinks(symlinks))) if symlinks: SCons.Tool.CreateLibSymlinks(env, symlinks) return @@ -244,7 +244,7 @@ def add_versioned_targets_to_INSTALLED_FILES(target, source, env): Verbose = False _INSTALLED_FILES.extend(target) if Verbose: - print("add_versioned_targets_to_INSTALLED_FILES: target={:r}".format(list(map(str, target)))) + print("add_versioned_targets_to_INSTALLED_FILES: target={!r}".format(list(map(str, target)))) symlinks = listShlibLinksToInstall(target[0], source, env) if symlinks: SCons.Tool.EmitLibSymlinks(env, symlinks, target[0]) -- cgit v0.12 From 7ba3919aa8d401d07c6920c6b84dc657a381cb5e Mon Sep 17 00:00:00 2001 From: Mats Wichmann Date: Sat, 21 Dec 2019 11:56:08 -0700 Subject: checker fixes: None, trailing ws, list init checker-suggested fixes: Mostly, fix remaining instances of comparing none without "is" Some trailing whitespace on lines A couple of instances of list init followed immediately by several appends, turned into a single list init Some double comparisons turned into a single expression Signed-off-by: Mats Wichmann --- doc/SConscript | 2 +- src/engine/SCons/Node/FSTests.py | 13 +++++----- src/engine/SCons/SConf.py | 2 +- src/engine/SCons/Scanner/ScannerTests.py | 4 +--- src/engine/SCons/Tool/MSCommon/vc.py | 4 ++-- .../docbook-xsl-1.76.1/extensions/docbook.py | 12 +++++----- src/engine/SCons/Util.py | 28 ++++++++++++---------- src/engine/SCons/UtilTests.py | 10 ++++---- test/Value.py | 6 ++--- testing/framework/TestCmd.py | 2 +- testing/framework/TestCmdTests.py | 18 +++++++------- 11 files changed, 51 insertions(+), 50 deletions(-) diff --git a/doc/SConscript b/doc/SConscript index 51ef2db..ff29a70 100644 --- a/doc/SConscript +++ b/doc/SConscript @@ -525,7 +525,7 @@ if not epydoc_cli: # first arg is a list where can be names of python package dirs, # python files, object names or objects itself docindex = build_doc_index([str(src) for src in source]) - if docindex == None: + if docindex is None: return -1 if env['EPYDOCFLAGS'] == '--html': diff --git a/src/engine/SCons/Node/FSTests.py b/src/engine/SCons/Node/FSTests.py index eddfdf0..9c19481 100644 --- a/src/engine/SCons/Node/FSTests.py +++ b/src/engine/SCons/Node/FSTests.py @@ -2508,8 +2508,8 @@ class FileTestCase(_tempdirTestCase): build_f1, src_f1) def test_changed(self): - """ - Verify that changes between BuildInfo's list of souces, depends, and implicit + """ + Verify that changes between BuildInfo's list of souces, depends, and implicit dependencies do not corrupt content signature values written to .SConsign when using CacheDir and Timestamp-MD5 decider. This is for issue #2980 @@ -3374,10 +3374,11 @@ class find_fileTestCase(unittest.TestCase): node_pseudo.set_src_builder(1) # Any non-zero value. paths = tuple(map(fs.Dir, ['.', 'same', './bar'])) - nodes = [SCons.Node.FS.find_file('foo', paths)] - nodes.append(SCons.Node.FS.find_file('baz', paths)) - nodes.append(SCons.Node.FS.find_file('pseudo', paths)) - nodes.append(SCons.Node.FS.find_file('same', paths)) + nodes = [SCons.Node.FS.find_file('foo', paths), + SCons.Node.FS.find_file('baz', paths), + SCons.Node.FS.find_file('pseudo', paths), + SCons.Node.FS.find_file('same', paths) + ] file_names = list(map(str, nodes)) file_names = list(map(os.path.normpath, file_names)) diff --git a/src/engine/SCons/SConf.py b/src/engine/SCons/SConf.py index 71729c9..0195ac4 100644 --- a/src/engine/SCons/SConf.py +++ b/src/engine/SCons/SConf.py @@ -1067,7 +1067,7 @@ def CheckLibWithHeader(context, libs, header, language, """ prog_prefix, dummy = \ createIncludesFromHeaders(header, 0) - if libs == []: + if not libs: libs = [None] if not SCons.Util.is_List(libs): diff --git a/src/engine/SCons/Scanner/ScannerTests.py b/src/engine/SCons/Scanner/ScannerTests.py index 64a2345..abe4042 100644 --- a/src/engine/SCons/Scanner/ScannerTests.py +++ b/src/engine/SCons/Scanner/ScannerTests.py @@ -236,7 +236,7 @@ class BaseTestCase(unittest.TestCase): def test___cmp__(self): """Test the Scanner.Base class __cmp__() method""" s = SCons.Scanner.Base(self.func, "Cmp") - assert s != None + assert s is not None def test_hash(self): """Test the Scanner.Base class __hash__() method""" @@ -578,8 +578,6 @@ class ClassicTestCase(unittest.TestCase): "recursive = 1 didn't return all nodes: %s" % n) - - class ClassicCPPTestCase(unittest.TestCase): def test_find_include(self): """Test the Scanner.ClassicCPP find_include() method""" diff --git a/src/engine/SCons/Tool/MSCommon/vc.py b/src/engine/SCons/Tool/MSCommon/vc.py index 86bdbe0..53b9d59 100644 --- a/src/engine/SCons/Tool/MSCommon/vc.py +++ b/src/engine/SCons/Tool/MSCommon/vc.py @@ -509,7 +509,7 @@ def _check_cl_exists_in_vc_dir(env, vc_dir, msvc_version): debug('_check_cl_exists_in_vc_dir(): found ' + _CL_EXE_NAME + '!') return True - elif ver_num <= 14 and ver_num >= 8: + elif 14 >= ver_num >= 8: # Set default value to be -1 as "" which is the value for x86/x86 yields true when tested # if not host_trgt_dir @@ -541,7 +541,7 @@ def _check_cl_exists_in_vc_dir(env, vc_dir, msvc_version): debug('_check_cl_exists_in_vc_dir(): found ' + _CL_EXE_NAME + '!') return True - elif ver_num < 8 and ver_num >= 6: + elif 8 > ver_num >= 6: # not sure about these versions so if a walk the VC dir (could be slow) for root, _, files in os.walk(vc_dir): if _CL_EXE_NAME in files: diff --git a/src/engine/SCons/Tool/docbook/docbook-xsl-1.76.1/extensions/docbook.py b/src/engine/SCons/Tool/docbook/docbook-xsl-1.76.1/extensions/docbook.py index e7b8cfa..5d2de3e 100644 --- a/src/engine/SCons/Tool/docbook/docbook-xsl-1.76.1/extensions/docbook.py +++ b/src/engine/SCons/Tool/docbook/docbook-xsl-1.76.1/extensions/docbook.py @@ -33,7 +33,7 @@ def adjustColumnWidths(ctx, nodeset): # Get the nominal table width varString = lookupVariable(tctxt, "nominal.table.width", None) - if varString == None: + if varString is None: nominalWidth = 6 * pixelsPerInch; else: nominalWidth = convertLength(varString); @@ -58,13 +58,13 @@ def adjustColumnWidths(ctx, nodeset): colChildren = colgroup.children col = colChildren - while col != None: + while col is not None: if foStylesheet: width = col.prop("column-width") else: width = col.prop("width") - if width == None: + if width is None: width = "1*" relPart = 0.0 @@ -145,7 +145,7 @@ def adjustColumnWidths(ctx, nodeset): # Side-effect free? We don' need no steenkin' side-effect free! count = 0 col = colChildren - while col != None: + while col is not None: if foStylesheet: col.setProp("column-width", widths[count]) else: @@ -162,7 +162,7 @@ def convertLength(length): global unitHash m = re.search('([+-]?[\d\.]+)(\S+)', length) - if m != None and m.lastindex > 1: + if m is not None and m.lastindex > 1: unit = pixelsPerInch if m.group(2) in unitHash: unit = unitHash[m.group(2)] @@ -204,7 +204,7 @@ def correctRoundingError(floatWidths): def lookupVariable(tctxt, varName, default): varString = tctxt.variableLookup(varName, None) - if varString == None: + if varString is None: return default # If it's a list, get the first element diff --git a/src/engine/SCons/Util.py b/src/engine/SCons/Util.py index 8519a98..28674d1 100644 --- a/src/engine/SCons/Util.py +++ b/src/engine/SCons/Util.py @@ -312,18 +312,21 @@ def print_tree(root, child_func, prune=0, showtags=0, margin=[0], visited=None): '\n') sys.stdout.write(legend) - tags = ['['] - tags.append(' E'[IDX(root.exists())]) - tags.append(' R'[IDX(root.rexists() and not root.exists())]) - tags.append(' BbB'[[0,1][IDX(root.has_explicit_builder())] + - [0,2][IDX(root.has_builder())]]) - tags.append(' S'[IDX(root.side_effect)]) - tags.append(' P'[IDX(root.precious)]) - tags.append(' A'[IDX(root.always_build)]) - tags.append(' C'[IDX(root.is_up_to_date())]) - tags.append(' N'[IDX(root.noclean)]) - tags.append(' H'[IDX(root.nocache)]) - tags.append(']') + tags = [ + '[', + ' E'[IDX(root.exists())], + ' R'[IDX(root.rexists() and not root.exists())], + ' BbB'[ + [0, 1][IDX(root.has_explicit_builder())] + + [0, 2][IDX(root.has_builder())] + ], + ' S'[IDX(root.side_effect)], ' P'[IDX(root.precious)], + ' A'[IDX(root.always_build)], + ' C'[IDX(root.is_up_to_date())], + ' N'[IDX(root.noclean)], + ' H'[IDX(root.nocache)], + ']' + ] else: tags = [] @@ -352,7 +355,6 @@ def print_tree(root, child_func, prune=0, showtags=0, margin=[0], visited=None): margin.pop() - # Functions for deciding if things are like various types, mainly to # handle UserDict, UserList and UserString like their underlying types. # diff --git a/src/engine/SCons/UtilTests.py b/src/engine/SCons/UtilTests.py index 0017844..7f6508d 100644 --- a/src/engine/SCons/UtilTests.py +++ b/src/engine/SCons/UtilTests.py @@ -451,11 +451,11 @@ class UtilTestCase(unittest.TestCase): assert get_environment_var("${BAR}") == "BAR", get_environment_var("${BAR}") assert get_environment_var("$FOO_BAR1234") == "FOO_BAR1234", get_environment_var("$FOO_BAR1234") assert get_environment_var("${BAR_FOO1234}") == "BAR_FOO1234", get_environment_var("${BAR_FOO1234}") - assert get_environment_var("${BAR}FOO") == None, get_environment_var("${BAR}FOO") - assert get_environment_var("$BAR ") == None, get_environment_var("$BAR ") - assert get_environment_var("FOO$BAR") == None, get_environment_var("FOO$BAR") - assert get_environment_var("$FOO[0]") == None, get_environment_var("$FOO[0]") - assert get_environment_var("${some('complex expression')}") == None, get_environment_var( + assert get_environment_var("${BAR}FOO") is None, get_environment_var("${BAR}FOO") + assert get_environment_var("$BAR ") is None, get_environment_var("$BAR ") + assert get_environment_var("FOO$BAR") is None, get_environment_var("FOO$BAR") + assert get_environment_var("$FOO[0]") is None, get_environment_var("$FOO[0]") + assert get_environment_var("${some('complex expression')}") is None, get_environment_var( "${some('complex expression')}") def test_Proxy(self): diff --git a/test/Value.py b/test/Value.py index c1f764a..8f6c7fe 100644 --- a/test/Value.py +++ b/test/Value.py @@ -102,7 +102,7 @@ for source_signature in ['MD5', 'timestamp-newer']: test.must_contain_all_lines(test.stdout(), [out1, out2, out7, out8]) #print test.stdout() - test.fail_test(re.search(out3, test.stdout()) == None) + test.fail_test(re.search(out3, test.stdout()) is None) test.must_match('f1.out', "/usr/local") test.must_match('f2.out', "10") @@ -118,7 +118,7 @@ for source_signature in ['MD5', 'timestamp-newer']: out6 = """create\\(\\["f3.out"\\], \\[<.*.Custom (instance|object) at """ #" <- unconfuses emacs syntax highlighting test.must_contain_all_lines(test.stdout(), [out4, out5]) - test.fail_test(re.search(out6, test.stdout()) == None) + test.fail_test(re.search(out6, test.stdout()) is None) test.must_match('f1.out', "/usr") test.must_match('f2.out', "4") @@ -134,7 +134,7 @@ for source_signature in ['MD5', 'timestamp-newer']: test.must_contain_all_lines(test.stdout(), [out4, out7, out8]) test.must_not_contain_any_line(test.stdout(), [out5]) - test.fail_test(re.search(out6, test.stdout()) == None) + test.fail_test(re.search(out6, test.stdout()) is None) test.up_to_date(options='prefix=/var', arguments='.') diff --git a/testing/framework/TestCmd.py b/testing/framework/TestCmd.py index 9218f60..447d050 100644 --- a/testing/framework/TestCmd.py +++ b/testing/framework/TestCmd.py @@ -1805,7 +1805,7 @@ class TestCmd(object): path name. If the path is a null string (''), a unique directory name is created. """ - if (path != None): + if path is not None: if path == '': path = None path = self.tempdir(path) diff --git a/testing/framework/TestCmdTests.py b/testing/framework/TestCmdTests.py index ef76228..541df71 100644 --- a/testing/framework/TestCmdTests.py +++ b/testing/framework/TestCmdTests.py @@ -1737,7 +1737,7 @@ class run_TestCase(TestCmdTestCase): pass test.run(program = 'no_script', interpreter = 'python') - assert test.status != None, test.status + assert test.status is not None, test.status try: test.run(program = 'no_script', interpreter = 'no_interpreter') @@ -1750,7 +1750,7 @@ class run_TestCase(TestCmdTestCase): # Python versions that use os.popen3() or the Popen3 # class run things through the shell, which just returns # a non-zero exit status. - assert test.status != None, test.status + assert test.status is not None, test.status testx = TestCmd.TestCmd(program = t.scriptx, workdir = '', @@ -1816,7 +1816,7 @@ class run_TestCase(TestCmdTestCase): # Python versions that use os.popen3() or the Popen3 # class run things through the shell, which just returns # a non-zero exit status. - assert test.status != None + assert test.status is not None test1 = TestCmd.TestCmd(program = t.script1, interpreter = ['python', '-x'], @@ -2388,7 +2388,7 @@ with open(r'%s', 'wb') as logfp: p = test.start(program='no_script', interpreter='python') status = p.wait() - assert status != None, status + assert status is not None, status try: p = test.start(program='no_script', interpreter='no_interpreter') @@ -2402,7 +2402,7 @@ with open(r'%s', 'wb') as logfp: # Python versions that use os.popen3() or the Popen3 # class run things through the shell, which just returns # a non-zero exit status. - assert status != None, status + assert status is not None, status testx = TestCmd.TestCmd(program = t.scriptx, workdir = '', @@ -3054,11 +3054,11 @@ class workdir_TestCase(TestCmdTestCase): assert test.workdir is None test = TestCmd.TestCmd(workdir = '') - assert test.workdir != None + assert test.workdir is not None assert os.path.isdir(test.workdir) test = TestCmd.TestCmd(workdir = 'dir') - assert test.workdir != None + assert test.workdir is not None assert os.path.isdir(test.workdir) no_such_subdir = os.path.join('no', 'such', 'subdir') @@ -3071,11 +3071,11 @@ class workdir_TestCase(TestCmdTestCase): test = TestCmd.TestCmd(workdir = 'foo') workdir_foo = test.workdir - assert workdir_foo != None + assert workdir_foo is not None test.workdir_set('bar') workdir_bar = test.workdir - assert workdir_bar != None + assert workdir_bar is not None try: test.workdir_set(no_such_subdir) -- cgit v0.12 From a5359e3f10a6bcdb5d9667c95c40ddd890b551e8 Mon Sep 17 00:00:00 2001 From: Mats Wichmann Date: Sun, 22 Dec 2019 08:44:29 -0700 Subject: syntax fixups suggested by PyCharm Drop unneeded parens. Drop trailing semicolons. Triple double-quote docstrings. Regexes drop unneeded escapes. Spaces around parens, braces: remove/add. Some one-tuples get their missing closing comma. A couple of sets use set init syntax {foo} instead of set([iter]) now. And a fiddle in Node to reduce lookup time on md5 signature functions (came about because of a line-too-long issue, initially) Signed-off-by: Mats Wichmann --- bin/SConsExamples.py | 2 +- bin/scons-diff.py | 10 +++--- bin/scons_dev_master.py | 4 +-- bin/svn-bisect.py | 2 +- bin/update-release-info.py | 26 ++++----------- site_scons/Utilities.py | 2 +- site_scons/soe_utils.py | 2 +- src/CHANGES.txt | 1 + src/engine/SCons/BuilderTests.py | 4 +-- src/engine/SCons/Environment.py | 2 +- src/engine/SCons/EnvironmentTests.py | 16 ++++----- src/engine/SCons/EnvironmentValues.py | 4 +-- src/engine/SCons/JobTests.py | 26 +++++++-------- src/engine/SCons/Node/Alias.py | 3 +- src/engine/SCons/Node/FS.py | 39 +++++++++++----------- src/engine/SCons/Node/NodeTests.py | 4 +-- src/engine/SCons/Node/__init__.py | 7 ++-- src/engine/SCons/PathListTests.py | 2 +- src/engine/SCons/Platform/virtualenv.py | 2 +- src/engine/SCons/SConf.py | 10 +++--- src/engine/SCons/SConfTests.py | 2 +- src/engine/SCons/Script/Main.py | 2 +- src/engine/SCons/Script/SConsOptions.py | 2 +- src/engine/SCons/Subst.py | 2 +- src/engine/SCons/SubstTests.py | 6 ++-- src/engine/SCons/Tool/JavaCommon.py | 6 ++-- src/engine/SCons/Tool/MSCommon/sdk.py | 4 +-- src/engine/SCons/Tool/MSCommon/vc.py | 4 +-- src/engine/SCons/Tool/__init__.py | 10 +++--- src/engine/SCons/Tool/docbook/__init__.py | 4 +-- .../docbook-xsl-1.76.1/extensions/docbook.py | 6 ++-- .../docbook/docbook-xsl-1.76.1/extensions/xslt.py | 2 +- src/engine/SCons/Tool/intelc.py | 2 +- src/engine/SCons/Tool/jar.py | 2 +- src/engine/SCons/Tool/javah.py | 2 +- src/engine/SCons/Tool/mslink.py | 4 +-- src/engine/SCons/Tool/msvs.py | 14 ++++---- src/engine/SCons/Tool/packaging/msi.py | 2 +- src/engine/SCons/Tool/tex.py | 8 ++--- src/engine/SCons/Tool/xgettext.py | 2 +- src/engine/SCons/Util.py | 2 +- src/engine/SCons/dblite.py | 15 +++++---- src/script/scons-configure-cache.py | 8 ++--- src/script/scons-time.py | 2 +- src/script/sconsign.py | 2 +- test/CC/SHCCFLAGS.py | 2 +- test/CC/SHCFLAGS.py | 2 +- test/CacheDir/readonly-cache.py | 10 +++--- test/Configure/ConfigureDryRunError.py | 2 +- test/D/Support/executablesSearch.py | 4 +-- test/Exit.py | 2 +- test/LINK/LINKCOMSTR.py | 2 +- test/LINK/SHLINKCOMSTR.py | 2 +- test/LINK/applelink.py | 2 +- test/MSVS/vs-10.0-exec.py | 2 +- test/MSVS/vs-10.0Exp-exec.py | 2 +- test/MSVS/vs-11.0-exec.py | 2 +- test/MSVS/vs-11.0Exp-exec.py | 2 +- test/MSVS/vs-14.0-exec.py | 2 +- test/MSVS/vs-14.1-exec.py | 2 +- test/MSVS/vs-6.0-exec.py | 2 +- test/MSVS/vs-7.0-exec.py | 2 +- test/MSVS/vs-7.1-exec.py | 2 +- test/MSVS/vs-8.0-exec.py | 2 +- test/MSVS/vs-8.0Exp-exec.py | 2 +- test/MSVS/vs-9.0-exec.py | 2 +- test/MSVS/vs-9.0Exp-exec.py | 2 +- test/NodeOps.py | 2 +- test/QT/up-to-date.py | 2 +- test/Repository/SharedLibrary.py | 2 +- test/SWIG/recursive-includes-cpp.py | 2 +- test/TEX/LATEX.py | 2 +- test/TEX/LATEX2.py | 2 +- test/Win32/bad-drive.py | 2 +- test/implicit-cache/SetOption.py | 2 +- test/site_scons/sysdirs.py | 2 +- testing/framework/TestCmd.py | 2 +- testing/framework/TestCmdTests.py | 8 ++--- testing/framework/TestSCons.py | 2 +- testing/framework/TestUnit/taprunner.py | 2 +- 80 files changed, 179 insertions(+), 190 deletions(-) diff --git a/bin/SConsExamples.py b/bin/SConsExamples.py index dbb8715..50fbb4e 100644 --- a/bin/SConsExamples.py +++ b/bin/SConsExamples.py @@ -830,7 +830,7 @@ def create_scons_output(e): # regardless of reported addresses or Python version. # Massage addresses in object repr strings to a constant. - address_re = re.compile(r' at 0x[0-9a-fA-F]*\>') + address_re = re.compile(r' at 0x[0-9a-fA-F]*>') # Massage file names in stack traces (sometimes reported as absolute # paths) to a consistent relative path. diff --git a/bin/scons-diff.py b/bin/scons-diff.py index 687e7fa..0bed74b 100644 --- a/bin/scons-diff.py +++ b/bin/scons-diff.py @@ -30,7 +30,7 @@ Options: opts, args = getopt.getopt(sys.argv[1:], 'c:dhnqrsu:', - ['context=', 'help', 'recursive', 'unified=']) + ['context=', 'help', 'recursive', 'unified=']) diff_type = None edit_type = None @@ -53,17 +53,17 @@ for o, a in opts: diff_options.append(o) elif o in ('-h', '--help'): print(Usage) - sys.exit(0) - elif o in ('-n'): + sys.exit(0) + elif o in ('-n',): diff_options.append(o) edit_type = o - elif o in ('-q'): + elif o in ('-q',): diff_type = o diff_line = lambda l, r: None elif o in ('-r', '--recursive'): recursive = True diff_options.append(o) - elif o in ('-s'): + elif o in ('-s',): report_same = True try: diff --git a/bin/scons_dev_master.py b/bin/scons_dev_master.py index cdbd68e..d4c8e90 100755 --- a/bin/scons_dev_master.py +++ b/bin/scons_dev_master.py @@ -152,11 +152,11 @@ Usage: scons_dev_master.py [-hnqy] [--password PASSWORD] [--username USER] sys.exit(0) elif o in ('-n', '--no-exec'): CommandRunner.execute = CommandRunner.do_not_execute - elif o in ('--password'): + elif o in '--password': password = a elif o in ('-q', '--quiet'): CommandRunner.display = CommandRunner.do_not_display - elif o in ('--username'): + elif o in '--username': username = a elif o in ('-y', '--yes', '--assume-yes'): yesflag = o diff --git a/bin/svn-bisect.py b/bin/svn-bisect.py index dbf8dd9..575b15e 100755 --- a/bin/svn-bisect.py +++ b/bin/svn-bisect.py @@ -33,7 +33,7 @@ def error(s): # update to the specified version and run test def testfail(revision): - "Return true if test fails" + """Return true if test fails""" print("Updating to revision", revision) if subprocess.call(["svn","up","-qr",str(revision)]) != 0: m = "SVN did not update properly to revision %d" diff --git a/bin/update-release-info.py b/bin/update-release-info.py index fe5bbcf..fa7a5f8 100644 --- a/bin/update-release-info.py +++ b/bin/update-release-info.py @@ -146,13 +146,9 @@ except KeyError: if DEBUG: print('copyright years', copyright_years) class UpdateFile(object): - """ - XXX - """ + """ XXX """ def __init__(self, file, orig = None): - ''' - ''' if orig is None: orig = file try: with open(orig, 'r') as f: @@ -171,15 +167,11 @@ class UpdateFile(object): self.orig = '' def sub(self, pattern, replacement, count = 1): - ''' - XXX - ''' + """ XXX """ self.content = re.sub(pattern, replacement, self.content, count) def replace_assign(self, name, replacement, count = 1): - ''' - XXX - ''' + """ XXX """ self.sub('\n' + name + ' = .*', '\n' + name + ' = ' + replacement) # Determine the pattern to match a version @@ -189,9 +181,7 @@ class UpdateFile(object): match_rel = re.compile(match_pat) def replace_version(self, replacement = version_string, count = 1): - ''' - XXX - ''' + """ XXX """ self.content = self.match_rel.sub(replacement, self.content, count) # Determine the release date and the pattern to match a date @@ -213,15 +203,11 @@ class UpdateFile(object): match_date = re.compile(match_date) def replace_date(self, replacement = new_date, count = 1): - ''' - XXX - ''' + """ XXX """ self.content = self.match_date.sub(replacement, self.content, count) def __del__(self): - ''' - XXX - ''' + """ XXX """ if self.file is not None and self.content != self.orig: print('Updating ' + self.file + '...') with open(self.file, 'w') as f: diff --git a/site_scons/Utilities.py b/site_scons/Utilities.py index e8c0585..5bdcbf2 100644 --- a/site_scons/Utilities.py +++ b/site_scons/Utilities.py @@ -7,7 +7,7 @@ import distutils.util platform = distutils.util.get_platform() def is_windows(): - " Check if we're on a Windows platform" + """ Check if we're on a Windows platform""" if platform.startswith('win'): return True else: diff --git a/site_scons/soe_utils.py b/site_scons/soe_utils.py index 3b87dee..dfd605c 100644 --- a/site_scons/soe_utils.py +++ b/site_scons/soe_utils.py @@ -28,7 +28,7 @@ def soelim(target, source, env): def soscan(node, env, path): c = node.get_text_contents() - return re.compile(r"^[\.']so\s+(\S+)", re.M).findall(c) + return re.compile(r"^[.']so\s+(\S+)", re.M).findall(c) soelimbuilder = Builder(action = Action(soelim), source_scanner = Scanner(soscan)) diff --git a/src/CHANGES.txt b/src/CHANGES.txt index 87980a8..bd055f3 100755 --- a/src/CHANGES.txt +++ b/src/CHANGES.txt @@ -16,6 +16,7 @@ RELEASE VERSION/DATE TO BE FILLED IN LATER From Mats Wichmann: - Remove deprecated SourceCode - str.format syntax errors fixed + - a bunch of linter/checker syntax fixups RELEASE 3.1.2 - Mon, 17 Dec 2019 02:06:27 +0000 diff --git a/src/engine/SCons/BuilderTests.py b/src/engine/SCons/BuilderTests.py index b03a425..f28e201 100644 --- a/src/engine/SCons/BuilderTests.py +++ b/src/engine/SCons/BuilderTests.py @@ -581,7 +581,7 @@ class BuilderTestCase(unittest.TestCase): assert b5.src_suffixes(env) == ['.y'], b5.src_suffixes(env) def test_srcsuffix_nonext(self): - "Test target generation from non-extension source suffixes" + """Test target generation from non-extension source suffixes""" env = Environment() b6 = SCons.Builder.Builder(action = '', src_suffix='_src.a', @@ -679,7 +679,7 @@ class BuilderTestCase(unittest.TestCase): """create the file""" with open(str(target[0]), "w"): pass - if (len(source) == 1 and len(target) == 1): + if len(source) == 1 and len(target) == 1: env['CNT'][0] = env['CNT'][0] + 1 env = Environment() diff --git a/src/engine/SCons/Environment.py b/src/engine/SCons/Environment.py index 2c80424..19e7bd1 100644 --- a/src/engine/SCons/Environment.py +++ b/src/engine/SCons/Environment.py @@ -2247,7 +2247,7 @@ class Base(SubstitutionEnvironment): build_source(node.all_children()) def final_source(node): - while (node != node.srcnode()): + while node != node.srcnode(): node = node.srcnode() return node sources = list(map(final_source, sources)) diff --git a/src/engine/SCons/EnvironmentTests.py b/src/engine/SCons/EnvironmentTests.py index 52ab859..0e71f9e 100644 --- a/src/engine/SCons/EnvironmentTests.py +++ b/src/engine/SCons/EnvironmentTests.py @@ -726,7 +726,7 @@ sys.exit(0) assert r == 'replace_func2', r def test_Override(self): - "Test overriding construction variables" + """Test overriding construction variables""" env = SubstitutionEnvironment(ONE=1, TWO=2, THREE=3, FOUR=4) assert env['ONE'] == 1, env['ONE'] assert env['TWO'] == 2, env['TWO'] @@ -1408,7 +1408,7 @@ def exists(env): assert env['XYZ'] == 'ddd', env def test_concat(self): - "Test _concat()" + """Test _concat()""" e1 = self.TestEnvironment(PRE='pre', SUF='suf', STR='a b', LIST=['a', 'b']) s = e1.subst x = s("${_concat('', '', '', __env__)}") @@ -1423,7 +1423,7 @@ def exists(env): assert x == 'preasuf prebsuf', x def test_concat_nested(self): - "Test _concat() on a nested substitution strings." + """Test _concat() on a nested substitution strings.""" e = self.TestEnvironment(PRE='pre', SUF='suf', L1=['a', 'b'], L2=['c', 'd'], @@ -1956,7 +1956,7 @@ def generate(env): assert 'XXX' not in env.Dictionary() def test_FindIxes(self): - "Test FindIxes()" + """Test FindIxes()""" env = self.TestEnvironment(LIBPREFIX='lib', LIBSUFFIX='.a', SHLIBPREFIX='lib', @@ -2398,7 +2398,7 @@ f5: \ assert hasattr(env3, 'b2'), "b2 was not set" def test_ReplaceIxes(self): - "Test ReplaceIxes()" + """Test ReplaceIxes()""" env = self.TestEnvironment(LIBPREFIX='lib', LIBSUFFIX='.a', SHLIBPREFIX='lib', @@ -3431,7 +3431,7 @@ def generate(env): assert x in over, bad_msg % x def test_parse_flags(self): - '''Test the Base class parse_flags argument''' + """Test the Base class parse_flags argument""" # all we have to show is that it gets to MergeFlags internally env = Environment(tools=[], parse_flags = '-X') assert env['CCFLAGS'] == ['-X'], env['CCFLAGS'] @@ -3445,7 +3445,7 @@ def generate(env): assert env['CPPDEFINES'] == ['FOO', 'BAR'], env['CPPDEFINES'] def test_clone_parse_flags(self): - '''Test the env.Clone() parse_flags argument''' + """Test the env.Clone() parse_flags argument""" # all we have to show is that it gets to MergeFlags internally env = Environment(tools = []) env2 = env.Clone(parse_flags = '-X') @@ -3714,7 +3714,7 @@ class OverrideEnvironmentTestCase(unittest.TestCase,TestEnvironmentFixture): assert x == ['x3', 'y3', 'z3'], x def test_parse_flags(self): - '''Test the OverrideEnvironment parse_flags argument''' + """Test the OverrideEnvironment parse_flags argument""" # all we have to show is that it gets to MergeFlags internally env = SubstitutionEnvironment() env2 = env.Override({'parse_flags' : '-X'}) diff --git a/src/engine/SCons/EnvironmentValues.py b/src/engine/SCons/EnvironmentValues.py index d94bf3a..6599196 100644 --- a/src/engine/SCons/EnvironmentValues.py +++ b/src/engine/SCons/EnvironmentValues.py @@ -3,7 +3,7 @@ import re _is_valid_var = re.compile(r'[_a-zA-Z]\w*$') _rm = re.compile(r'\$[()]') -_remove = re.compile(r'\$\([^\$]*(\$[^\)][^\$]*)*\$\)') +_remove = re.compile(r'\$\([^$]*(\$[^)][^$]*)*\$\)') # Regular expressions for splitting strings and handling substitutions, # for use by the scons_subst() and scons_subst_list() functions: @@ -28,7 +28,7 @@ _remove = re.compile(r'\$\([^\$]*(\$[^\)][^\$]*)*\$\)') # _dollar_exps_str = r'\$[\$\(\)]|\$[_a-zA-Z][\.\w]*|\${[^}]*}' _dollar_exps = re.compile(r'(%s)' % _dollar_exps_str) -_separate_args = re.compile(r'(%s|\s+|[^\s\$]+|\$)' % _dollar_exps_str) +_separate_args = re.compile(r'(%s|\s+|[^\s$]+|\$)' % _dollar_exps_str) # This regular expression is used to replace strings of multiple white # space characters in the string result from the scons_subst() function. diff --git a/src/engine/SCons/JobTests.py b/src/engine/SCons/JobTests.py index 26e3d37..2e3af4f 100644 --- a/src/engine/SCons/JobTests.py +++ b/src/engine/SCons/JobTests.py @@ -46,7 +46,7 @@ def get_cpu_nums(): return int( os.popen2( "sysctl -n hw.ncpu")[1].read() ) # Windows: if "NUMBER_OF_PROCESSORS" in os.environ: - ncpus = int( os.environ[ "NUMBER_OF_PROCESSORS" ] ); + ncpus = int(os.environ["NUMBER_OF_PROCESSORS"]) if ncpus > 0: return ncpus return 1 # Default @@ -59,14 +59,14 @@ num_jobs = get_cpu_nums()*2 # in case we werent able to detect num cpus for this test # just make a hardcoded suffcient large number, though not future proof -if(num_jobs == 2): +if num_jobs == 2: num_jobs = 33 # how many tasks to perform for the test num_tasks = num_jobs*5 class DummyLock(object): - "fake lock class to use if threads are not supported" + """fake lock class to use if threads are not supported""" def acquire(self): pass @@ -74,7 +74,7 @@ class DummyLock(object): pass class NoThreadsException(Exception): - "raised by the ParallelTestCase if threads are not supported" + """raised by the ParallelTestCase if threads are not supported""" def __str__(self): return "the interpreter doesn't support threads" @@ -113,7 +113,7 @@ class Task(object): # check if task was executing while another was also executing for j in range(1, self.taskmaster.num_tasks): - if(self.taskmaster.parallel_list[j+1] == 1): + if self.taskmaster.parallel_list[j + 1] == 1: self.taskmaster.found_parallel = True break @@ -237,7 +237,7 @@ class Taskmaster(object): return self.num_postprocessed == self.num_tasks def tasks_were_serial(self): - "analyze the task order to see if they were serial" + """analyze the task order to see if they were serial""" return not self.found_parallel def exception_set(self): @@ -251,7 +251,7 @@ ThreadPoolCallList = [] class ParallelTestCase(unittest.TestCase): def runTest(self): - "test parallel jobs" + """test parallel jobs""" try: import threading @@ -319,7 +319,7 @@ class ParallelTestCase(unittest.TestCase): class SerialTestCase(unittest.TestCase): def runTest(self): - "test a serial job" + """test a serial job""" taskmaster = Taskmaster(num_tasks, self, RandomTask) jobs = SCons.Job.Jobs(1, taskmaster) @@ -338,7 +338,7 @@ class SerialTestCase(unittest.TestCase): class NoParallelTestCase(unittest.TestCase): def runTest(self): - "test handling lack of parallel support" + """test handling lack of parallel support""" def NoParallel(tm, num, stack_size): raise NameError save_Parallel = SCons.Job.Parallel @@ -365,7 +365,7 @@ class NoParallelTestCase(unittest.TestCase): class SerialExceptionTestCase(unittest.TestCase): def runTest(self): - "test a serial job with tasks that raise exceptions" + """test a serial job with tasks that raise exceptions""" taskmaster = Taskmaster(num_tasks, self, ExceptionTask) jobs = SCons.Job.Jobs(1, taskmaster) @@ -382,7 +382,7 @@ class SerialExceptionTestCase(unittest.TestCase): class ParallelExceptionTestCase(unittest.TestCase): def runTest(self): - "test parallel jobs with tasks that raise exceptions" + """test parallel jobs with tasks that raise exceptions""" taskmaster = Taskmaster(num_tasks, self, ExceptionTask) jobs = SCons.Job.Jobs(num_jobs, taskmaster) @@ -534,13 +534,13 @@ class _SConsTaskTest(unittest.TestCase): class SerialTaskTest(_SConsTaskTest): def runTest(self): - "test serial jobs with actual Taskmaster and Task" + """test serial jobs with actual Taskmaster and Task""" self._test_seq(1) class ParallelTaskTest(_SConsTaskTest): def runTest(self): - "test parallel jobs with actual Taskmaster and Task" + """test parallel jobs with actual Taskmaster and Task""" self._test_seq(num_jobs) diff --git a/src/engine/SCons/Node/Alias.py b/src/engine/SCons/Node/Alias.py index a035816..55d94f9 100644 --- a/src/engine/SCons/Node/Alias.py +++ b/src/engine/SCons/Node/Alias.py @@ -37,6 +37,7 @@ import collections import SCons.Errors import SCons.Node import SCons.Util +from SCons.Util import MD5signature class AliasNameSpace(collections.UserDict): def Alias(self, name, **kw): @@ -166,7 +167,7 @@ class Alias(SCons.Node.Node): pass contents = self.get_contents() - csig = SCons.Util.MD5signature(contents) + csig = MD5signature(contents) self.get_ninfo().csig = csig return csig diff --git a/src/engine/SCons/Node/FS.py b/src/engine/SCons/Node/FS.py index 4c68358..e1d6f68 100644 --- a/src/engine/SCons/Node/FS.py +++ b/src/engine/SCons/Node/FS.py @@ -54,6 +54,7 @@ import SCons.Node import SCons.Node.Alias import SCons.Subst import SCons.Util +from SCons.Util import MD5signature, MD5filesignature, MD5collect import SCons.Warnings from SCons.Debug import Trace @@ -1862,7 +1863,7 @@ class Dir(Base): node is called which has a child directory, the child directory should return the hash of its contents.""" contents = self.get_contents() - return SCons.Util.MD5signature(contents) + return MD5signature(contents) def do_duplicate(self, src): pass @@ -2501,14 +2502,14 @@ class FileBuildInfo(SCons.Node.BuildInfoBase): Attributes unique to FileBuildInfo: dependency_map : Caches file->csig mapping - for all dependencies. Currently this is only used when using - MD5-timestamp decider. - It's used to ensure that we copy the correct - csig from previous build to be written to .sconsign when current build - is done. Previously the matching of csig to file was strictly by order - they appeared in bdepends, bsources, or bimplicit, and so a change in order - or count of any of these could yield writing wrong csig, and then false positive - rebuilds + for all dependencies. Currently this is only used when using + MD5-timestamp decider. + It's used to ensure that we copy the correct csig from the + previous build to be written to .sconsign when current build + is done. Previously the matching of csig to file was strictly + by order they appeared in bdepends, bsources, or bimplicit, + and so a change in order or count of any of these could + yield writing wrong csig, and then false positive rebuilds """ __slots__ = ['dependency_map', ] current_version_id = 2 @@ -2723,11 +2724,10 @@ class File(Base): Compute and return the MD5 hash for this file. """ if not self.rexists(): - return SCons.Util.MD5signature('') + return MD5signature('') fname = self.rfile().get_abspath() try: - cs = SCons.Util.MD5filesignature(fname, - chunksize=SCons.Node.FS.File.md5_chunksize*1024) + cs = MD5filesignature(fname, chunksize=File.md5_chunksize * 1024) except EnvironmentError as e: if not e.filename: e.filename = fname @@ -3028,7 +3028,7 @@ class File(Base): @see: built() and Node.release_target_info() """ - if (self.released_target_info or SCons.Node.interactive): + if self.released_target_info or SCons.Node.interactive: return if not hasattr(self.attributes, 'keep_targetinfo'): @@ -3210,7 +3210,7 @@ class File(Base): if csig is None: try: - if self.get_size() < SCons.Node.FS.File.md5_chunksize: + if self.get_size() < File.md5_chunksize: contents = self.get_contents() else: csig = self.get_content_hash() @@ -3312,7 +3312,7 @@ class File(Base): # For an "empty" binfo properties like bsources # do not exist: check this to avoid exception. - if (len(binfo.bsourcesigs) + len(binfo.bdependsigs) + \ + if (len(binfo.bsourcesigs) + len(binfo.bdependsigs) + len(binfo.bimplicitsigs)) == 0: return {} @@ -3580,7 +3580,7 @@ class File(Base): node = repo_dir.file_on_disk(self.name) if node and node.exists() and \ - (isinstance(node, File) or isinstance(node, Entry) \ + (isinstance(node, File) or isinstance(node, Entry) or not node.is_derived()): retvals.append(node) @@ -3611,8 +3611,7 @@ class File(Base): cachedir, cachefile = self.get_build_env().get_CacheDir().cachepath(self) if not self.exists() and cachefile and os.path.exists(cachefile): - self.cachedir_csig = SCons.Util.MD5filesignature(cachefile, \ - SCons.Node.FS.File.md5_chunksize * 1024) + self.cachedir_csig = MD5filesignature(cachefile, File.md5_chunksize * 1024) else: self.cachedir_csig = self.get_csig() return self.cachedir_csig @@ -3632,7 +3631,7 @@ class File(Base): executor = self.get_executor() - result = self.contentsig = SCons.Util.MD5signature(executor.get_contents()) + result = self.contentsig = MD5signature(executor.get_contents()) return result def get_cachedir_bsig(self): @@ -3663,7 +3662,7 @@ class File(Base): sigs.append(self.get_internal_path()) # Merge this all into a single signature - result = self.cachesig = SCons.Util.MD5collect(sigs) + result = self.cachesig = MD5collect(sigs) return result default_fs = None diff --git a/src/engine/SCons/Node/NodeTests.py b/src/engine/SCons/Node/NodeTests.py index 678e03e..d8179ff 100644 --- a/src/engine/SCons/Node/NodeTests.py +++ b/src/engine/SCons/Node/NodeTests.py @@ -1304,7 +1304,7 @@ class NodeTestCase(unittest.TestCase): def test_postprocess(self): """Test calling the base Node postprocess() method""" n = SCons.Node.Node() - n.waiting_parents = set( ['foo','bar'] ) + n.waiting_parents = {'foo', 'bar'} n.postprocess() assert n.waiting_parents == set(), n.waiting_parents @@ -1316,7 +1316,7 @@ class NodeTestCase(unittest.TestCase): assert n1.waiting_parents == set(), n1.waiting_parents r = n1.add_to_waiting_parents(n2) assert r == 1, r - assert n1.waiting_parents == set((n2,)), n1.waiting_parents + assert n1.waiting_parents == {n2}, n1.waiting_parents r = n1.add_to_waiting_parents(n2) assert r == 0, r diff --git a/src/engine/SCons/Node/__init__.py b/src/engine/SCons/Node/__init__.py index daf79ba..0b58282 100644 --- a/src/engine/SCons/Node/__init__.py +++ b/src/engine/SCons/Node/__init__.py @@ -60,6 +60,7 @@ from SCons.Debug import logInstanceCreation import SCons.Executor import SCons.Memoize import SCons.Util +from SCons.Util import MD5signature from SCons.Debug import Trace @@ -1167,7 +1168,7 @@ class Node(object, with_metaclass(NoSlotsPyPy)): if self.has_builder(): binfo.bact = str(executor) - binfo.bactsig = SCons.Util.MD5signature(executor.get_contents()) + binfo.bactsig = MD5signature(executor.get_contents()) if self._specific_sources: sources = [s for s in self.sources if s not in ignore_set] @@ -1205,7 +1206,7 @@ class Node(object, with_metaclass(NoSlotsPyPy)): return self.ninfo.csig except AttributeError: ninfo = self.get_ninfo() - ninfo.csig = SCons.Util.MD5signature(self.get_contents()) + ninfo.csig = MD5signature(self.get_contents()) return self.ninfo.csig def get_cachedir_csig(self): @@ -1496,7 +1497,7 @@ class Node(object, with_metaclass(NoSlotsPyPy)): if self.has_builder(): contents = self.get_executor().get_contents() - newsig = SCons.Util.MD5signature(contents) + newsig = MD5signature(contents) if bi.bactsig != newsig: if t: Trace(': bactsig %s != newsig %s' % (bi.bactsig, newsig)) result = True diff --git a/src/engine/SCons/PathListTests.py b/src/engine/SCons/PathListTests.py index b5989bb..104be73 100644 --- a/src/engine/SCons/PathListTests.py +++ b/src/engine/SCons/PathListTests.py @@ -108,7 +108,7 @@ class subst_pathTestCase(unittest.TestCase): self.env.subst = lambda s, target, source, conv: 'NOT THIS STRING' - pl = SCons.PathList.PathList(('x')) + pl = SCons.PathList.PathList(('x',)) result = pl.subst_path(self.env, 'y', 'z') diff --git a/src/engine/SCons/Platform/virtualenv.py b/src/engine/SCons/Platform/virtualenv.py index 4127d8c..4708cb2 100644 --- a/src/engine/SCons/Platform/virtualenv.py +++ b/src/engine/SCons/Platform/virtualenv.py @@ -61,7 +61,7 @@ def _is_path_in(path, base): if not path or not base: # empty path may happen, base too return False rp = os.path.relpath(path, base) - return ((not rp.startswith(os.path.pardir)) and (not rp == os.path.curdir)) + return (not rp.startswith(os.path.pardir)) and (not rp == os.path.curdir) def _inject_venv_variables(env): diff --git a/src/engine/SCons/SConf.py b/src/engine/SCons/SConf.py index 0195ac4..e706dae 100644 --- a/src/engine/SCons/SConf.py +++ b/src/engine/SCons/SConf.py @@ -270,7 +270,7 @@ class SConfBuildTask(SCons.Taskmaster.AlwaysTask): cached_error = False cachable = True for t in self.targets: - if T: Trace('%s' % (t)) + if T: Trace('%s' % t) bi = t.get_stored_info().binfo if isinstance(bi, SConfBuildInfo): if T: Trace(': SConfBuildInfo') @@ -280,7 +280,7 @@ class SConfBuildTask(SCons.Taskmaster.AlwaysTask): else: if T: Trace(': get_state() %s' % t.get_state()) if T: Trace(': changed() %s' % t.changed()) - if (t.get_state() != SCons.Node.up_to_date and t.changed()): + if t.get_state() != SCons.Node.up_to_date and t.changed(): changed = True if T: Trace(': changed %s' % changed) cached_error = cached_error or bi.result @@ -668,7 +668,7 @@ class SConfBase(object): is saved in self.lastTarget (for further processing). """ ok = self.TryLink(text, extension) - if( ok ): + if ok: prog = self.lastTarget pname = prog.get_internal_path() output = self.confdir.File(os.path.basename(pname)+'.out') @@ -866,9 +866,9 @@ class CheckContext(object): return self.sconf.TryRun(*args, **kw) def __getattr__( self, attr ): - if( attr == 'env' ): + if attr == 'env': return self.sconf.env - elif( attr == 'lastTarget' ): + elif attr == 'lastTarget': return self.sconf.lastTarget else: raise AttributeError("CheckContext instance has no attribute '%s'" % attr) diff --git a/src/engine/SCons/SConfTests.py b/src/engine/SCons/SConfTests.py index 787138e..c5d1fbd 100644 --- a/src/engine/SCons/SConfTests.py +++ b/src/engine/SCons/SConfTests.py @@ -151,7 +151,7 @@ class SConfTestCase(unittest.TestCase): log_file=self.test.workpath('config.log')) no_std_header_h = self.test.workpath('config.tests', 'no_std_header.h') test_h = self.test.write( no_std_header_h, - "/* we are changing a dependency now */\n" ); + "/* we are changing a dependency now */\n" ) try: res = checks( self, sconf, TryFunc ) log = self.test.read( self.test.workpath('config.log') ) diff --git a/src/engine/SCons/Script/Main.py b/src/engine/SCons/Script/Main.py index 238a828..f9c8384 100644 --- a/src/engine/SCons/Script/Main.py +++ b/src/engine/SCons/Script/Main.py @@ -355,7 +355,7 @@ class CleanTask(SCons.Taskmaster.AlwaysTask): display("Removed directory " + pathstr) else: errstr = "Path '%s' exists but isn't a file or directory." - raise SCons.Errors.UserError(errstr % (pathstr)) + raise SCons.Errors.UserError(errstr % pathstr) except SCons.Errors.UserError as e: print(e) except (IOError, OSError) as e: diff --git a/src/engine/SCons/Script/SConsOptions.py b/src/engine/SCons/Script/SConsOptions.py index 66c7239..8ec8ccf 100644 --- a/src/engine/SCons/Script/SConsOptions.py +++ b/src/engine/SCons/Script/SConsOptions.py @@ -28,7 +28,7 @@ import re import sys import textwrap -no_hyphen_re = re.compile(r'(\s+|(?<=[\w\!\"\'\&\.\,\?])-{2,}(?=\w))') +no_hyphen_re = re.compile(r'(\s+|(?<=[\w!\"\'&.,?])-{2,}(?=\w))') try: from gettext import gettext diff --git a/src/engine/SCons/Subst.py b/src/engine/SCons/Subst.py index f3693a1..664cd6c 100644 --- a/src/engine/SCons/Subst.py +++ b/src/engine/SCons/Subst.py @@ -754,7 +754,7 @@ _list_remove = [ _rm_list, None, _remove_list ] # _dollar_exps_str = r'\$[\$\(\)]|\$[_a-zA-Z][\.\w]*|\${[^}]*}' _dollar_exps = re.compile(r'(%s)' % _dollar_exps_str) -_separate_args = re.compile(r'(%s|\s+|[^\s\$]+|\$)' % _dollar_exps_str) +_separate_args = re.compile(r'(%s|\s+|[^\s$]+|\$)' % _dollar_exps_str) # This regular expression is used to replace strings of multiple white # space characters in the string result from the scons_subst() function. diff --git a/src/engine/SCons/SubstTests.py b/src/engine/SCons/SubstTests.py index f6fe1ec..c25b377 100644 --- a/src/engine/SCons/SubstTests.py +++ b/src/engine/SCons/SubstTests.py @@ -133,8 +133,8 @@ class SubstTestCase(unittest.TestCase): return self.value # only use of this is currently commented out below - def function_foo(arg): - pass + #def function_foo(arg): + # pass target = [ MyNode("./foo/bar.exe"), MyNode("/bar/baz with spaces.obj"), @@ -207,7 +207,7 @@ class SubstTestCase(unittest.TestCase): 'S' : 'x y', 'LS' : ['x y'], 'L' : ['x', 'y'], - 'TS' : ('x y'), + 'TS' : ('x y',), 'T' : ('x', 'y'), 'CS' : cs, 'CL' : cl, diff --git a/src/engine/SCons/Tool/JavaCommon.py b/src/engine/SCons/Tool/JavaCommon.py index a7e247d..1711de1 100644 --- a/src/engine/SCons/Tool/JavaCommon.py +++ b/src/engine/SCons/Tool/JavaCommon.py @@ -40,7 +40,7 @@ default_java_version = '1.4' # a switch for which jdk versions to use the Scope state for smarter # anonymous inner class parsing. -scopeStateVersions = ('1.8') +scopeStateVersions = ('1.8',) # Glob patterns for use in finding where the JDK is. # These are pairs, *dir_glob used in the general case, @@ -87,8 +87,8 @@ if java_parsing: # any alphanumeric token surrounded by angle brackets (generics); # the multi-line comment begin and end tokens /* and */; # array declarations "[]". - _reToken = re.compile(r'(\n|\\\\|//|\\[\'"]|[\'"\{\}\;\.\(\)]|' + - r'\d*\.\d*|[A-Za-z_][\w\$\.]*|<[A-Za-z_]\w+>|' + + _reToken = re.compile(r'(\n|\\\\|//|\\[\'"]|[\'"{\};.()]|' + + r'\d*\.\d*|[A-Za-z_][\w$.]*|<[A-Za-z_]\w+>|' + r'/\*|\*/|\[\])') diff --git a/src/engine/SCons/Tool/MSCommon/sdk.py b/src/engine/SCons/Tool/MSCommon/sdk.py index 281c1e3..9627f17 100644 --- a/src/engine/SCons/Tool/MSCommon/sdk.py +++ b/src/engine/SCons/Tool/MSCommon/sdk.py @@ -110,12 +110,12 @@ class SDKDefinition(object): """ Return the script to initialize the VC compiler installed by SDK """ - if (host_arch == 'amd64' and target_arch == 'x86'): + if host_arch == 'amd64' and target_arch == 'x86': # No cross tools needed compiling 32 bits on 64 bit machine host_arch=target_arch arch_string=target_arch - if (host_arch != target_arch): + if host_arch != target_arch: arch_string='%s_%s'%(host_arch,target_arch) debug("get_sdk_vc_script():arch_string:%s host_arch:%s target_arch:%s"%(arch_string, diff --git a/src/engine/SCons/Tool/MSCommon/vc.py b/src/engine/SCons/Tool/MSCommon/vc.py index 53b9d59..6f9bd12 100644 --- a/src/engine/SCons/Tool/MSCommon/vc.py +++ b/src/engine/SCons/Tool/MSCommon/vc.py @@ -766,12 +766,12 @@ def msvc_find_valid_batch_script(env, version): vc_script=None continue if not vc_script and sdk_script: - debug('msvc_find_valid_batch_script() use_script 4: trying sdk script: %s'%(sdk_script)) + debug('msvc_find_valid_batch_script() use_script 4: trying sdk script: %s' % sdk_script) try: d = script_env(sdk_script) found = sdk_script except BatchFileExecutionError as e: - debug('msvc_find_valid_batch_script() use_script 5: failed running SDK script %s: Error:%s'%(repr(sdk_script),e)) + debug('msvc_find_valid_batch_script() use_script 5: failed running SDK script %s: Error:%s'%(repr(sdk_script), e)) continue elif not vc_script and not sdk_script: debug('msvc_find_valid_batch_script() use_script 6: Neither VC script nor SDK script found') diff --git a/src/engine/SCons/Tool/__init__.py b/src/engine/SCons/Tool/__init__.py index f255b21..14306ab 100644 --- a/src/engine/SCons/Tool/__init__.py +++ b/src/engine/SCons/Tool/__init__.py @@ -774,11 +774,11 @@ def EmitLibSymlinks(env, symlinks, libnode, **kw): for link, linktgt in symlinks: env.SideEffect(link, linktgt) - if (Verbose): + if Verbose: print("EmitLibSymlinks: SideEffect(%r,%r)" % (link.get_path(), linktgt.get_path())) clean_list = [x for x in nodes if x != linktgt] env.Clean(list(set([linktgt] + clean_targets)), clean_list) - if (Verbose): + if Verbose: print("EmitLibSymlinks: Clean(%r,%r)" % (linktgt.get_path(), [x.get_path() for x in clean_list])) @@ -792,18 +792,18 @@ def CreateLibSymlinks(env, symlinks): for link, linktgt in symlinks: linktgt = link.get_dir().rel_path(linktgt) link = link.get_path() - if (Verbose): + if Verbose: print("CreateLibSymlinks: preparing to add symlink %r -> %r" % (link, linktgt)) # Delete the (previously created) symlink if exists. Let only symlinks # to be deleted to prevent accidental deletion of source files... if env.fs.islink(link): env.fs.unlink(link) - if (Verbose): + if Verbose: print("CreateLibSymlinks: removed old symlink %r" % link) # If a file or directory exists with the same name as link, an OSError # will be thrown, which should be enough, I think. env.fs.symlink(linktgt, link) - if (Verbose): + if Verbose: print("CreateLibSymlinks: add symlink %r -> %r" % (link, linktgt)) return 0 diff --git a/src/engine/SCons/Tool/docbook/__init__.py b/src/engine/SCons/Tool/docbook/__init__.py index b93d916..c4fdfba 100644 --- a/src/engine/SCons/Tool/docbook/__init__.py +++ b/src/engine/SCons/Tool/docbook/__init__.py @@ -135,7 +135,7 @@ def __get_xml_text(root): """ Return the text for the given root node (xml.dom.minidom). """ txt = "" for e in root.childNodes: - if (e.nodeType == e.TEXT_NODE): + if e.nodeType == e.TEXT_NODE: txt += e.data return txt @@ -207,7 +207,7 @@ def _detect(env): if env.get('DOCBOOK_PREFER_XSLTPROC',''): prefer_xsltproc = True - if ((not has_libxml2 and not has_lxml) or (prefer_xsltproc)): + if (not has_libxml2 and not has_lxml) or prefer_xsltproc: # Try to find the XSLT processors __detect_cl_tool(env, 'DOCBOOK_XSLTPROC', xsltproc_com, xsltproc_com_priority) __detect_cl_tool(env, 'DOCBOOK_XMLLINT', xmllint_com) diff --git a/src/engine/SCons/Tool/docbook/docbook-xsl-1.76.1/extensions/docbook.py b/src/engine/SCons/Tool/docbook/docbook-xsl-1.76.1/extensions/docbook.py index 5d2de3e..de1375d 100644 --- a/src/engine/SCons/Tool/docbook/docbook-xsl-1.76.1/extensions/docbook.py +++ b/src/engine/SCons/Tool/docbook/docbook-xsl-1.76.1/extensions/docbook.py @@ -34,9 +34,9 @@ def adjustColumnWidths(ctx, nodeset): # Get the nominal table width varString = lookupVariable(tctxt, "nominal.table.width", None) if varString is None: - nominalWidth = 6 * pixelsPerInch; + nominalWidth = 6 * pixelsPerInch else: - nominalWidth = convertLength(varString); + nominalWidth = convertLength(varString) # Get the requested table width tableWidth = lookupVariable(tctxt, "table.width", "100%") @@ -161,7 +161,7 @@ def convertLength(length): global pixelsPerInch global unitHash - m = re.search('([+-]?[\d\.]+)(\S+)', length) + m = re.search('([+-]?[\d.]+)(\S+)', length) if m is not None and m.lastindex > 1: unit = pixelsPerInch if m.group(2) in unitHash: diff --git a/src/engine/SCons/Tool/docbook/docbook-xsl-1.76.1/extensions/xslt.py b/src/engine/SCons/Tool/docbook/docbook-xsl-1.76.1/extensions/xslt.py index 77ca0de..d5529b8 100644 --- a/src/engine/SCons/Tool/docbook/docbook-xsl-1.76.1/extensions/xslt.py +++ b/src/engine/SCons/Tool/docbook/docbook-xsl-1.76.1/extensions/xslt.py @@ -36,7 +36,7 @@ try: outfile = None count = 4 - while (sys.argv[count]): + while sys.argv[count]: try: name, value = sys.argv[count].split("=", 2) if name in params: diff --git a/src/engine/SCons/Tool/intelc.py b/src/engine/SCons/Tool/intelc.py index 7550c34..5a101b4 100644 --- a/src/engine/SCons/Tool/intelc.py +++ b/src/engine/SCons/Tool/intelc.py @@ -318,7 +318,7 @@ def get_intel_compiler_top(version, abi): if not os.path.exists(os.path.join(top, "Bin", "icl.exe")) \ and not os.path.exists(os.path.join(top, "Bin", abi, "icl.exe")) \ and not os.path.exists(os.path.join(top, "Bin", archdir, "icl.exe")): - raise MissingDirError("Can't find Intel compiler in %s"%(top)) + raise MissingDirError("Can't find Intel compiler in %s" % top) elif is_mac or is_linux: def find_in_2008style_dir(version): # first dir is new (>=9.0) style, second is old (8.0) style. diff --git a/src/engine/SCons/Tool/jar.py b/src/engine/SCons/Tool/jar.py index e75fa13..502aa60 100644 --- a/src/engine/SCons/Tool/jar.py +++ b/src/engine/SCons/Tool/jar.py @@ -158,7 +158,7 @@ def Jar(env, target = None, source = [], *args, **kw): # files. def dir_to_class(s): dir_targets = env.JavaClassDir(source = s, *args, **kw) - if(dir_targets == []): + if dir_targets == []: # no classes files could be built from the source dir # so pass the dir as is. return [env.fs.Dir(s)] diff --git a/src/engine/SCons/Tool/javah.py b/src/engine/SCons/Tool/javah.py index 80f8a6b..fbfcbe2 100644 --- a/src/engine/SCons/Tool/javah.py +++ b/src/engine/SCons/Tool/javah.py @@ -115,7 +115,7 @@ def getJavaHClassPath(env,target, source, for_signature): path = "${SOURCE.attributes.java_classdir}" if 'JAVACLASSPATH' in env and env['JAVACLASSPATH']: path = SCons.Util.AppendPath(path, env['JAVACLASSPATH']) - return "-classpath %s" % (path) + return "-classpath %s" % path def generate(env): """Add Builders and construction variables for javah to an Environment.""" diff --git a/src/engine/SCons/Tool/mslink.py b/src/engine/SCons/Tool/mslink.py index 0fa6454..fc5f009 100644 --- a/src/engine/SCons/Tool/mslink.py +++ b/src/engine/SCons/Tool/mslink.py @@ -220,7 +220,7 @@ def embedManifestDllCheck(target, source, env): if env.get('WINDOWS_EMBED_MANIFEST', 0): manifestSrc = target[0].get_abspath() + '.manifest' if os.path.exists(manifestSrc): - ret = (embedManifestDllAction) ([target[0]],None,env) + ret = embedManifestDllAction([target[0]], None, env) if ret: raise SCons.Errors.UserError("Unable to embed manifest into %s" % (target[0])) return ret @@ -234,7 +234,7 @@ def embedManifestExeCheck(target, source, env): if env.get('WINDOWS_EMBED_MANIFEST', 0): manifestSrc = target[0].get_abspath() + '.manifest' if os.path.exists(manifestSrc): - ret = (embedManifestExeAction) ([target[0]],None,env) + ret = embedManifestExeAction([target[0]], None, env) if ret: raise SCons.Errors.UserError("Unable to embed manifest into %s" % (target[0])) return ret diff --git a/src/engine/SCons/Tool/msvs.py b/src/engine/SCons/Tool/msvs.py index 7dca9e1..929e558 100644 --- a/src/engine/SCons/Tool/msvs.py +++ b/src/engine/SCons/Tool/msvs.py @@ -172,9 +172,9 @@ def makeHierarchy(sources): return hierarchy class _UserGenerator(object): - ''' + """ Base class for .dsp.user file generator - ''' + """ # Default instance values. # Ok ... a bit defensive, but it does not seem reasonable to crash the # build for a workspace user file. :-) @@ -980,7 +980,7 @@ class _GenerateV7DSP(_DSPGenerator, _GenerateV7User): if SCons.Util.is_Dict(value): self.file.write('\t\t\t\n' % (key)) + '\t\t\t\tFilter="">\n' % key) self.printSources(value, commonprefix) self.file.write('\t\t\t\n') @@ -992,7 +992,7 @@ class _GenerateV7DSP(_DSPGenerator, _GenerateV7User): file = os.path.normpath(file) self.file.write('\t\t\t\n' - '\t\t\t\n' % (file)) + '\t\t\t\n' % file) def PrintSourceFiles(self): categories = {'Source Files': 'cpp;c;cxx;l;y;def;odl;idl;hpj;bat', @@ -2047,17 +2047,17 @@ def generate(env): (version_num, suite) = (7.0, None) # guess at a default if 'MSVS' not in env: env['MSVS'] = {} - if (version_num < 7.0): + if version_num < 7.0: env['MSVS']['PROJECTSUFFIX'] = '.dsp' env['MSVS']['SOLUTIONSUFFIX'] = '.dsw' - elif (version_num < 10.0): + elif version_num < 10.0: env['MSVS']['PROJECTSUFFIX'] = '.vcproj' env['MSVS']['SOLUTIONSUFFIX'] = '.sln' else: env['MSVS']['PROJECTSUFFIX'] = '.vcxproj' env['MSVS']['SOLUTIONSUFFIX'] = '.sln' - if (version_num >= 10.0): + if version_num >= 10.0: env['MSVSENCODING'] = 'utf-8' else: env['MSVSENCODING'] = 'Windows-1252' diff --git a/src/engine/SCons/Tool/packaging/msi.py b/src/engine/SCons/Tool/packaging/msi.py index 34e4f0f..9f28b72 100644 --- a/src/engine/SCons/Tool/packaging/msi.py +++ b/src/engine/SCons/Tool/packaging/msi.py @@ -182,7 +182,7 @@ def generate_guids(root): def string_wxsfile(target, source, env): - return "building WiX file %s"%( target[0].path ) + return "building WiX file %s" % target[0].path def build_wxsfile(target, source, env): """ Compiles a .wxs file from the keywords given in env['msi_spec'] and diff --git a/src/engine/SCons/Tool/tex.py b/src/engine/SCons/Tool/tex.py index 5cf7bca..fa18cf9 100644 --- a/src/engine/SCons/Tool/tex.py +++ b/src/engine/SCons/Tool/tex.py @@ -204,7 +204,7 @@ def InternalLaTeXAuxAction(XXXLaTeXAction, target = None, source= None, env=None # with LaTeXAction and from the pdflatex.py with PDFLaTeXAction # set this up now for the case where the user requests a different extension # for the target filename - if (XXXLaTeXAction == LaTeXAction): + if XXXLaTeXAction == LaTeXAction: callerSuffix = ".dvi" else: callerSuffix = env['PDFSUFFIX'] @@ -283,7 +283,7 @@ def InternalLaTeXAuxAction(XXXLaTeXAction, target = None, source= None, env=None count = 0 - while (must_rerun_latex and count < int(env.subst('$LATEXRETRIES'))) : + while must_rerun_latex and count < int(env.subst('$LATEXRETRIES')): result = XXXLaTeXAction(target, source, env) if result != 0: return result @@ -461,7 +461,7 @@ def InternalLaTeXAuxAction(XXXLaTeXAction, target = None, source= None, env=None if Verbose: print("rerun Latex due to undefined references or citations") - if (count >= int(env.subst('$LATEXRETRIES')) and must_rerun_latex): + if count >= int(env.subst('$LATEXRETRIES')) and must_rerun_latex: print("reached max number of retries on Latex ,",int(env.subst('$LATEXRETRIES'))) # end of while loop @@ -861,7 +861,7 @@ def generate_darwin(env): environ = {} env['ENV'] = environ - if (platform.system() == 'Darwin'): + if platform.system() == 'Darwin': try: ospath = env['ENV']['PATHOSX'] except: diff --git a/src/engine/SCons/Tool/xgettext.py b/src/engine/SCons/Tool/xgettext.py index 936924b..11ca32f 100644 --- a/src/engine/SCons/Tool/xgettext.py +++ b/src/engine/SCons/Tool/xgettext.py @@ -133,7 +133,7 @@ def _update_pot_file(target, source, env): re_cdate = re.compile(r'^"POT-Creation-Date: .*"$[\r\n]?', re.M) old_content_nocdate = re.sub(re_cdate, "", old_content) new_content_nocdate = re.sub(re_cdate, "", new_content) - if (old_content_nocdate == new_content_nocdate): + if old_content_nocdate == new_content_nocdate: # Messages are up-to-date needs_update = False explain = "messages in file found to be up-to-date" diff --git a/src/engine/SCons/Util.py b/src/engine/SCons/Util.py index 28674d1..4b4ead5 100644 --- a/src/engine/SCons/Util.py +++ b/src/engine/SCons/Util.py @@ -392,7 +392,7 @@ except NameError: try: BaseStringTypes = (str, unicode) except NameError: - BaseStringTypes = (str) + BaseStringTypes = str def is_Dict(obj, isinstance=isinstance, DictTypes=DictTypes): return isinstance(obj, DictTypes) diff --git a/src/engine/SCons/dblite.py b/src/engine/SCons/dblite.py index 14bd93d..55254b3 100644 --- a/src/engine/SCons/dblite.py +++ b/src/engine/SCons/dblite.py @@ -131,9 +131,10 @@ class dblite(object): # Note how we catch KeyErrors too here, which might happen # when we don't have cPickle available (default pickle # throws it). - if (ignore_corrupt_dbfiles == 0): raise - if (ignore_corrupt_dbfiles == 1): + if ignore_corrupt_dbfiles: corruption_warning(self._file_name) + else: + raise def close(self): if self._needs_sync: @@ -166,13 +167,13 @@ class dblite(object): except OSError: pass self._needs_sync = 00000 - if (keep_all_files): + if keep_all_files: self._shutil_copyfile( self._file_name, self._file_name + "_" + str(int(self._time_time()))) def _check_writable(self): - if (self._flag == "r"): + if self._flag == "r": raise IOError("Read-only database: %s" % self._file_name) def __getitem__(self, key): @@ -180,9 +181,9 @@ class dblite(object): def __setitem__(self, key, value): self._check_writable() - if (not is_string(key)): + if not is_string(key): raise TypeError("key `%s' must be a string but is %s" % (key, type(key))) - if (not is_bytes(value)): + if not is_bytes(value): raise TypeError("value `%s' must be a bytes but is %s" % (value, type(value))) self._dict[key] = value self._needs_sync = 0o001 @@ -280,7 +281,7 @@ def _exercise(): raise RuntimeError("IOError expected.") -if (__name__ == "__main__"): +if __name__ == "__main__": _exercise() # Local Variables: diff --git a/src/script/scons-configure-cache.py b/src/script/scons-configure-cache.py index 3c096e1..a687c9c 100644 --- a/src/script/scons-configure-cache.py +++ b/src/script/scons-configure-cache.py @@ -23,13 +23,13 @@ # OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION # WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -'''Show or convert the configuration of an SCons cache directory. +"""Show or convert the configuration of an SCons cache directory. A cache of derived files is stored by file signature. The files are split into directories named by the first few digits of the signature. The prefix length used for directory names can be changed by this script. -''' +""" from __future__ import print_function import argparse @@ -51,11 +51,11 @@ __developer__ = "__DEVELOPER__" def rearrange_cache_entries(current_prefix_len, new_prefix_len): - '''Move cache files if prefix length changed. + """Move cache files if prefix length changed. Move the existing cache files to new directories of the appropriate name length and clean up the old directories. - ''' + """ print('Changing prefix length from', current_prefix_len, 'to', new_prefix_len) dirs = set() diff --git a/src/script/scons-time.py b/src/script/scons-time.py index 62d2784..91a105b 100644 --- a/src/script/scons-time.py +++ b/src/script/scons-time.py @@ -625,7 +625,7 @@ class SConsTimer(object): if not contents: sys.stderr.write('file %s has no contents!\n' % repr(file)) return None - result = re.findall(r'%s: ([\d\.]*)' % search_string, contents)[-4:] + result = re.findall(r'%s: ([\d.]*)' % search_string, contents)[-4:] result = [ float(r) for r in result ] if time_string is not None: try: diff --git a/src/script/sconsign.py b/src/script/sconsign.py index c7050bc..593c536 100644 --- a/src/script/sconsign.py +++ b/src/script/sconsign.py @@ -524,7 +524,7 @@ def Do_SConsignDir(name): except KeyboardInterrupt: raise except pickle.UnpicklingError: - err = "sconsign: ignoring invalid .sconsign file `%s'\n" % (name) + err = "sconsign: ignoring invalid .sconsign file `%s'\n" % name sys.stderr.write(err) return except Exception as e: diff --git a/test/CC/SHCCFLAGS.py b/test/CC/SHCCFLAGS.py index 72d36b1..0bb349b 100644 --- a/test/CC/SHCCFLAGS.py +++ b/test/CC/SHCCFLAGS.py @@ -120,7 +120,7 @@ foomain_obj = barMain.Object(target='foomain', source='main.c') barmain_obj = barMain.Object(target='barmain', source='main.c') barMain.Program(target='barprog', source=foomain_obj) barMain.Program(target='fooprog', source=barmain_obj) -""" % (barflags)) +""" % barflags) test.run(arguments = '.') diff --git a/test/CC/SHCFLAGS.py b/test/CC/SHCFLAGS.py index 3ec6778..a691dba 100644 --- a/test/CC/SHCFLAGS.py +++ b/test/CC/SHCFLAGS.py @@ -120,7 +120,7 @@ foomain_obj = barMain.Object(target='foomain', source='main.c') barmain_obj = barMain.Object(target='barmain', source='main.c') barMain.Program(target='barprog', source=foomain_obj) barMain.Program(target='fooprog', source=barmain_obj) -""" % (barflags)) +""" % barflags) test.run(arguments = '.') diff --git a/test/CacheDir/readonly-cache.py b/test/CacheDir/readonly-cache.py index 6520106..63cfd22 100755 --- a/test/CacheDir/readonly-cache.py +++ b/test/CacheDir/readonly-cache.py @@ -64,11 +64,11 @@ if time1 <= time0: test.unlink('file.out') -for root, dirs, files in os.walk("cache",topdown=False): - for file in files: - os.chmod(os.path.join(root,file),0o444) - for dir in dirs: - os.chmod(os.path.join(root,dir),0o555) +for root, dirs, files in os.walk("cache", topdown=False): + for file in files: + os.chmod(os.path.join(root,file), 0o444) + for dir in dirs: + os.chmod(os.path.join(root,dir), 0o555) test.run(arguments = '--debug=explain --cache-debug=- .') diff --git a/test/Configure/ConfigureDryRunError.py b/test/Configure/ConfigureDryRunError.py index 2a8e449..1b89b03 100644 --- a/test/Configure/ConfigureDryRunError.py +++ b/test/Configure/ConfigureDryRunError.py @@ -56,7 +56,7 @@ r2 = conf.CheckLib('hopefullynolib') # will fail env = conf.Finish() if not (r1 and not r2): Exit(1) -""" % (lib)) +""" % lib) expect = """ scons: *** Cannot create configure directory ".sconf_temp" within a dry-run. diff --git a/test/D/Support/executablesSearch.py b/test/D/Support/executablesSearch.py index c572f56..e24601c 100755 --- a/test/D/Support/executablesSearch.py +++ b/test/D/Support/executablesSearch.py @@ -56,11 +56,11 @@ if __name__ == '__main__': import TestSCons class VariousTests(unittest.TestCase): - ''' + """ These tests are somewhat self referential in that isExecutableOfToolAvailable uses where_is to do most of it's work and we use the same function in the tests. - ''' + """ def setUp(self): self.test = TestSCons.TestSCons() diff --git a/test/Exit.py b/test/Exit.py index f00986d..abaa382 100644 --- a/test/Exit.py +++ b/test/Exit.py @@ -121,7 +121,7 @@ exit_builder(["%s"], ["%s"]) """ % (subdir_foo_out, subdir_foo_in), error=1), stderr = """\ scons: *** [%s] Explicit exit, status 27 -""" % (subdir_foo_out)) +""" % subdir_foo_out) test.must_match(['subdir', 'foo.out'], "subdir/foo.in\n") diff --git a/test/LINK/LINKCOMSTR.py b/test/LINK/LINKCOMSTR.py index df070fb..419056c 100644 --- a/test/LINK/LINKCOMSTR.py +++ b/test/LINK/LINKCOMSTR.py @@ -75,7 +75,7 @@ int main(int argc, char **argv) {} """) test.run() -if ("Linking" not in test.stdout()): +if "Linking" not in test.stdout(): test.fail_test() test.pass_test() diff --git a/test/LINK/SHLINKCOMSTR.py b/test/LINK/SHLINKCOMSTR.py index 4dd5c7c..18cfc9b 100644 --- a/test/LINK/SHLINKCOMSTR.py +++ b/test/LINK/SHLINKCOMSTR.py @@ -87,7 +87,7 @@ int i; """) test.run() - if ("Shared-Linking" not in test.stdout()): + if "Shared-Linking" not in test.stdout(): test.fail_test() test.pass_test() diff --git a/test/LINK/applelink.py b/test/LINK/applelink.py index e1b2837..c631e32 100644 --- a/test/LINK/applelink.py +++ b/test/LINK/applelink.py @@ -135,7 +135,7 @@ for SHLIBVERSION, \ test.must_contain_all_lines(test.stdout(), ['-Wl,-compatibility_version,{APPLELINK_COMPATIBILITY_VERSION}'.format(**locals())]) - if not (extra_flags): + if not extra_flags: # Now run otool -L to get the compat and current version info and verify it's correct in the library. # We expect output such as this # libfoo.1.2.3.dylib: diff --git a/test/MSVS/vs-10.0-exec.py b/test/MSVS/vs-10.0-exec.py index 090bde8..df13454 100644 --- a/test/MSVS/vs-10.0-exec.py +++ b/test/MSVS/vs-10.0-exec.py @@ -59,7 +59,7 @@ if env.WhereIs('cl'): print("os.environ.update(%%s)" %% repr(env['ENV'])) """ % locals()) -if(test.stdout() == ""): +if test.stdout() == "": msg = "Visual Studio %s missing cl.exe; skipping test.\n" % msvs_version test.skip_test(msg) diff --git a/test/MSVS/vs-10.0Exp-exec.py b/test/MSVS/vs-10.0Exp-exec.py index d6114bd..1c3b561 100644 --- a/test/MSVS/vs-10.0Exp-exec.py +++ b/test/MSVS/vs-10.0Exp-exec.py @@ -59,7 +59,7 @@ if env.WhereIs('cl'): print("os.environ.update(%%s)" %% repr(env['ENV'])) """ % locals()) -if(test.stdout() == ""): +if test.stdout() == "": msg = "Visual Studio %s missing cl.exe; skipping test.\n" % msvs_version test.skip_test(msg) diff --git a/test/MSVS/vs-11.0-exec.py b/test/MSVS/vs-11.0-exec.py index 48acd1c..8286841 100644 --- a/test/MSVS/vs-11.0-exec.py +++ b/test/MSVS/vs-11.0-exec.py @@ -59,7 +59,7 @@ if env.WhereIs('cl'): print("os.environ.update(%%s)" %% repr(env['ENV'])) """ % locals()) -if(test.stdout() == ""): +if test.stdout() == "": msg = "Visual Studio %s missing cl.exe; skipping test.\n" % msvs_version test.skip_test(msg) diff --git a/test/MSVS/vs-11.0Exp-exec.py b/test/MSVS/vs-11.0Exp-exec.py index 6a288a5..e7cffad 100644 --- a/test/MSVS/vs-11.0Exp-exec.py +++ b/test/MSVS/vs-11.0Exp-exec.py @@ -59,7 +59,7 @@ if env.WhereIs('cl'): print("os.environ.update(%%s)" %% repr(env['ENV'])) """ % locals()) -if(test.stdout() == ""): +if test.stdout() == "": msg = "Visual Studio %s missing cl.exe; skipping test.\n" % msvs_version test.skip_test(msg) diff --git a/test/MSVS/vs-14.0-exec.py b/test/MSVS/vs-14.0-exec.py index d2b7112..1d5b9bc 100644 --- a/test/MSVS/vs-14.0-exec.py +++ b/test/MSVS/vs-14.0-exec.py @@ -59,7 +59,7 @@ if env.WhereIs('cl'): print("os.environ.update(%%s)" %% repr(env['ENV'])) """ % locals()) -if(test.stdout() == ""): +if test.stdout() == "": msg = "Visual Studio %s missing cl.exe; skipping test.\n" % msvs_version test.skip_test(msg) diff --git a/test/MSVS/vs-14.1-exec.py b/test/MSVS/vs-14.1-exec.py index 2f593e0..bcf4fbe 100644 --- a/test/MSVS/vs-14.1-exec.py +++ b/test/MSVS/vs-14.1-exec.py @@ -59,7 +59,7 @@ if env.WhereIs('cl'): print("os.environ.update(%%s)" %% repr(env['ENV'])) """ % locals()) -if(test.stdout() == ""): +if test.stdout() == "": msg = "Visual Studio %s missing cl.exe; skipping test.\n" % msvs_version test.skip_test(msg) diff --git a/test/MSVS/vs-6.0-exec.py b/test/MSVS/vs-6.0-exec.py index 0864f76..ab70872 100644 --- a/test/MSVS/vs-6.0-exec.py +++ b/test/MSVS/vs-6.0-exec.py @@ -58,7 +58,7 @@ if env.WhereIs('cl'): print("os.environ.update(%%s)" %% repr(env['ENV'])) """ % locals()) -if(test.stdout() == ""): +if test.stdout() == "": msg = "Visual Studio %s missing cl.exe; skipping test.\n" % msvs_version test.skip_test(msg) diff --git a/test/MSVS/vs-7.0-exec.py b/test/MSVS/vs-7.0-exec.py index e95ca83..3c41aa5 100644 --- a/test/MSVS/vs-7.0-exec.py +++ b/test/MSVS/vs-7.0-exec.py @@ -58,7 +58,7 @@ if env.WhereIs('cl'): print("os.environ.update(%%s)" %% repr(env['ENV'])) """ % locals()) -if(test.stdout() == ""): +if test.stdout() == "": msg = "Visual Studio %s missing cl.exe; skipping test.\n" % msvs_version test.skip_test(msg) diff --git a/test/MSVS/vs-7.1-exec.py b/test/MSVS/vs-7.1-exec.py index 11ea617..f66b92d 100644 --- a/test/MSVS/vs-7.1-exec.py +++ b/test/MSVS/vs-7.1-exec.py @@ -58,7 +58,7 @@ if env.WhereIs('cl'): print("os.environ.update(%%s)" %% repr(env['ENV'])) """ % locals()) -if(test.stdout() == ""): +if test.stdout() == "": msg = "Visual Studio %s missing cl.exe; skipping test.\n" % msvs_version test.skip_test(msg) diff --git a/test/MSVS/vs-8.0-exec.py b/test/MSVS/vs-8.0-exec.py index 4b0a6dd..91e99dd 100644 --- a/test/MSVS/vs-8.0-exec.py +++ b/test/MSVS/vs-8.0-exec.py @@ -59,7 +59,7 @@ if env.WhereIs('cl'): print("os.environ.update(%%s)" %% repr(env['ENV'])) """ % locals()) -if(test.stdout() == ""): +if test.stdout() == "": msg = "Visual Studio %s missing cl.exe; skipping test.\n" % msvs_version test.skip_test(msg) diff --git a/test/MSVS/vs-8.0Exp-exec.py b/test/MSVS/vs-8.0Exp-exec.py index 0e4396d..77cae64 100644 --- a/test/MSVS/vs-8.0Exp-exec.py +++ b/test/MSVS/vs-8.0Exp-exec.py @@ -59,7 +59,7 @@ if env.WhereIs('cl'): print("os.environ.update(%%s)" %% repr(env['ENV'])) """ % locals()) -if(test.stdout() == ""): +if test.stdout() == "": msg = "Visual Studio %s missing cl.exe; skipping test.\n" % msvs_version test.skip_test(msg) diff --git a/test/MSVS/vs-9.0-exec.py b/test/MSVS/vs-9.0-exec.py index 3f823fa..26a115d 100644 --- a/test/MSVS/vs-9.0-exec.py +++ b/test/MSVS/vs-9.0-exec.py @@ -59,7 +59,7 @@ if env.WhereIs('cl'): print("os.environ.update(%%s)" %% repr(env['ENV'])) """ % locals()) -if(test.stdout() == ""): +if test.stdout() == "": msg = "Visual Studio %s missing cl.exe; skipping test.\n" % msvs_version test.skip_test(msg) diff --git a/test/MSVS/vs-9.0Exp-exec.py b/test/MSVS/vs-9.0Exp-exec.py index 5a65faf..0c274ba 100644 --- a/test/MSVS/vs-9.0Exp-exec.py +++ b/test/MSVS/vs-9.0Exp-exec.py @@ -59,7 +59,7 @@ if env.WhereIs('cl'): print("os.environ.update(%%s)" %% repr(env['ENV'])) """ % locals()) -if(test.stdout() == ""): +if test.stdout() == "": msg = "Visual Studio %s missing cl.exe; skipping test.\n" % msvs_version test.skip_test(msg) diff --git a/test/NodeOps.py b/test/NodeOps.py index 99a3f6a..ae200f6 100644 --- a/test/NodeOps.py +++ b/test/NodeOps.py @@ -213,7 +213,7 @@ build_nodes = ['fooprog' + _exe, ] + builddir_srcnodes + sub_build_nodes def cleanup_test(): - "cleanup after running a test" + """cleanup after running a test""" for F in builddir_srcnodes: test.unlink(F) # will be repopulated during clean operation test.run(arguments = '-c') diff --git a/test/QT/up-to-date.py b/test/QT/up-to-date.py index 7a7e565..e1734bd 100644 --- a/test/QT/up-to-date.py +++ b/test/QT/up-to-date.py @@ -134,7 +134,7 @@ test.run(arguments = my_obj, stderr=None) expect = my_obj.replace( '/', os.sep ) test.up_to_date(options = '--debug=explain', - arguments = (expect), + arguments =expect, stderr=None) test.pass_test() diff --git a/test/Repository/SharedLibrary.py b/test/Repository/SharedLibrary.py index 51142aa..04ce1a5 100644 --- a/test/Repository/SharedLibrary.py +++ b/test/Repository/SharedLibrary.py @@ -56,7 +56,7 @@ if ARGUMENTS.get('PROGRAM'): """) for fx in ['1', '2', '3']: - test.write(['repository', 'f%s.c' % (fx)], r""" + test.write(['repository', 'f%s.c' % fx], r""" #include void diff --git a/test/SWIG/recursive-includes-cpp.py b/test/SWIG/recursive-includes-cpp.py index dcd9d05..1a9091f 100644 --- a/test/SWIG/recursive-includes-cpp.py +++ b/test/SWIG/recursive-includes-cpp.py @@ -49,7 +49,7 @@ python, python_include, python_libpath, python_lib = \ if sys.platform == 'win32': python_lib = os.path.dirname(sys.executable) + "/libs/" + ('python%d%d'%(sys.version_info[0],sys.version_info[1])) + '.lib' - if( not os.path.isfile(python_lib)): + if not os.path.isfile(python_lib): test.skip_test('Can not find python lib at "' + python_lib + '", skipping test.%s' % os.linesep) test.write("recursive.h", """\ diff --git a/test/TEX/LATEX.py b/test/TEX/LATEX.py index dabe8b1..85cc7d8 100644 --- a/test/TEX/LATEX.py +++ b/test/TEX/LATEX.py @@ -168,7 +168,7 @@ This is the include file. mod %s test.write('makeindex.idx', '') test.subdir('subdir') - test.write('latexi.tex', latex1 % 'latexi.tex'); + test.write('latexi.tex', latex1 % 'latexi.tex') test.write([ 'subdir', 'latexinputfile'], latex2) test.write([ 'subdir', 'latexincludefile.tex'], latex3 % '1') diff --git a/test/TEX/LATEX2.py b/test/TEX/LATEX2.py index a3ac125..1628bb9 100644 --- a/test/TEX/LATEX2.py +++ b/test/TEX/LATEX2.py @@ -95,7 +95,7 @@ This is the include file. mod %s test.write('makeindex.idx', '') test.subdir('subdir') - test.write('latexi.tex', latex1 % 'latexi.tex'); + test.write('latexi.tex', latex1 % 'latexi.tex') test.write([ 'subdir', 'latexinputfile'], latex2) test.write([ 'subdir', 'latexincludefile.tex'], latex3 % '1') diff --git a/test/Win32/bad-drive.py b/test/Win32/bad-drive.py index 78f5395..28d926b 100644 --- a/test/Win32/bad-drive.py +++ b/test/Win32/bad-drive.py @@ -53,7 +53,7 @@ for d in reversed(ascii_uppercase): if bad_drive is None: print("All drive letters appear to be in use.") print("Cannot test SCons handling of invalid Windows drive letters.") - test.no_result(1); + test.no_result(1) test.write('SConstruct', """ def cat(env, source, target): diff --git a/test/implicit-cache/SetOption.py b/test/implicit-cache/SetOption.py index f86ad47..d98ff8b 100644 --- a/test/implicit-cache/SetOption.py +++ b/test/implicit-cache/SetOption.py @@ -63,7 +63,7 @@ test.run(arguments = '.') test.write('i1/foo.h', """ this line will cause a syntax error if it's included by a rebuild -"""); +""") test.up_to_date(arguments = '.') diff --git a/test/site_scons/sysdirs.py b/test/site_scons/sysdirs.py index 60b4f0b..36a581e 100644 --- a/test/site_scons/sysdirs.py +++ b/test/site_scons/sysdirs.py @@ -50,7 +50,7 @@ import SCons.Platform platform = SCons.Platform.platform_default() if platform in ('win32', 'cygwin'): dir_to_check_for='Application Data' -elif platform in ('darwin'): +elif platform in 'darwin': dir_to_check_for='Library' else: dir_to_check_for='.scons' diff --git a/testing/framework/TestCmd.py b/testing/framework/TestCmd.py index 447d050..b98445c 100644 --- a/testing/framework/TestCmd.py +++ b/testing/framework/TestCmd.py @@ -667,7 +667,7 @@ def diff_re(a, b, fromfile='', tofile='', if os.name == 'posix': def escape(arg): - "escape shell special characters" + """escape shell special characters""" slash = '\\' special = '"$' arg = arg.replace(slash, slash + slash) diff --git a/testing/framework/TestCmdTests.py b/testing/framework/TestCmdTests.py index 541df71..0c7b455 100644 --- a/testing/framework/TestCmdTests.py +++ b/testing/framework/TestCmdTests.py @@ -121,8 +121,8 @@ class TestCmdTestCase(unittest.TestCase): else: textx = '#! /usr/bin/env python\n' + textx + '\n' text1 = 'A first line to be ignored!\n' + fmt % (t.script1, t.script1) - textout = fmtout % (t.scriptout) - texterr = fmterr % (t.scripterr) + textout = fmtout % t.scriptout + texterr = fmterr % t.scripterr run_env = TestCmd.TestCmd(workdir = '') run_env.subdir('sub dir') @@ -1974,7 +1974,7 @@ class run_verbose_TestCase(TestCmdTestCase): assert expect == o, (expect, o) e = sys.stderr.getvalue() - expect = 'python "%s" "arg1 arg2"\n' % (t.scriptout_path) + expect = 'python "%s" "arg1 arg2"\n' % t.scriptout_path assert e == expect, (e, expect) test = TestCmd.TestCmd(program = t.scriptout, @@ -1993,7 +1993,7 @@ class run_verbose_TestCase(TestCmdTestCase): assert expect == o, (expect, o) e = sys.stderr.getvalue() - expect = 'python "%s" "arg1 arg2"\n' % (t.scriptout_path) + expect = 'python "%s" "arg1 arg2"\n' % t.scriptout_path assert e == expect, (e, expect) # Test letting TestCmd() pick up verbose = 2 from the environment. diff --git a/testing/framework/TestSCons.py b/testing/framework/TestSCons.py index d1aed28..a633617 100644 --- a/testing/framework/TestSCons.py +++ b/testing/framework/TestSCons.py @@ -817,7 +817,7 @@ class TestSCons(TestCommon): sp = subprocess.Popen([where_java_bin, "-version"], stdout=subprocess.PIPE, stderr=subprocess.PIPE) stdout, stderr = sp.communicate() sp.wait() - if("No Java runtime" in str(stderr)): + if "No Java runtime" in str(stderr): self.skip_test("Could not find Java " + java_bin_name + ", skipping test(s).\n") def java_where_jar(self, version=None): diff --git a/testing/framework/TestUnit/taprunner.py b/testing/framework/TestUnit/taprunner.py index 5c2e87c..0dde327 100644 --- a/testing/framework/TestUnit/taprunner.py +++ b/testing/framework/TestUnit/taprunner.py @@ -62,7 +62,7 @@ class TAPTestResult(TextTestResult): def addExpectedFailure(self, test, err): super(TextTestResult, self).addExpectedFailure(test, err) - self._process(test, "not ok", directive=(" # TODO")) + self._process(test, "not ok", directive=" # TODO") def addUnexpectedSuccess(self, test): super(TextTestResult, self).addUnexpectedSuccess(test) -- cgit v0.12 From c4e058dc877e9330110ab7a732b82de1224dc815 Mon Sep 17 00:00:00 2001 From: William Deegan Date: Mon, 23 Dec 2019 17:43:32 -0800 Subject: Add propagating VCINSTALLDIR and VCToolsInstallDir which are used by CLang to find MSVC files including header files aka stdio.h,etc --- src/engine/SCons/Tool/MSCommon/common.py | 21 ++++++++++++++++----- 1 file changed, 16 insertions(+), 5 deletions(-) diff --git a/src/engine/SCons/Tool/MSCommon/common.py b/src/engine/SCons/Tool/MSCommon/common.py index bbccf61..386f445 100644 --- a/src/engine/SCons/Tool/MSCommon/common.py +++ b/src/engine/SCons/Tool/MSCommon/common.py @@ -50,7 +50,7 @@ elif LOGFILE: level=logging.DEBUG) debug = logging.getLogger(name=__name__).debug else: - debug = lambda x: None + def debug(x): return None # SCONS_CACHE_MSVC_CONFIG is public, and is documented. @@ -58,6 +58,7 @@ CONFIG_CACHE = os.environ.get('SCONS_CACHE_MSVC_CONFIG') if CONFIG_CACHE in ('1', 'true', 'True'): CONFIG_CACHE = os.path.join(os.path.expanduser('~'), '.scons_msvc_cache') + def read_script_env_cache(): """ fetch cached msvc env vars if requested, else return empty dict """ envcache = {} @@ -65,7 +66,7 @@ def read_script_env_cache(): try: with open(CONFIG_CACHE, 'r') as f: envcache = json.load(f) - #TODO can use more specific FileNotFoundError when py2 dropped + # TODO can use more specific FileNotFoundError when py2 dropped except IOError: # don't fail if no cache file, just proceed without it pass @@ -88,6 +89,7 @@ def write_script_env_cache(cache): _is_win64 = None + def is_win64(): """Return true if running on windows 64 bits. @@ -122,6 +124,7 @@ def is_win64(): def read_reg(value, hkroot=SCons.Util.HKEY_LOCAL_MACHINE): return SCons.Util.RegGetValue(hkroot, value)[0] + def has_reg(value): """Return True if the given key exists in HKEY_LOCAL_MACHINE, False otherwise.""" @@ -134,6 +137,7 @@ def has_reg(value): # Functions for fetching environment variable settings from batch files. + def normalize_env(env, keys, force=False): """Given a dictionary representing a shell environment, add the variables from os.environ needed for the processing of .bat files; the keys are @@ -172,11 +176,12 @@ def normalize_env(env, keys, force=False): if sys32_wbem_dir not in normenv['PATH']: normenv['PATH'] = normenv['PATH'] + os.pathsep + sys32_wbem_dir - debug("PATH: %s"%normenv['PATH']) + debug("PATH: %s" % normenv['PATH']) return normenv -def get_output(vcbat, args = None, env = None): + +def get_output(vcbat, args=None, env=None): """Parse the output of given bat file, with given args.""" if env is None: @@ -242,7 +247,13 @@ def get_output(vcbat, args = None, env = None): output = stdout.decode("mbcs") return output -KEEPLIST = ("INCLUDE", "LIB", "LIBPATH", "PATH", 'VSCMD_ARG_app_plat') + +KEEPLIST = ("INCLUDE", "LIB", "LIBPATH", "PATH", 'VSCMD_ARG_app_plat', + 'VCINSTALLDIR', # needed by clang -VS 2017 and newer + 'VCToolsInstallDir', # needed by clang - VS 2015 and older + ) + + def parse_output(output, keep=KEEPLIST): """ Parse output from running visual c++/studios vcvarsall.bat and running set -- cgit v0.12 From cac7a17bad265db91ba06c9c97862d31edca306d Mon Sep 17 00:00:00 2001 From: Mats Wichmann Date: Tue, 24 Dec 2019 07:51:10 -0700 Subject: [PR #3509] change tuple syntax per review comment [ci skip] A couple of tools in bin had argument-handling lines that looked like: elif o in ('--username') original change made that into a tuple: ('--username',) except where I missed it and the parens were just dropped. Now these are elif o == '--username' Skipped CI builds on this one since the change doesn't affect scons code itself and is not run by CI. Signed-off-by: Mats Wichmann --- bin/scons-diff.py | 6 +++--- bin/scons_dev_master.py | 4 ++-- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/bin/scons-diff.py b/bin/scons-diff.py index 0bed74b..c62b926 100644 --- a/bin/scons-diff.py +++ b/bin/scons-diff.py @@ -54,16 +54,16 @@ for o, a in opts: elif o in ('-h', '--help'): print(Usage) sys.exit(0) - elif o in ('-n',): + elif o == '-n': diff_options.append(o) edit_type = o - elif o in ('-q',): + elif o == '-q': diff_type = o diff_line = lambda l, r: None elif o in ('-r', '--recursive'): recursive = True diff_options.append(o) - elif o in ('-s',): + elif o '-s': report_same = True try: diff --git a/bin/scons_dev_master.py b/bin/scons_dev_master.py index d4c8e90..c8cc0f9 100755 --- a/bin/scons_dev_master.py +++ b/bin/scons_dev_master.py @@ -152,11 +152,11 @@ Usage: scons_dev_master.py [-hnqy] [--password PASSWORD] [--username USER] sys.exit(0) elif o in ('-n', '--no-exec'): CommandRunner.execute = CommandRunner.do_not_execute - elif o in '--password': + elif o == '--password': password = a elif o in ('-q', '--quiet'): CommandRunner.display = CommandRunner.do_not_display - elif o in '--username': + elif o == '--username': username = a elif o in ('-y', '--yes', '--assume-yes'): yesflag = o -- cgit v0.12 From fc0e28b11d21fc6a39d2575cc523e385b713a5e9 Mon Sep 17 00:00:00 2001 From: Mats Wichmann Date: Tue, 24 Dec 2019 10:00:35 -0700 Subject: fix error in scons-diff.py [ci skip] --- bin/scons-diff.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bin/scons-diff.py b/bin/scons-diff.py index c62b926..09b3dcc 100644 --- a/bin/scons-diff.py +++ b/bin/scons-diff.py @@ -63,7 +63,7 @@ for o, a in opts: elif o in ('-r', '--recursive'): recursive = True diff_options.append(o) - elif o '-s': + elif o == '-s': report_same = True try: -- cgit v0.12 From 71bf1efe99a488d482032ad0d64f1defd9b32b04 Mon Sep 17 00:00:00 2001 From: William Deegan Date: Wed, 25 Dec 2019 12:17:44 -0800 Subject: Add c:\msys64\mingw64\bin for appveyor vs2019 --- src/engine/SCons/Tool/clangCommon/__init__.py | 1 + 1 file changed, 1 insertion(+) diff --git a/src/engine/SCons/Tool/clangCommon/__init__.py b/src/engine/SCons/Tool/clangCommon/__init__.py index 37efbf6..5501457 100644 --- a/src/engine/SCons/Tool/clangCommon/__init__.py +++ b/src/engine/SCons/Tool/clangCommon/__init__.py @@ -6,6 +6,7 @@ clang_win32_dirs = [ r'C:\Program Files\LLVM\bin', r'C:\cygwin64\bin', r'C:\msys64', + r'C:\msys64\mingw64\bin', r'C:\cygwin\bin', r'C:\msys', ] -- cgit v0.12 From caafe1f472fed10d7888ea26b39bf0c1eb71c026 Mon Sep 17 00:00:00 2001 From: William Deegan Date: Wed, 25 Dec 2019 12:34:45 -0800 Subject: Update clang logic to initialize MSVC shell environment variables needed for clang to find include files --- src/engine/SCons/Tool/clang.py | 5 +++++ src/engine/SCons/Tool/clangxx.py | 5 +++++ 2 files changed, 10 insertions(+) diff --git a/src/engine/SCons/Tool/clang.py b/src/engine/SCons/Tool/clang.py index 081ab67..162daad 100644 --- a/src/engine/SCons/Tool/clang.py +++ b/src/engine/SCons/Tool/clang.py @@ -46,6 +46,7 @@ import sys import SCons.Util import SCons.Tool.cc from SCons.Tool.clangCommon import get_clang_install_dirs +from SCons.Tool.MSCommon import msvc_setup_env_once compilers = ['clang'] @@ -62,6 +63,10 @@ def generate(env): clang_bin_dir = os.path.dirname(clang) env.AppendENVPath('PATH', clang_bin_dir) + # Set-up ms tools paths + msvc_setup_env_once(env) + + env['CC'] = env.Detect(compilers) or 'clang' if env['PLATFORM'] in ['cygwin', 'win32']: env['SHCCFLAGS'] = SCons.Util.CLVar('$CCFLAGS') diff --git a/src/engine/SCons/Tool/clangxx.py b/src/engine/SCons/Tool/clangxx.py index a29cf79..b1dc6f3 100644 --- a/src/engine/SCons/Tool/clangxx.py +++ b/src/engine/SCons/Tool/clangxx.py @@ -47,6 +47,7 @@ import SCons.Tool import SCons.Util import SCons.Tool.cxx from SCons.Tool.clangCommon import get_clang_install_dirs +from SCons.Tool.MSCommon import msvc_setup_env_once compilers = ['clang++'] @@ -75,6 +76,10 @@ def generate(env): clangxx_bin_dir = os.path.dirname(clangxx) env.AppendENVPath('PATH', clangxx_bin_dir) + # Set-up ms tools paths + msvc_setup_env_once(env) + + # determine compiler version if env['CXX']: pipe = SCons.Action._subproc(env, [env['CXX'], '--version'], -- cgit v0.12 From 63714ab2bb12b8aa1f77e49dc6d17b024405c68c Mon Sep 17 00:00:00 2001 From: William Deegan Date: Wed, 25 Dec 2019 12:42:08 -0800 Subject: [ci skip] Updated CHANGES.txt --- src/CHANGES.txt | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/src/CHANGES.txt b/src/CHANGES.txt index 968a2c4..328196c 100755 --- a/src/CHANGES.txt +++ b/src/CHANGES.txt @@ -8,9 +8,12 @@ NOTE: The 4.0.0 Release of SCons will drop Python 2.7 Support RELEASE VERSION/DATE TO BE FILLED IN LATER - From John Doe: - - - Whatever John Doe did. + From William Deegan: + - Fix broken clang + MSVC 2019 combination by using MSVC configuration logic to + propagate'VCINSTALLDIR' and 'VCToolsInstallDir' which clang tools use to locate + header files and libraries from MSVC install. (Fixes GH Issue #3480) + - Added C:\msys64\mingw64\bin to default mingw and clang windows PATH's. This + is a reasonable default and also aligns with changes in Appveyor's VS2019 image. RELEASE 3.1.2 - Mon, 17 Dec 2019 02:06:27 +0000 -- cgit v0.12 From 6e0dc8d3d9968425d711e88f03a3714d5f8643eb Mon Sep 17 00:00:00 2001 From: William Deegan Date: Wed, 25 Dec 2019 14:54:36 -0800 Subject: Reduce default PATH addtions to match VS2019 debug appveyor's. --- privileged/cache/config | 1 + 1 file changed, 1 insertion(+) create mode 100644 privileged/cache/config diff --git a/privileged/cache/config b/privileged/cache/config new file mode 100644 index 0000000..b39e891 --- /dev/null +++ b/privileged/cache/config @@ -0,0 +1 @@ +{"prefix_len": 2} \ No newline at end of file -- cgit v0.12 From 7b2721fe6ed1a93ac7a40c4302114518877141ea Mon Sep 17 00:00:00 2001 From: William Deegan Date: Thu, 26 Dec 2019 13:40:38 -0800 Subject: Fix CacheDirTest so that temp dir is not under the directory that the runtest.py is run from, but rather from the temp dir created for the test --- privileged/cache/config | 1 - src/engine/SCons/CacheDirTests.py | 2 +- 2 files changed, 1 insertion(+), 2 deletions(-) delete mode 100644 privileged/cache/config diff --git a/privileged/cache/config b/privileged/cache/config deleted file mode 100644 index b39e891..0000000 --- a/privileged/cache/config +++ /dev/null @@ -1 +0,0 @@ -{"prefix_len": 2} \ No newline at end of file diff --git a/src/engine/SCons/CacheDirTests.py b/src/engine/SCons/CacheDirTests.py index 07c32b4..0e242c4 100644 --- a/src/engine/SCons/CacheDirTests.py +++ b/src/engine/SCons/CacheDirTests.py @@ -130,7 +130,7 @@ class ExceptionTestCase(unittest.TestCase): @unittest.skipIf(sys.platform.startswith("win"), "This fixture will not trigger an OSError on Windows") def test_throws_correct_on_OSError(self): """Test that the correct error is thrown when cache directory cannot be created.""" - privileged_dir = os.path.join(os.getcwd(), "privileged") + privileged_dir = os.path.join(self.tmpdir, "privileged") try: os.mkdir(privileged_dir) os.chmod(privileged_dir, stat.S_IREAD) -- cgit v0.12 From 5c9a3cffbbcdd19529aca9d34d9c1a9cb375735c Mon Sep 17 00:00:00 2001 From: William Deegan Date: Thu, 26 Dec 2019 16:15:49 -0800 Subject: Speed up test on windows by setting tools=[] --- test/SConscript/must_exist.py | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/test/SConscript/must_exist.py b/test/SConscript/must_exist.py index 3faf0ce..7c721ed 100644 --- a/test/SConscript/must_exist.py +++ b/test/SConscript/must_exist.py @@ -42,6 +42,7 @@ import SCons from SCons.Warnings import _warningOut import sys +DefaultEnvironment(tools=[]) # 1. call should succeed with deprecation warning try: SConscript('missing/SConscript') @@ -89,27 +90,27 @@ warn1 = """ scons: warning: Calling missing SConscript without error is deprecated. Transition by adding must_exist=0 to SConscript calls. Missing SConscript '{}' -""".format(missing) + test.python_file_line(SConstruct_path, 7) +""".format(missing) + test.python_file_line(SConstruct_path, 8) warn2 = """ scons: warning: Ignoring missing SConscript '{}' -""".format(missing) + test.python_file_line(SConstruct_path, 13) +""".format(missing) + test.python_file_line(SConstruct_path, 14) err1 = """ scons: warning: Fatal: missing SConscript '{}' -""".format(missing) + test.python_file_line(SConstruct_path, 22) +""".format(missing) + test.python_file_line(SConstruct_path, 23) warn3 = """ scons: warning: Ignoring missing SConscript '{}' -""".format(missing) + test.python_file_line(SConstruct_path, 25) +""".format(missing) + test.python_file_line(SConstruct_path, 26) err2 = """ scons: warning: Fatal: missing SConscript '{}' -""".format(missing) + test.python_file_line(SConstruct_path, 35) +""".format(missing) + test.python_file_line(SConstruct_path, 36) warn4 = """ scons: warning: Ignoring missing SConscript '{}' -""".format(missing) + test.python_file_line(SConstruct_path, 38) +""".format(missing) + test.python_file_line(SConstruct_path, 39) expect_stderr = warn1 + warn2 + err1 + warn3 + err2 + warn4 test.run(arguments = ".", stderr = expect_stderr) -- cgit v0.12 From 6d3cb377534dbf4ad4492a1451a7e3bfaf2987c6 Mon Sep 17 00:00:00 2001 From: William Deegan Date: Thu, 26 Dec 2019 18:13:53 -0800 Subject: FIx packaging tests to use correct tar when running via os.system. Fix variantdir to use mingw on windows for linking fortran programs. --- test/VariantDir/VariantDir.py | 13 +++++-- test/packaging/place-files-in-subdirectory.py | 2 +- test/packaging/tar/bz2_packaging.py | 11 ++++-- test/packaging/use-builddir.py | 50 ++++++++++++++++----------- 4 files changed, 50 insertions(+), 26 deletions(-) diff --git a/test/VariantDir/VariantDir.py b/test/VariantDir/VariantDir.py index d212b0d..a988831 100644 --- a/test/VariantDir/VariantDir.py +++ b/test/VariantDir/VariantDir.py @@ -56,6 +56,7 @@ bar52 = test.workpath('build', 'var5', 'bar2' + _exe) test.subdir('work1', 'work2', 'work3') test.write(['work1', 'SConstruct'], """ +DefaultEnvironment(tools=[]) src = Dir('src') var2 = Dir('build/var2') var3 = Dir('build/var3') @@ -88,6 +89,7 @@ SConscript('../build/var6/SConscript', "env") test.subdir(['work1', 'src']) test.write(['work1', 'src', 'SConscript'], """ import os.path +import sys def buildIt(target, source, env): if not os.path.exists('build'): @@ -116,9 +118,16 @@ except: fortran = None if fortran and env.Detect(fortran): + if sys.platform =='win32': + env_prog=Environment(tools=['mingw'], + # BUILD = env['BUILD'], SRC = ENV['src'], + CPPPATH=env['CPPPATH'], FORTRANPATH=env['FORTRANPATH'] ) + else: + env_prog=env.Clone() + env.Command(target='b2.f', source='b2.in', action=buildIt) - env.Clone().Program(target='bar2', source='b2.f') - env.Clone().Program(target='bar1', source='b1.f') + env_prog.Program(target='bar2', source='b2.f') + env_prog.Program(target='bar1', source='b1.f') """) test.write(['work1', 'src', 'f1.c'], r""" diff --git a/test/packaging/place-files-in-subdirectory.py b/test/packaging/place-files-in-subdirectory.py index 23ff543..511f27a 100644 --- a/test/packaging/place-files-in-subdirectory.py +++ b/test/packaging/place-files-in-subdirectory.py @@ -102,7 +102,7 @@ env.Package( NAME = 'libfoo', test.run(stderr = None) -with os.popen('tar -tzf %s'%test.workpath('libfoo-1.2.3.tar.gz')) as p: +with os.popen('%s -tzf %s'%(tar,test.workpath('libfoo-1.2.3.tar.gz'))) as p: str = p.read() test.fail_test(str != "libfoo-1.2.3/src/main.c\nlibfoo-1.2.3/SConstruct\n") diff --git a/test/packaging/tar/bz2_packaging.py b/test/packaging/tar/bz2_packaging.py index 812c08e..3c1afe3 100644 --- a/test/packaging/tar/bz2_packaging.py +++ b/test/packaging/tar/bz2_packaging.py @@ -32,6 +32,7 @@ This tests the SRC bz2 packager, which does the following: import TestSCons import os +import os.path import sys python = TestSCons.python @@ -42,10 +43,12 @@ tar = test.detect('TAR', 'tar') if not tar: test.skip_test('tar not found, skipping test\n') +bz2 = test.where_is('bzip2') +bz2_path = os.path.dirname(bz2) + if sys.platform == 'win32': # windows 10 causes fresh problems by supplying a tar, not bzip2 # but if git is installed, there's a bzip2 there, but can't be used - bz2 = test.where_is('bzip2') if not bz2: test.skip_test('tar found, but helper bzip2 not found, skipping test\n') bz2 = os.path.splitdrive(bz2)[1] @@ -65,11 +68,15 @@ int main( int argc, char* argv[] ) test.write('SConstruct', """ Program( 'src/main.c' ) env=Environment(tools=['packaging', 'filesystem', 'tar']) + +# needed for windows to prevent picking up windows tar and thinking non-windows bzip2 would work. +env.PrependENVPath('PATH', r'%s') + env.Package( PACKAGETYPE = 'src_tarbz2', target = 'src.tar.bz2', PACKAGEROOT = 'test', source = [ 'src/main.c', 'SConstruct' ] ) -""") +"""%bz2_path) test.run(arguments='', stderr=None) diff --git a/test/packaging/use-builddir.py b/test/packaging/use-builddir.py index 812f2d6..2395a8e 100644 --- a/test/packaging/use-builddir.py +++ b/test/packaging/use-builddir.py @@ -34,22 +34,25 @@ import TestSCons python = TestSCons.python test = TestSCons.TestSCons() - -tar = test.detect('TAR', 'tar') +test.verbose_set(3) +tar = test.detect("TAR", "tar") if not tar: - test.skip_test('tar not found, skipping test\n') + test.skip_test("tar not found, skipping test\n") # # TEST: builddir usage. # -test.subdir('src') -test.subdir('build') +test.subdir("src") +test.subdir("build") -test.write('src/main.c', '') +test.write("src/main.c", "") -test.write('SConstruct', """ +test.write( + "SConstruct", + """ VariantDir('build', 'src') +DefaultEnvironment(tools=[]) env=Environment(tools=['packaging', 'filesystem', 'zip']) env.Package( NAME = 'libfoo', PACKAGEROOT = 'build/libfoo', @@ -57,38 +60,43 @@ env.Package( NAME = 'libfoo', PACKAGETYPE = 'src_zip', target = 'build/libfoo-1.2.3.zip', source = [ 'src/main.c', 'SConstruct' ] ) -""") +""", +) -test.run(stderr = None) +test.run(stderr=None) -test.must_exist( 'build/libfoo-1.2.3.zip' ) +test.must_exist("build/libfoo-1.2.3.zip") # TEST: builddir not placed in archive # XXX: VariantDir should be stripped. # -test.subdir('src') -test.subdir('build') -test.subdir('temp') +test.subdir("src") +test.subdir("build") +test.subdir("temp") -test.write('src/main.c', '') +test.write("src/main.c", "") -test.write('SConstruct', """ +test.write( + "SConstruct", + """ +DefaultEnvironment(tools=[]) VariantDir('build', 'src') env=Environment(tools=['packaging', 'filesystem', 'tar']) env.Package( NAME = 'libfoo', VERSION = '1.2.3', PAKCAGETYPE = 'src_targz', source = [ 'src/main.c', 'SConstruct' ] ) -""") +""", +) -test.run(stderr = None) +test.run(stderr=None) -test.must_exist( 'libfoo-1.2.3.tar.gz' ) +test.must_exist("libfoo-1.2.3.tar.gz") -os.system('tar -C temp -xzf %s'%test.workpath('libfoo-1.2.3.tar.gz') ) +os.system('%s -C temp -xzf %s'%(tar, test.workpath('libfoo-1.2.3.tar.gz') )) -test.must_exist( 'temp/libfoo-1.2.3/src/main.c' ) -test.must_exist( 'temp/libfoo-1.2.3/SConstruct' ) +test.must_exist("temp/libfoo-1.2.3/src/main.c") +test.must_exist("temp/libfoo-1.2.3/SConstruct") test.pass_test() -- cgit v0.12 From 947626eca6c9b77b7f157d16616cd54c49a0b73f Mon Sep 17 00:00:00 2001 From: William Deegan Date: Thu, 26 Dec 2019 19:58:31 -0800 Subject: [travis skip] Turn on verbose info when running this test. --- test/option/taskmastertrace.py | 1 + 1 file changed, 1 insertion(+) diff --git a/test/option/taskmastertrace.py b/test/option/taskmastertrace.py index b38645f..11cbf1e 100644 --- a/test/option/taskmastertrace.py +++ b/test/option/taskmastertrace.py @@ -31,6 +31,7 @@ Simple tests of the --taskmastertrace= option. import TestSCons test = TestSCons.TestSCons() +test.verbose_set(3) test.write('SConstruct', """ DefaultEnvironment(tools=[]) -- cgit v0.12 From 8ab869c9cb245e70aacd81d7981335ff1aaabbfb Mon Sep 17 00:00:00 2001 From: William Deegan Date: Thu, 26 Dec 2019 21:05:02 -0800 Subject: [skip travis] Fix tar xz packaging on appveyor/windows --- test/packaging/tar/xz_packaging.py | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/test/packaging/tar/xz_packaging.py b/test/packaging/tar/xz_packaging.py index 1d80f7f..1f83632 100644 --- a/test/packaging/tar/xz_packaging.py +++ b/test/packaging/tar/xz_packaging.py @@ -28,13 +28,12 @@ __revision__ = "__FILE__ __REVISION__ __DATE__ __DEVELOPER__" This tests the SRC xz packager, which does the following: - create a tar package from the specified files """ - +import os.path import TestSCons python = TestSCons.python test = TestSCons.TestSCons() - tar = test.detect('TAR', 'tar') if not tar: test.skip_test('tar not found, skipping test\n') @@ -46,6 +45,8 @@ xz = test.where_is('xz') if not xz: test.skip_test('tar found, but helper xz not found, skipping test\n') +xz_path = os.path.dirname(xz) + test.subdir('src') test.write([ 'src', 'main.c'], r""" @@ -56,13 +57,18 @@ int main( int argc, char* argv[] ) """) test.write('SConstruct', """ +DefaultEnvironment(tools=[]) Program( 'src/main.c' ) env=Environment(tools=['packaging', 'filesystem', 'tar']) + +# needed for windows to prevent picking up windows tar and thinking non-windows bzip2 would work. +env.PrependENVPath('PATH', r'%s') + env.Package( PACKAGETYPE = 'src_tarxz', target = 'src.tar.xz', PACKAGEROOT = 'test', source = [ 'src/main.c', 'SConstruct' ] ) -""") +"""%xz_path) test.run(arguments='', stderr=None) -- cgit v0.12 From cd25d093cb4c9be8ca0e8f766dc5b60463c4daf0 Mon Sep 17 00:00:00 2001 From: William Deegan Date: Fri, 27 Dec 2019 08:14:21 -0800 Subject: Fix Program() usage in xz test. --- test/packaging/tar/xz_packaging.py | 1 - 1 file changed, 1 deletion(-) diff --git a/test/packaging/tar/xz_packaging.py b/test/packaging/tar/xz_packaging.py index 1f83632..5144235 100644 --- a/test/packaging/tar/xz_packaging.py +++ b/test/packaging/tar/xz_packaging.py @@ -57,7 +57,6 @@ int main( int argc, char* argv[] ) """) test.write('SConstruct', """ -DefaultEnvironment(tools=[]) Program( 'src/main.c' ) env=Environment(tools=['packaging', 'filesystem', 'tar']) -- cgit v0.12 From 0dfb7626a5b15007be01fec23966a5a28c4159f3 Mon Sep 17 00:00:00 2001 From: William Deegan Date: Fri, 27 Dec 2019 08:17:01 -0800 Subject: Try running each flavor in a single job instead of splitting into 4. --- .appveyor.yml | 122 +++++++++++++++++++++++++++++----------------------------- 1 file changed, 61 insertions(+), 61 deletions(-) diff --git a/.appveyor.yml b/.appveyor.yml index 9a94529..0cca999 100644 --- a/.appveyor.yml +++ b/.appveyor.yml @@ -54,84 +54,84 @@ environment: PYVER: 27 BUILD_JOB_NUM: 1 COVERAGE: 0 - - WINPYTHON: "Python27" - PYTHON: "2.7" - PYVER: 27 - BUILD_JOB_NUM: 2 - COVERAGE: 0 - - WINPYTHON: "Python27" - PYTHON: "2.7" - PYVER: 27 - BUILD_JOB_NUM: 3 - COVERAGE: 0 - - WINPYTHON: "Python27" - PYTHON: "2.7" - PYVER: 27 - BUILD_JOB_NUM: 4 - COVERAGE: 0 + # - WINPYTHON: "Python27" + # PYTHON: "2.7" + # PYVER: 27 + # BUILD_JOB_NUM: 2 + # COVERAGE: 0 + # - WINPYTHON: "Python27" + # PYTHON: "2.7" + # PYVER: 27 + # BUILD_JOB_NUM: 3 + # COVERAGE: 0 + # - WINPYTHON: "Python27" + # PYTHON: "2.7" + # PYVER: 27 + # BUILD_JOB_NUM: 4 + # COVERAGE: 0 - WINPYTHON: "Python35" PYTHON: "3.5" PYVER: 35 BUILD_JOB_NUM: 1 COVERAGE: 0 - - WINPYTHON: "Python35" - PYTHON: "3.5" - PYVER: 35 - BUILD_JOB_NUM: 2 - COVERAGE: 0 - - WINPYTHON: "Python35" - PYTHON: "3.5" - PYVER: 35 - BUILD_JOB_NUM: 3 - COVERAGE: 0 - - WINPYTHON: "Python35" - PYTHON: "3.5" - PYVER: 35 - BUILD_JOB_NUM: 4 - COVERAGE: 0 + # - WINPYTHON: "Python35" + # PYTHON: "3.5" + # PYVER: 35 + # BUILD_JOB_NUM: 2 + # COVERAGE: 0 + # - WINPYTHON: "Python35" + # PYTHON: "3.5" + # PYVER: 35 + # BUILD_JOB_NUM: 3 + # COVERAGE: 0 + # - WINPYTHON: "Python35" + # PYTHON: "3.5" + # PYVER: 35 + # BUILD_JOB_NUM: 4 + # COVERAGE: 0 - WINPYTHON: "Python36" PYTHON: "3.6" PYVER: 36 BUILD_JOB_NUM: 1 COVERAGE: 1 - - WINPYTHON: "Python36" - PYTHON: "3.6" - PYVER: 36 - BUILD_JOB_NUM: 2 - COVERAGE: 1 - - WINPYTHON: "Python36" - PYTHON: "3.6" - PYVER: 36 - BUILD_JOB_NUM: 3 - COVERAGE: 1 - - WINPYTHON: "Python36" - PYTHON: "3.6" - PYVER: 36 - BUILD_JOB_NUM: 4 - COVERAGE: 1 + # - WINPYTHON: "Python36" + # PYTHON: "3.6" + # PYVER: 36 + # BUILD_JOB_NUM: 2 + # COVERAGE: 1 + # - WINPYTHON: "Python36" + # PYTHON: "3.6" + # PYVER: 36 + # BUILD_JOB_NUM: 3 + # COVERAGE: 1 + # - WINPYTHON: "Python36" + # PYTHON: "3.6" + # PYVER: 36 + # BUILD_JOB_NUM: 4 + # COVERAGE: 1 - WINPYTHON: "Python37" PYTHON: "3.7" PYVER: 37 BUILD_JOB_NUM: 1 COVERAGE: 0 - - WINPYTHON: "Python37" - PYTHON: "3.7" - PYVER: 37 - BUILD_JOB_NUM: 2 - COVERAGE: 0 - - WINPYTHON: "Python37" - PYTHON: "3.7" - PYVER: 37 - BUILD_JOB_NUM: 3 - COVERAGE: 0 - - WINPYTHON: "Python37" - PYTHON: "3.7" - PYVER: 37 - BUILD_JOB_NUM: 4 - COVERAGE: 0 + # - WINPYTHON: "Python37" + # PYTHON: "3.7" + # PYVER: 37 + # BUILD_JOB_NUM: 2 + # COVERAGE: 0 + # - WINPYTHON: "Python37" + # PYTHON: "3.7" + # PYVER: 37 + # BUILD_JOB_NUM: 3 + # COVERAGE: 0 + # - WINPYTHON: "Python37" + # PYTHON: "3.7" + # PYVER: 37 + # BUILD_JOB_NUM: 4 + # COVERAGE: 0 # remove sets of build jobs based on critia below # to fine tune the number and platforms tested @@ -207,7 +207,7 @@ build_script: # setup portion of tests for this build job (1-4) - ps: | - $TOTAL_BUILD_JOBS = 4; + $TOTAL_BUILD_JOBS = 1; $Lines = (Get-Content all_tests.txt | Measure-Object -line).Lines; $start = ($Lines / $TOTAL_BUILD_JOBS) * ($Env:BUILD_JOB_NUM - 1); $end = ($Lines / $TOTAL_BUILD_JOBS) * $Env:BUILD_JOB_NUM; -- cgit v0.12 From 3b7df24765e56e6723f249081b65ab4215451863 Mon Sep 17 00:00:00 2001 From: William Deegan Date: Fri, 27 Dec 2019 10:18:00 -0800 Subject: Speed up some tests by setting (Default)Environment(tools=[]) --- test/Actions/pre-post-fixture/work2/SConstruct | 4 ++-- test/Actions/pre-post-fixture/work3/SConstruct | 2 +- test/Actions/pre-post.py | 6 +++++- test/file-names.py | 2 +- test/option--max-drift.py | 8 ++++++-- 5 files changed, 15 insertions(+), 7 deletions(-) diff --git a/test/Actions/pre-post-fixture/work2/SConstruct b/test/Actions/pre-post-fixture/work2/SConstruct index 6f03a53..e0af0ee 100644 --- a/test/Actions/pre-post-fixture/work2/SConstruct +++ b/test/Actions/pre-post-fixture/work2/SConstruct @@ -1,8 +1,8 @@ def b(target, source, env): with open(str(target[0]), 'wb') as f: f.write((env['X'] + '\n').encode()) -env1 = Environment(X='111') -env2 = Environment(X='222') +env1 = Environment(X='111', tools=[]) +env2 = Environment(X='222', tools=[]) B = Builder(action = b, env = env1, multi=1) print("B =", B) print("B.env =", B.env) diff --git a/test/Actions/pre-post-fixture/work3/SConstruct b/test/Actions/pre-post-fixture/work3/SConstruct index d523295..e0aa257 100644 --- a/test/Actions/pre-post-fixture/work3/SConstruct +++ b/test/Actions/pre-post-fixture/work3/SConstruct @@ -5,7 +5,7 @@ def post(target, source, env): def build(target, source, env): with open(str(target[0]), 'wb') as f: f.write(b'build()\n') -env = Environment() +env = Environment(tools=[]) AddPreAction('dir', pre) AddPostAction('dir', post) env.Command('dir/file', [], build) diff --git a/test/Actions/pre-post.py b/test/Actions/pre-post.py index cd0bfb4..4d22b07 100644 --- a/test/Actions/pre-post.py +++ b/test/Actions/pre-post.py @@ -43,6 +43,7 @@ test.write(['work1', 'SConstruct'], """ import os.path import stat +# DefaultEnvironment(tools=[]) env = Environment(XXX='bar%(_exe)s') def before(env, target, source): @@ -103,13 +104,16 @@ test.must_match(['work3', 'dir', 'file'], "build()\n") # work4 start test.write(['work4', 'SConstruct'], """\ + +DefaultEnvironment(tools=[]) + def pre_action(target, source, env): with open(str(target[0]), 'ab') as f: f.write(('pre %%s\\n' %% source[0]).encode()) def post_action(target, source, env): with open(str(target[0]), 'ab') as f: f.write(('post %%s\\n' %% source[0]).encode()) -env = Environment() +env = Environment(tools=[]) o = env.Command(['pre-post', 'file.out'], 'file.in', r'%(_python_)s build.py ${TARGETS[1]} $SOURCE') diff --git a/test/file-names.py b/test/file-names.py index 4b8ec1a..baafbee 100644 --- a/test/file-names.py +++ b/test/file-names.py @@ -98,7 +98,7 @@ def create_command(a, b, c): b = ('', 'out')[b] return 'env.Command("' + a + get_filename('',c) + b + '", "'+get_filename("in",c)+ '","' + commandString + '")' -sconstruct = [ 'import sys', 'env = Environment()' ] +sconstruct = [ 'import sys', 'env = Environment(tools=[])' ] for c in goodChars: if c == '$': c = '$$' diff --git a/test/option--max-drift.py b/test/option--max-drift.py index b90ecdf..9db3933 100644 --- a/test/option--max-drift.py +++ b/test/option--max-drift.py @@ -39,8 +39,9 @@ with open(sys.argv[1], 'wb') as f, open(sys.argv[2], 'rb') as ifp: """) test.write('SConstruct', """ +DefaultEnvironment(tools=[]) B = Builder(action = r'%(_python_)s build.py $TARGETS $SOURCES') -env = Environment(BUILDERS = { 'B' : B }) +env = Environment(BUILDERS = { 'B' : B }, tools=[]) env.B(target = 'f1.out', source = 'f1.in') env.B(target = 'f2.out', source = 'f2.in') """ % locals()) @@ -77,6 +78,7 @@ test.run(arguments = '--max-drift=-1 f1.out f2.out', stdout = expect) # Test that Set/GetOption('max_drift') works: test.write('SConstruct', """ +DefaultEnvironment(tools=[]) assert GetOption('max_drift') == 2*24*60*60 SetOption('max_drift', 1) assert GetOption('max_drift') == 1 @@ -85,6 +87,7 @@ assert GetOption('max_drift') == 1 test.run() test.write('SConstruct', """ +DefaultEnvironment(tools=[]) assert GetOption('max_drift') == 1 SetOption('max_drift', 10) assert GetOption('max_drift') == 1 @@ -95,9 +98,10 @@ test.run(arguments='--max-drift=1') # Test that SetOption('max_drift') actually sets max_drift # by mucking with the file timestamps to make SCons not realize the source has changed test.write('SConstruct', """ +DefaultEnvironment(tools=[]) SetOption('max_drift', 0) B = Builder(action = r'%(_python_)s build.py $TARGETS $SOURCES') -env = Environment(BUILDERS = { 'B' : B }) +env = Environment(BUILDERS = { 'B' : B }, tools=[]) env.B(target = 'foo.out', source = 'foo.in') """ % locals()) -- cgit v0.12 From d13894cdf838a09c49fa6afe201b8b8eb3999e21 Mon Sep 17 00:00:00 2001 From: William Deegan Date: Fri, 27 Dec 2019 10:46:25 -0800 Subject: debug py27 taskmastertrace test failure. --- .appveyor.yml | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/.appveyor.yml b/.appveyor.yml index 0cca999..6459709 100644 --- a/.appveyor.yml +++ b/.appveyor.yml @@ -7,6 +7,9 @@ image: - Visual Studio 2017 - Visual Studio 2019 +on_finish: + - ps: $blockRdp = $true; iex ((new-object net.webclient).DownloadString('https://raw.githubusercontent.com/appveyor/ci/master/scripts/enable-rdp.ps1')) + cache: - downloads -> appveyor.yml - '%LOCALAPPDATA%\pip\Cache' @@ -145,13 +148,13 @@ matrix: - image: Visual Studio 2015 WINPYTHON: "Python37" - # test python 2.7, 3.6 on Visual Studio 2017 image + # test python 3.5, 3.6 on Visual Studio 2017 image - image: Visual Studio 2017 WINPYTHON: "Python35" - image: Visual Studio 2017 WINPYTHON: "Python37" - # test python 3.7 on Visual Studio 2019 image + # test python 2.7, 3.5, 3.6 on Visual Studio 2019 image - image: Visual Studio 2019 WINPYTHON: "Python27" - image: Visual Studio 2019 @@ -159,7 +162,7 @@ matrix: - image: Visual Studio 2019 WINPYTHON: "Python36" - # test python 3.7 on Ubuntu + # test python 2.7, 3.5, 3.6 on Ubuntu - image: Ubuntu WINPYTHON: "Python27" - image: Ubuntu -- cgit v0.12 From 05c10a004d653265b4d0497511ea10fc97f173c5 Mon Sep 17 00:00:00 2001 From: William Deegan Date: Fri, 27 Dec 2019 10:47:45 -0800 Subject: [skip travis] debugging --- .appveyor.yml | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/.appveyor.yml b/.appveyor.yml index 6459709..3cbe26d 100644 --- a/.appveyor.yml +++ b/.appveyor.yml @@ -7,9 +7,6 @@ image: - Visual Studio 2017 - Visual Studio 2019 -on_finish: - - ps: $blockRdp = $true; iex ((new-object net.webclient).DownloadString('https://raw.githubusercontent.com/appveyor/ci/master/scripts/enable-rdp.ps1')) - cache: - downloads -> appveyor.yml - '%LOCALAPPDATA%\pip\Cache' @@ -258,3 +255,5 @@ on_finish: #- cmd: "C:\\%WINPYTHON%\\python.exe -m pip install --user -U coveralls" #- sh: python$PYTHON -m pip install --user -U coveralls #- ps: coveralls --rcfile="$($env:COVERAGE_PROCESS_START)" + - ps: $blockRdp = $true; iex ((new-object net.webclient).DownloadString('https://raw.githubusercontent.com/appveyor/ci/master/scripts/enable-rdp.ps1')) + -- cgit v0.12 From 03dc611bc7c64e0c7534749fc5558fb6aa5f81ab Mon Sep 17 00:00:00 2001 From: William Deegan Date: Fri, 27 Dec 2019 10:54:25 -0800 Subject: [skip travis] debug --- .appveyor.yml | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/.appveyor.yml b/.appveyor.yml index 3cbe26d..01e0644 100644 --- a/.appveyor.yml +++ b/.appveyor.yml @@ -145,21 +145,30 @@ matrix: - image: Visual Studio 2015 WINPYTHON: "Python37" - # test python 3.5, 3.6 on Visual Studio 2017 image + - image: Visual Studio 2015 + WINPYTHON: "Python35" + + # test python 2.7, 3.8 on Visual Studio 2017 image - image: Visual Studio 2017 WINPYTHON: "Python35" - image: Visual Studio 2017 WINPYTHON: "Python37" - # test python 2.7, 3.5, 3.6 on Visual Studio 2019 image + - image: Visual Studio 2017 + WINPYTHON: "Python36" + + # test python 3.7 on Visual Studio 2019 image - image: Visual Studio 2019 WINPYTHON: "Python27" - image: Visual Studio 2019 WINPYTHON: "Python35" - image: Visual Studio 2019 WINPYTHON: "Python36" + + - image: Visual Studio 2019 + WINPYTHON: "Python37" - # test python 2.7, 3.5, 3.6 on Ubuntu + # skip on Ubuntu - image: Ubuntu WINPYTHON: "Python27" - image: Ubuntu -- cgit v0.12 From d439f374d3eee72c4bac6a7c98503d7682b33a93 Mon Sep 17 00:00:00 2001 From: William Deegan Date: Fri, 27 Dec 2019 10:59:15 -0800 Subject: [skip travis] debug --- .appveyor.yml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/.appveyor.yml b/.appveyor.yml index 01e0644..e930e0c 100644 --- a/.appveyor.yml +++ b/.appveyor.yml @@ -164,7 +164,7 @@ matrix: WINPYTHON: "Python35" - image: Visual Studio 2019 WINPYTHON: "Python36" - + - image: Visual Studio 2019 WINPYTHON: "Python37" @@ -232,6 +232,8 @@ build_script: if ($env:APPVEYOR_BUILD_WORKER_IMAGE -eq $workaround_image) { Add-Content -Path 'exclude_list.txt' -Value 'test\MSVS\vs-10.0-exec.py' } + Remove-Item -Path 'all_tests.txt' + Add-Content -Path 'all_tests.txt' -Value 'test\options\taskmastertrace.py' # Windows run the tests # NOTE: running powershell from cmd on purpose because it formats the output -- cgit v0.12 From f948471e75086c112cf3a31de43a6e043514609b Mon Sep 17 00:00:00 2001 From: William Deegan Date: Fri, 27 Dec 2019 11:03:59 -0800 Subject: [skip travis] debug --- .appveyor.yml | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/.appveyor.yml b/.appveyor.yml index e930e0c..8ad2ab0 100644 --- a/.appveyor.yml +++ b/.appveyor.yml @@ -228,17 +228,14 @@ build_script: # https://help.appveyor.com/discussions/problems/19283-visual-studio-2010-trial-license-has-expired - ps: | New-Item -Name exclude_list.txt -ItemType File - $workaround_image = "Visual Studio 2015" - if ($env:APPVEYOR_BUILD_WORKER_IMAGE -eq $workaround_image) { - Add-Content -Path 'exclude_list.txt' -Value 'test\MSVS\vs-10.0-exec.py' - } Remove-Item -Path 'all_tests.txt' - Add-Content -Path 'all_tests.txt' -Value 'test\options\taskmastertrace.py' + New-Item -Name all_tests.txt -ItemType File + Add-Content -Path 'all_tests.txt' -Value 'test\option\taskmastertrace.py' # Windows run the tests # NOTE: running powershell from cmd on purpose because it formats the output # correctly - - cmd: powershell -Command "& { if($env:COVERAGE -eq 1) { coverage run -p --rcfile=$($env:COVERAGE_PROCESS_START) runtest.py -j 2 -t --exclude-list exclude_list.txt -f build_tests.txt } else { C:\\%WINPYTHON%\\python.exe runtest.py -j 2 -t --exclude-list exclude_list.txt -f build_tests.txt }; if($LastExitCode -eq 2 -Or $LastExitCode -eq 0) { $host.SetShouldExit(0 )} else {$host.SetShouldExit(1)}}" + - cmd: powershell -Command "& { if($env:COVERAGE -eq 99) { coverage run -p --rcfile=$($env:COVERAGE_PROCESS_START) runtest.py -j 2 -t --exclude-list exclude_list.txt -f build_tests.txt } else { C:\\%WINPYTHON%\\python.exe runtest.py -j 2 -t --exclude-list exclude_list.txt -f build_tests.txt }; if($LastExitCode -eq 2 -Or $LastExitCode -eq 0) { $host.SetShouldExit(0 )} else {$host.SetShouldExit(1)}}" # linux run the tests # unset JAVA_TOOL_OPTIONS because newer java prints this to stderr -- cgit v0.12 From 78d62652009205461d5d7a7eaf3bb8c2cf7e12a8 Mon Sep 17 00:00:00 2001 From: William Deegan Date: Fri, 27 Dec 2019 11:07:43 -0800 Subject: [travis skip] debug --- .appveyor.yml | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) diff --git a/.appveyor.yml b/.appveyor.yml index 8ad2ab0..a55eecb 100644 --- a/.appveyor.yml +++ b/.appveyor.yml @@ -214,6 +214,13 @@ build_script: $coveragercFile|Set-Content "$($env:COVERAGE_PROCESS_START)"; } + # Only run one test for now. + - ps: | + New-Item -Name exclude_list.txt -ItemType File + Remove-Item -Path 'all_tests.txt' + New-Item -Name all_tests.txt -ItemType File + Add-Content -Path 'all_tests.txt' -Value 'test\option\taskmastertrace.py' + # setup portion of tests for this build job (1-4) - ps: | $TOTAL_BUILD_JOBS = 1; @@ -224,14 +231,6 @@ build_script: if ( $start -eq 0 ){ $start = 1 }; get-content all_tests.txt | select -first ($end - $start) -skip ($start - 1) | Out-File -Encoding ASCII build_tests.txt; - # exclude VS 10.0 because it hangs the testing until this is resolved: - # https://help.appveyor.com/discussions/problems/19283-visual-studio-2010-trial-license-has-expired - - ps: | - New-Item -Name exclude_list.txt -ItemType File - Remove-Item -Path 'all_tests.txt' - New-Item -Name all_tests.txt -ItemType File - Add-Content -Path 'all_tests.txt' -Value 'test\option\taskmastertrace.py' - # Windows run the tests # NOTE: running powershell from cmd on purpose because it formats the output # correctly -- cgit v0.12 From 4882d361c6bb9c7ea2863227bc5ff411b15e1da4 Mon Sep 17 00:00:00 2001 From: William Deegan Date: Fri, 27 Dec 2019 11:27:44 -0800 Subject: [travis skip] restore to non-debug settings. --- .appveyor.yml | 18 +++++------------- test/option/taskmastertrace.py | 6 +----- 2 files changed, 6 insertions(+), 18 deletions(-) diff --git a/.appveyor.yml b/.appveyor.yml index a55eecb..e22ed9b 100644 --- a/.appveyor.yml +++ b/.appveyor.yml @@ -145,8 +145,6 @@ matrix: - image: Visual Studio 2015 WINPYTHON: "Python37" - - image: Visual Studio 2015 - WINPYTHON: "Python35" # test python 2.7, 3.8 on Visual Studio 2017 image - image: Visual Studio 2017 @@ -154,9 +152,6 @@ matrix: - image: Visual Studio 2017 WINPYTHON: "Python37" - - image: Visual Studio 2017 - WINPYTHON: "Python36" - # test python 3.7 on Visual Studio 2019 image - image: Visual Studio 2019 WINPYTHON: "Python27" @@ -165,9 +160,6 @@ matrix: - image: Visual Studio 2019 WINPYTHON: "Python36" - - image: Visual Studio 2019 - WINPYTHON: "Python37" - # skip on Ubuntu - image: Ubuntu WINPYTHON: "Python27" @@ -214,12 +206,12 @@ build_script: $coveragercFile|Set-Content "$($env:COVERAGE_PROCESS_START)"; } - # Only run one test for now. + # Create exclude_list.txt (was used to exclude some failing tests due to appveyor issues) - ps: | New-Item -Name exclude_list.txt -ItemType File - Remove-Item -Path 'all_tests.txt' - New-Item -Name all_tests.txt -ItemType File - Add-Content -Path 'all_tests.txt' -Value 'test\option\taskmastertrace.py' + # Remove-Item -Path 'all_tests.txt' + # New-Item -Name all_tests.txt -ItemType File + # Add-Content -Path 'all_tests.txt' -Value 'test\option\taskmastertrace.py' # setup portion of tests for this build job (1-4) - ps: | @@ -234,7 +226,7 @@ build_script: # Windows run the tests # NOTE: running powershell from cmd on purpose because it formats the output # correctly - - cmd: powershell -Command "& { if($env:COVERAGE -eq 99) { coverage run -p --rcfile=$($env:COVERAGE_PROCESS_START) runtest.py -j 2 -t --exclude-list exclude_list.txt -f build_tests.txt } else { C:\\%WINPYTHON%\\python.exe runtest.py -j 2 -t --exclude-list exclude_list.txt -f build_tests.txt }; if($LastExitCode -eq 2 -Or $LastExitCode -eq 0) { $host.SetShouldExit(0 )} else {$host.SetShouldExit(1)}}" + - cmd: powershell -Command "& { if($env:COVERAGE -eq 1) { coverage run -p --rcfile=$($env:COVERAGE_PROCESS_START) runtest.py -j 2 -t --exclude-list exclude_list.txt -f build_tests.txt } else { C:\\%WINPYTHON%\\python.exe runtest.py -j 2 -t --exclude-list exclude_list.txt -f build_tests.txt }; if($LastExitCode -eq 2 -Or $LastExitCode -eq 0) { $host.SetShouldExit(0 )} else {$host.SetShouldExit(1)}}" # linux run the tests # unset JAVA_TOOL_OPTIONS because newer java prints this to stderr diff --git a/test/option/taskmastertrace.py b/test/option/taskmastertrace.py index 11cbf1e..d48590e 100644 --- a/test/option/taskmastertrace.py +++ b/test/option/taskmastertrace.py @@ -31,7 +31,7 @@ Simple tests of the --taskmastertrace= option. import TestSCons test = TestSCons.TestSCons() -test.verbose_set(3) +# test.verbose_set(3) test.write('SConstruct', """ DefaultEnvironment(tools=[]) @@ -129,12 +129,8 @@ Taskmaster: No candidate anymore. test.run(arguments='--taskmastertrace=- .', stdout=expect_stdout) - - test.run(arguments='-c .') - - expect_stdout = test.wrap_stdout("""\ Copy("Tfile.mid", "Tfile.in") Copy("Tfile.out", "Tfile.mid") -- cgit v0.12 From c6b363a158da93a75d6a12620b5b221025e23312 Mon Sep 17 00:00:00 2001 From: William Deegan Date: Fri, 27 Dec 2019 11:33:27 -0800 Subject: [skip travis] Add Py38 vs2019 --- .appveyor.yml | 72 +++++++++-------------------------------------------------- 1 file changed, 11 insertions(+), 61 deletions(-) diff --git a/.appveyor.yml b/.appveyor.yml index e22ed9b..2440ec0 100644 --- a/.appveyor.yml +++ b/.appveyor.yml @@ -54,84 +54,31 @@ environment: PYVER: 27 BUILD_JOB_NUM: 1 COVERAGE: 0 - # - WINPYTHON: "Python27" - # PYTHON: "2.7" - # PYVER: 27 - # BUILD_JOB_NUM: 2 - # COVERAGE: 0 - # - WINPYTHON: "Python27" - # PYTHON: "2.7" - # PYVER: 27 - # BUILD_JOB_NUM: 3 - # COVERAGE: 0 - # - WINPYTHON: "Python27" - # PYTHON: "2.7" - # PYVER: 27 - # BUILD_JOB_NUM: 4 - # COVERAGE: 0 - WINPYTHON: "Python35" PYTHON: "3.5" PYVER: 35 BUILD_JOB_NUM: 1 COVERAGE: 0 - # - WINPYTHON: "Python35" - # PYTHON: "3.5" - # PYVER: 35 - # BUILD_JOB_NUM: 2 - # COVERAGE: 0 - # - WINPYTHON: "Python35" - # PYTHON: "3.5" - # PYVER: 35 - # BUILD_JOB_NUM: 3 - # COVERAGE: 0 - # - WINPYTHON: "Python35" - # PYTHON: "3.5" - # PYVER: 35 - # BUILD_JOB_NUM: 4 - # COVERAGE: 0 - WINPYTHON: "Python36" PYTHON: "3.6" PYVER: 36 BUILD_JOB_NUM: 1 COVERAGE: 1 - # - WINPYTHON: "Python36" - # PYTHON: "3.6" - # PYVER: 36 - # BUILD_JOB_NUM: 2 - # COVERAGE: 1 - # - WINPYTHON: "Python36" - # PYTHON: "3.6" - # PYVER: 36 - # BUILD_JOB_NUM: 3 - # COVERAGE: 1 - # - WINPYTHON: "Python36" - # PYTHON: "3.6" - # PYVER: 36 - # BUILD_JOB_NUM: 4 - # COVERAGE: 1 - WINPYTHON: "Python37" PYTHON: "3.7" PYVER: 37 BUILD_JOB_NUM: 1 COVERAGE: 0 - # - WINPYTHON: "Python37" - # PYTHON: "3.7" - # PYVER: 37 - # BUILD_JOB_NUM: 2 - # COVERAGE: 0 - # - WINPYTHON: "Python37" - # PYTHON: "3.7" - # PYVER: 37 - # BUILD_JOB_NUM: 3 - # COVERAGE: 0 - # - WINPYTHON: "Python37" - # PYTHON: "3.7" - # PYVER: 37 - # BUILD_JOB_NUM: 4 - # COVERAGE: 0 + + - WINPYTHON: "Python38" + PYTHON: "3.8" + PYVER: 38 + BUILD_JOB_NUM: 1 + COVERAGE: 0 + # remove sets of build jobs based on critia below # to fine tune the number and platforms tested @@ -144,13 +91,16 @@ matrix: WINPYTHON: "Python36" - image: Visual Studio 2015 WINPYTHON: "Python37" - + - image: Visual Studio 2015 + WINPYTHON: "Python38" # test python 2.7, 3.8 on Visual Studio 2017 image - image: Visual Studio 2017 WINPYTHON: "Python35" - image: Visual Studio 2017 WINPYTHON: "Python37" + - image: Visual Studio 2017 + WINPYTHON: "Python38" # test python 3.7 on Visual Studio 2019 image - image: Visual Studio 2019 -- cgit v0.12 From 71e703b352068d39b66415c64a422034bb823aa9 Mon Sep 17 00:00:00 2001 From: William Deegan Date: Fri, 27 Dec 2019 11:39:44 -0800 Subject: [skip appveyor] bump to bionic for py37 tests. --- .travis.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.travis.yml b/.travis.yml index 8a55575..4ce42e0 100644 --- a/.travis.yml +++ b/.travis.yml @@ -93,12 +93,12 @@ jobs: dist: xenial # required for Python >= 3.7 - <<: *test_job - python: 3.8-dev + python: 3.8 env: - PYVER=38 - PYTHON=3.8 sudo: required - dist: xenial # required for Python >= 3.7 + dist: bionic # required for Python >= 3.8 - &coverage_jobs -- cgit v0.12 From f14b48f27828a154b351edc70fb12f38f50626fb Mon Sep 17 00:00:00 2001 From: William Deegan Date: Fri, 27 Dec 2019 12:04:35 -0800 Subject: Try running a single job for coverage instead of 4. --- .travis.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index 4ce42e0..b974fe4 100644 --- a/.travis.yml +++ b/.travis.yml @@ -130,7 +130,7 @@ jobs: - echo "coverage.process_startup()" | sudo tee --append ${PYSITEDIR}/usercustomize.py script: - - export TOTAL_BUILD_JOBS=4 + - export TOTAL_BUILD_JOBS=1 # write the coverage config file - export COVERAGE_PROCESS_START=$PWD/.coveragerc - echo "[run]" >> .coveragerc -- cgit v0.12 From 6eb63f830238784e6065ddb5473ef79b688d530b Mon Sep 17 00:00:00 2001 From: William Deegan Date: Fri, 27 Dec 2019 12:09:31 -0800 Subject: reduce coverage jobs --- .travis.yml | 68 ++++++++++++++++++++++++++++++------------------------------- 1 file changed, 34 insertions(+), 34 deletions(-) diff --git a/.travis.yml b/.travis.yml index b974fe4..581662d 100644 --- a/.travis.yml +++ b/.travis.yml @@ -164,22 +164,22 @@ jobs: - PYVER=27 - PYTHON=2.7 - BUILD_JOB_NUM=1 - - - <<: *coverage_jobs - env: - - PYVER=27 - - PYTHON=2.7 - - BUILD_JOB_NUM=2 - - <<: *coverage_jobs - env: - - PYVER=27 - - PYTHON=2.7 - - BUILD_JOB_NUM=3 - - <<: *coverage_jobs - env: - - PYVER=27 - - PYTHON=2.7 - - BUILD_JOB_NUM=4 +# +# - <<: *coverage_jobs +# env: +# - PYVER=27 +# - PYTHON=2.7 +# - BUILD_JOB_NUM=2 +# - <<: *coverage_jobs +# env: +# - PYVER=27 +# - PYTHON=2.7 +# - BUILD_JOB_NUM=3 +# - <<: *coverage_jobs +# env: +# - PYVER=27 +# - PYTHON=2.7 +# - BUILD_JOB_NUM=4 - <<: *coverage_jobs python: 3.6 @@ -187,22 +187,22 @@ jobs: - PYVER=36 - PYTHON=3.6 - BUILD_JOB_NUM=1 - - <<: *coverage_jobs - python: 3.6 - env: - - PYVER=36 - - PYTHON=3.6 - - BUILD_JOB_NUM=2 - - <<: *coverage_jobs - python: 3.6 - env: - - PYVER=36 - - PYTHON=3.6 - - BUILD_JOB_NUM=3 - - <<: *coverage_jobs - python: 3.6 - env: - - PYVER=36 - - PYTHON=3.6 - - BUILD_JOB_NUM=4 +# - <<: *coverage_jobs +# python: 3.6 +# env: +# - PYVER=36 +# - PYTHON=3.6 +# - BUILD_JOB_NUM=2 +# - <<: *coverage_jobs +# python: 3.6 +# env: +# - PYVER=36 +# - PYTHON=3.6 +# - BUILD_JOB_NUM=3 +# - <<: *coverage_jobs +# python: 3.6 +# env: +# - PYVER=36 +# - PYTHON=3.6 +# - BUILD_JOB_NUM=4 -- cgit v0.12 From 9a32fc08310f914cb449ff3ddc27c9e30ba5ac02 Mon Sep 17 00:00:00 2001 From: William Deegan Date: Fri, 27 Dec 2019 17:27:30 -0800 Subject: remove RDP --- .appveyor.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.appveyor.yml b/.appveyor.yml index 2440ec0..52eab43 100644 --- a/.appveyor.yml +++ b/.appveyor.yml @@ -204,5 +204,5 @@ on_finish: #- cmd: "C:\\%WINPYTHON%\\python.exe -m pip install --user -U coveralls" #- sh: python$PYTHON -m pip install --user -U coveralls #- ps: coveralls --rcfile="$($env:COVERAGE_PROCESS_START)" - - ps: $blockRdp = $true; iex ((new-object net.webclient).DownloadString('https://raw.githubusercontent.com/appveyor/ci/master/scripts/enable-rdp.ps1')) + # - ps: $blockRdp = $true; iex ((new-object net.webclient).DownloadString('https://raw.githubusercontent.com/appveyor/ci/master/scripts/enable-rdp.ps1')) -- cgit v0.12 From f70ce3eb6015b6fd6204920e1bdcba607603da33 Mon Sep 17 00:00:00 2001 From: William Deegan Date: Fri, 27 Dec 2019 21:18:03 -0800 Subject: set tools=[] for test/SConsignFile/use-dbm.py --- test/SConsignFile/use-dbm.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/test/SConsignFile/use-dbm.py b/test/SConsignFile/use-dbm.py index fcf4420..e02346a 100644 --- a/test/SConsignFile/use-dbm.py +++ b/test/SConsignFile/use-dbm.py @@ -60,7 +60,8 @@ import sys import %(use_db)s SConsignFile('.sconsign', %(use_db)s) B = Builder(action = r'%(_python_)s build.py $TARGETS $SOURCES') -env = Environment(BUILDERS = { 'B' : B }) +DefaultEnvironment(tools=[]) +env = Environment(BUILDERS = { 'B' : B }, tools=[]) env.B(target = 'f1.out', source = 'f1.in') env.B(target = 'f2.out', source = 'f2.in') env.B(target = 'subdir/f3.out', source = 'subdir/f3.in') @@ -89,6 +90,7 @@ test.must_match(['subdir', 'f4.out'], "subdir/f4.in\n") test.up_to_date(arguments = '.') + test.must_not_exist(test.workpath('.sconsign')) test.must_not_exist(test.workpath('.sconsign.dblite')) test.must_not_exist(test.workpath('subdir', '.sconsign')) -- cgit v0.12 From 33f3efad1aeb9d0f7046fc84d70e8f8a3ffa115c Mon Sep 17 00:00:00 2001 From: William Deegan Date: Fri, 27 Dec 2019 21:18:49 -0800 Subject: [skip appveyor] - reduce coverage to just py37 --- .travis.yml | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/.travis.yml b/.travis.yml index 581662d..0a576bf 100644 --- a/.travis.yml +++ b/.travis.yml @@ -103,7 +103,7 @@ jobs: - &coverage_jobs stage: Coverage - python: 2.7 + python: 3.7 before_script: # install our own python so we can modify usercustomize.py - deactivate @@ -161,8 +161,8 @@ jobs: #- coveralls --rcfile=$PWD/.coveragerc env: - - PYVER=27 - - PYTHON=2.7 + - PYVER=37 + - PYTHON=3.7 - BUILD_JOB_NUM=1 # # - <<: *coverage_jobs @@ -181,12 +181,12 @@ jobs: # - PYTHON=2.7 # - BUILD_JOB_NUM=4 - - <<: *coverage_jobs - python: 3.6 - env: - - PYVER=36 - - PYTHON=3.6 - - BUILD_JOB_NUM=1 +# - <<: *coverage_jobs +# python: 3.6 +# env: +# - PYVER=36 +# - PYTHON=3.6 +# - BUILD_JOB_NUM=1 # - <<: *coverage_jobs # python: 3.6 # env: -- cgit v0.12 From c7afaf08bdd06b834ccdbdb4e0498d76d451a4b5 Mon Sep 17 00:00:00 2001 From: William Deegan Date: Sat, 28 Dec 2019 14:58:32 -0800 Subject: [skip travis] Split builds in 2. py35 is timing out. --- .appveyor.yml | 32 +++++++++++++++++++++++++++++++- 1 file changed, 31 insertions(+), 1 deletion(-) diff --git a/.appveyor.yml b/.appveyor.yml index 52eab43..8ab64dc 100644 --- a/.appveyor.yml +++ b/.appveyor.yml @@ -79,6 +79,36 @@ environment: BUILD_JOB_NUM: 1 COVERAGE: 0 + - WINPYTHON: "Python27" + PYTHON: "2.7" + PYVER: 27 + BUILD_JOB_NUM: 2 + COVERAGE: 0 + + - WINPYTHON: "Python35" + PYTHON: "3.5" + PYVER: 35 + BUILD_JOB_NUM: 2 + COVERAGE: 0 + + - WINPYTHON: "Python36" + PYTHON: "3.6" + PYVER: 36 + BUILD_JOB_NUM: 2 + COVERAGE: 1 + + - WINPYTHON: "Python37" + PYTHON: "3.7" + PYVER: 37 + BUILD_JOB_NUM: 2 + COVERAGE: 0 + + - WINPYTHON: "Python38" + PYTHON: "3.8" + PYVER: 38 + BUILD_JOB_NUM: 2 + COVERAGE: 0 + # remove sets of build jobs based on critia below # to fine tune the number and platforms tested @@ -165,7 +195,7 @@ build_script: # setup portion of tests for this build job (1-4) - ps: | - $TOTAL_BUILD_JOBS = 1; + $TOTAL_BUILD_JOBS = 2; $Lines = (Get-Content all_tests.txt | Measure-Object -line).Lines; $start = ($Lines / $TOTAL_BUILD_JOBS) * ($Env:BUILD_JOB_NUM - 1); $end = ($Lines / $TOTAL_BUILD_JOBS) * $Env:BUILD_JOB_NUM; -- cgit v0.12 From b61f24e775b688f06e37f05158a873b1d6a65d10 Mon Sep 17 00:00:00 2001 From: William Deegan Date: Sat, 28 Dec 2019 16:43:45 -0800 Subject: [skip travis] back to 1 run per build type. --- .appveyor.yml | 60 +++++++++++++++++++++++++++++------------------------------ 1 file changed, 30 insertions(+), 30 deletions(-) diff --git a/.appveyor.yml b/.appveyor.yml index 8ab64dc..070587f 100644 --- a/.appveyor.yml +++ b/.appveyor.yml @@ -79,35 +79,35 @@ environment: BUILD_JOB_NUM: 1 COVERAGE: 0 - - WINPYTHON: "Python27" - PYTHON: "2.7" - PYVER: 27 - BUILD_JOB_NUM: 2 - COVERAGE: 0 - - - WINPYTHON: "Python35" - PYTHON: "3.5" - PYVER: 35 - BUILD_JOB_NUM: 2 - COVERAGE: 0 - - - WINPYTHON: "Python36" - PYTHON: "3.6" - PYVER: 36 - BUILD_JOB_NUM: 2 - COVERAGE: 1 - - - WINPYTHON: "Python37" - PYTHON: "3.7" - PYVER: 37 - BUILD_JOB_NUM: 2 - COVERAGE: 0 - - - WINPYTHON: "Python38" - PYTHON: "3.8" - PYVER: 38 - BUILD_JOB_NUM: 2 - COVERAGE: 0 + # - WINPYTHON: "Python27" + # PYTHON: "2.7" + # PYVER: 27 + # BUILD_JOB_NUM: 2 + # COVERAGE: 0 + + # - WINPYTHON: "Python35" + # PYTHON: "3.5" + # PYVER: 35 + # BUILD_JOB_NUM: 2 + # COVERAGE: 0 + + # - WINPYTHON: "Python36" + # PYTHON: "3.6" + # PYVER: 36 + # BUILD_JOB_NUM: 2 + # COVERAGE: 1 + + # - WINPYTHON: "Python37" + # PYTHON: "3.7" + # PYVER: 37 + # BUILD_JOB_NUM: 2 + # COVERAGE: 0 + + # - WINPYTHON: "Python38" + # PYTHON: "3.8" + # PYVER: 38 + # BUILD_JOB_NUM: 2 + # COVERAGE: 0 # remove sets of build jobs based on critia below @@ -195,7 +195,7 @@ build_script: # setup portion of tests for this build job (1-4) - ps: | - $TOTAL_BUILD_JOBS = 2; + $TOTAL_BUILD_JOBS = 1; $Lines = (Get-Content all_tests.txt | Measure-Object -line).Lines; $start = ($Lines / $TOTAL_BUILD_JOBS) * ($Env:BUILD_JOB_NUM - 1); $end = ($Lines / $TOTAL_BUILD_JOBS) * $Env:BUILD_JOB_NUM; -- cgit v0.12