From 6bd928b26483c0833be69360eac422f779f0957c Mon Sep 17 00:00:00 2001 From: Juan Lang Date: Wed, 14 Nov 2012 13:01:08 -0800 Subject: Use .wixobj rather than .wxiobj as the suffix for WiX compiler output --- src/engine/SCons/Tool/wix.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/engine/SCons/Tool/wix.py b/src/engine/SCons/Tool/wix.py index 32cc1f1..eb8d15d 100644 --- a/src/engine/SCons/Tool/wix.py +++ b/src/engine/SCons/Tool/wix.py @@ -50,12 +50,12 @@ def generate(env): object_builder = SCons.Builder.Builder( action = '$WIXCANDLECOM', - suffix = '.wxiobj', + suffix = '.wixobj', src_suffix = '.wxs') linker_builder = SCons.Builder.Builder( action = '$WIXLIGHTCOM', - src_suffix = '.wxiobj', + src_suffix = '.wixobj', src_builder = object_builder) env['BUILDERS']['WiX'] = linker_builder -- cgit v0.12 From 649f2dee6dcaaeb6897b1753ad0a6e14a22b0b9f Mon Sep 17 00:00:00 2001 From: anatoly techtonik Date: Fri, 16 Nov 2012 16:58:03 +0300 Subject: Ability to run scripts/scons.py directly from source checkout. --- src/CHANGES.txt | 3 +++ src/script/scons.py | 10 +++++++++- 2 files changed, 12 insertions(+), 1 deletion(-) diff --git a/src/CHANGES.txt b/src/CHANGES.txt index 2c89d8d..2378ba0 100644 --- a/src/CHANGES.txt +++ b/src/CHANGES.txt @@ -6,6 +6,9 @@ RELEASE 2.X.X - + From anatoly techtonik: + + Ability to run scripts/scons.py directly from source checkout. + From Alexey Klimkin: - Fix nested LIBPATH expansion by flattening sequences in subst_path. diff --git a/src/script/scons.py b/src/script/scons.py index 86d2562..cd8b432 100644 --- a/src/script/scons.py +++ b/src/script/scons.py @@ -184,7 +184,15 @@ sys.path = libs + sys.path ############################################################################## if __name__ == "__main__": - import SCons.Script + try: + import SCons.Script + except: + ROOT = os.path.join(os.path.abspath(os.path.dirname(__file__)), '..', 'engine') + if os.path.exists(ROOT): + sys.path += [ROOT] + print("SCons import failed. Trying to run from source directory") + import SCons.Script + # this does all the work, and calls sys.exit # with the proper exit status when done. SCons.Script.main() -- cgit v0.12 From 8472b14ce10db2aec806dbabaf713fd8a6fb0750 Mon Sep 17 00:00:00 2001 From: garyo Date: Sat, 17 Nov 2012 22:31:36 -0500 Subject: Added Wix test and made a few Wix constants into construction vars. --- src/CHANGES.txt | 3 ++ src/engine/SCons/Tool/wix.py | 8 +++-- src/engine/SCons/Tool/wixTests.py | 62 +++++++++++++++++++++++++++++++++++++++ 3 files changed, 70 insertions(+), 3 deletions(-) create mode 100644 src/engine/SCons/Tool/wixTests.py diff --git a/src/CHANGES.txt b/src/CHANGES.txt index 2c89d8d..4af8d49 100644 --- a/src/CHANGES.txt +++ b/src/CHANGES.txt @@ -6,6 +6,9 @@ RELEASE 2.X.X - + From Juan Lang: + - Fix WiX Tool to use .wixobj rather than .wxiobj for compiler output + From Alexey Klimkin: - Fix nested LIBPATH expansion by flattening sequences in subst_path. diff --git a/src/engine/SCons/Tool/wix.py b/src/engine/SCons/Tool/wix.py index eb8d15d..c898949 100644 --- a/src/engine/SCons/Tool/wix.py +++ b/src/engine/SCons/Tool/wix.py @@ -47,15 +47,17 @@ def generate(env): env['WIXLIGHTFLAGS'].append( '-nologo' ) env['WIXLIGHTCOM'] = "$WIXLIGHT $WIXLIGHTFLAGS -out ${TARGET} ${SOURCES}" + env['WIXSRCSUF'] = '.wxs' + env['WIXOBJSUF'] = '.wixobj' object_builder = SCons.Builder.Builder( action = '$WIXCANDLECOM', - suffix = '.wixobj', - src_suffix = '.wxs') + suffix = '$WIXOBJSUF', + src_suffix = '$WIXSRCSUF') linker_builder = SCons.Builder.Builder( action = '$WIXLIGHTCOM', - src_suffix = '.wixobj', + src_suffix = '$WIXOBJSUF', src_builder = object_builder) env['BUILDERS']['WiX'] = linker_builder diff --git a/src/engine/SCons/Tool/wixTests.py b/src/engine/SCons/Tool/wixTests.py new file mode 100644 index 0000000..8240d68 --- /dev/null +++ b/src/engine/SCons/Tool/wixTests.py @@ -0,0 +1,62 @@ +# +# __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__" + +import unittest +import os.path +import os +import sys + +import SCons.Errors +from SCons.Tool.wix import * +from SCons.Environment import Environment + +import TestCmd + +# create fake candle and light, so the tool's exists() method will succeed +test = TestCmd.TestCmd(workdir = '') +test.write('candle.exe', 'rem this is candle') +test.write('light.exe', 'rem this is light') +os.environ['PATH'] += os.pathsep + test.workdir + +class WixTestCase(unittest.TestCase): + def test_vars(self): + """Test that WiX tool adds vars""" + env = Environment(tools=['wix']) + assert env['WIXCANDLE'] is not None + assert env['WIXCANDLEFLAGS'] is not None + assert '-loc' in env['WIXLIGHTFLAGS'] + assert env.subst('$WIXOBJSUF') == '.wixobj' + assert env.subst('$WIXSRCSUF') == '.wxs' + +if __name__ == "__main__": + suite = unittest.makeSuite(WixTestCase, 'test_') + if not unittest.TextTestRunner().run(suite).wasSuccessful(): + sys.exit(1) + +# Local Variables: +# tab-width:4 +# indent-tabs-mode:nil +# End: +# vim: set expandtab tabstop=4 shiftwidth=4: -- cgit v0.12 From b5cf704972f2b25ba609108351076eb5515fb50d Mon Sep 17 00:00:00 2001 From: anatoly techtonik Date: Thu, 22 Nov 2012 17:42:02 +0300 Subject: Clean up remnants of Optik module which was removed in SCons 0.98 (revision 6661c9ea429f by Steven Knight) --- doc/SConscript | 1 - src/CHANGES.txt | 3 +++ src/engine/SCons/Optik/.aeignore | 5 ----- 3 files changed, 3 insertions(+), 6 deletions(-) delete mode 100644 src/engine/SCons/Optik/.aeignore diff --git a/doc/SConscript b/doc/SConscript index 9bf40bc..a3d6fe7 100644 --- a/doc/SConscript +++ b/doc/SConscript @@ -544,7 +544,6 @@ else: e = os.path.join('#src', 'engine') manifest_in = File(os.path.join(e, 'MANIFEST.in')).rstr() sources = [x[:-1] for x in open(manifest_in).readlines()] - sources = [x for x in sources if x.find('Optik') == -1] sources = [x for x in sources if x.find('Platform') == -1] sources = [x for x in sources if x.find('Tool') == -1] # XXX diff --git a/src/CHANGES.txt b/src/CHANGES.txt index 13d8f7c..ff8290e 100644 --- a/src/CHANGES.txt +++ b/src/CHANGES.txt @@ -1763,6 +1763,9 @@ RELEASE 0.97.0d20070809 - Fri, 10 Aug 2007 10:51:27 -0500 - Add a new AddOption() function to support user-defined command- line flags (like --prefix=, --force, etc.). + - Replace modified Optik version with new optparse compatibility module + for command line processing in Scripts/SConsOptions.py + - Push and retrieve built symlinks to/from a CacheDir() as actual symlinks, not by copying the file contents. diff --git a/src/engine/SCons/Optik/.aeignore b/src/engine/SCons/Optik/.aeignore deleted file mode 100644 index 22ebd62..0000000 --- a/src/engine/SCons/Optik/.aeignore +++ /dev/null @@ -1,5 +0,0 @@ -*,D -*.pyc -.*.swp -.consign -.sconsign -- cgit v0.12 From 820af04df5e741db15f7429f1513b7e82d2b12b4 Mon Sep 17 00:00:00 2001 From: Juan Lang Date: Wed, 5 Dec 2012 17:07:53 -0800 Subject: Support building with WiX releases after 2.0 --- src/CHANGES.txt | 1 + src/engine/SCons/Tool/wix.py | 19 +++++++++++-------- src/engine/SCons/Tool/wixTests.py | 2 +- 3 files changed, 13 insertions(+), 9 deletions(-) diff --git a/src/CHANGES.txt b/src/CHANGES.txt index ff8290e..8905e72 100644 --- a/src/CHANGES.txt +++ b/src/CHANGES.txt @@ -11,6 +11,7 @@ RELEASE 2.X.X - From Juan Lang: - Fix WiX Tool to use .wixobj rather than .wxiobj for compiler output + - Support building with WiX releases after 2.0 From Alexey Klimkin: - Fix nested LIBPATH expansion by flattening sequences in subst_path. diff --git a/src/engine/SCons/Tool/wix.py b/src/engine/SCons/Tool/wix.py index c898949..04136ce 100644 --- a/src/engine/SCons/Tool/wix.py +++ b/src/engine/SCons/Tool/wix.py @@ -68,7 +68,6 @@ def exists(env): # try to find the candle.exe and light.exe tools and # add the install directory to light libpath. - #for path in os.environ['PATH'].split(os.pathsep): for path in os.environ['PATH'].split(os.pathsep): if not path: continue @@ -82,13 +81,17 @@ def exists(env): # search for the tools in the PATH environment variable try: - if env['WIXCANDLE'] in os.listdir(path) and\ - env['WIXLIGHT'] in os.listdir(path): - env.PrependENVPath('PATH', path) - env['WIXLIGHTFLAGS'] = [ os.path.join( path, 'wixui.wixlib' ), - '-loc', - os.path.join( path, 'WixUI_en-us.wxl' ) ] - return 1 + files = os.listdir(path) + if env['WIXCANDLE'] in files and env['WIXLIGHT'] in files: + env.PrependENVPath('PATH', path) + # include appropriate flags if running WiX 2.0 + if 'wixui.wixlib' in files and 'WixUI_en-us.wxl' in files: + env['WIXLIGHTFLAGS'] = [ os.path.join( path, 'wixui.wixlib' ), + '-loc', + os.path.join( path, 'WixUI_en-us.wxl' ) ] + else: + env['WIXLIGHTFLAGS'] = [] + return 1 except OSError: pass # ignore this, could be a stale PATH entry. diff --git a/src/engine/SCons/Tool/wixTests.py b/src/engine/SCons/Tool/wixTests.py index 8240d68..c815dd0 100644 --- a/src/engine/SCons/Tool/wixTests.py +++ b/src/engine/SCons/Tool/wixTests.py @@ -46,7 +46,7 @@ class WixTestCase(unittest.TestCase): env = Environment(tools=['wix']) assert env['WIXCANDLE'] is not None assert env['WIXCANDLEFLAGS'] is not None - assert '-loc' in env['WIXLIGHTFLAGS'] + assert env['WIXLIGHTFLAGS'] is not None assert env.subst('$WIXOBJSUF') == '.wixobj' assert env.subst('$WIXSRCSUF') == '.wxs' -- cgit v0.12 From 6ab0a95225870da7efba3cff64133234e9973048 Mon Sep 17 00:00:00 2001 From: anatoly techtonik Date: Thu, 22 Nov 2012 18:26:24 +0300 Subject: Hide deprecated --debug={dtree,stree,tree} from --help output --- src/CHANGES.txt | 1 + src/engine/SCons/Script/SConsOptions.py | 21 +++++++++++---------- 2 files changed, 12 insertions(+), 10 deletions(-) diff --git a/src/CHANGES.txt b/src/CHANGES.txt index 8905e72..5c8f821 100644 --- a/src/CHANGES.txt +++ b/src/CHANGES.txt @@ -8,6 +8,7 @@ RELEASE 2.X.X - From Anatoly Techtonik: - Added ability to run scripts/scons.py directly from source checkout + - Hide deprecated --debug={dtree,stree,tree} from --help output From Juan Lang: - Fix WiX Tool to use .wixobj rather than .wxiobj for compiler output diff --git a/src/engine/SCons/Script/SConsOptions.py b/src/engine/SCons/Script/SConsOptions.py index 3066c65..6f5293d 100644 --- a/src/engine/SCons/Script/SConsOptions.py +++ b/src/engine/SCons/Script/SConsOptions.py @@ -599,22 +599,23 @@ def Parser(version): debug_options = ["count", "duplicate", "explain", "findlibs", "includes", "memoizer", "memory", "objects", "pdb", "prepare", "presub", "stacktrace", - "time"] + list(deprecated_debug_options.keys()) + "time"] def opt_debug(option, opt, value, parser, debug_options=debug_options, deprecated_debug_options=deprecated_debug_options): if value in debug_options: parser.values.debug.append(value) - if value in deprecated_debug_options.keys(): - try: - parser.values.delayed_warnings - except AttributeError: - parser.values.delayed_warnings = [] - msg = deprecated_debug_options[value] - w = "The --debug=%s option is deprecated%s." % (value, msg) - t = (SCons.Warnings.DeprecatedDebugOptionsWarning, w) - parser.values.delayed_warnings.append(t) + elif value in deprecated_debug_options.keys(): + parser.values.debug.append(value) + try: + parser.values.delayed_warnings + except AttributeError: + parser.values.delayed_warnings = [] + msg = deprecated_debug_options[value] + w = "The --debug=%s option is deprecated%s." % (value, msg) + t = (SCons.Warnings.DeprecatedDebugOptionsWarning, w) + parser.values.delayed_warnings.append(t) else: raise OptionValueError("Warning: %s is not a valid debug type" % value) opt_debug_help = "Print various types of debugging information: %s." \ -- cgit v0.12 From 2c1012c0ebff9bd7019246bd79b9e89170caaae3 Mon Sep 17 00:00:00 2001 From: anatoly techtonik Date: Fri, 7 Dec 2012 12:20:46 +0300 Subject: Cleanup admin/ directory, which was moved to HOWTO in 823bdc5faf25 --- admin/.aeignore | 5 ----- 1 file changed, 5 deletions(-) delete mode 100644 admin/.aeignore diff --git a/admin/.aeignore b/admin/.aeignore deleted file mode 100644 index 22ebd62..0000000 --- a/admin/.aeignore +++ /dev/null @@ -1,5 +0,0 @@ -*,D -*.pyc -.*.swp -.consign -.sconsign -- cgit v0.12 From c3a75e1a8cb6e8de95d6ed9c77923c80a2b8cfd4 Mon Sep 17 00:00:00 2001 From: anatoly techtonik Date: Fri, 7 Dec 2012 18:44:03 +0300 Subject: Add hints about valid choices to error messages from option parser --- src/CHANGES.txt | 1 + src/engine/SCons/Script/SConsOptions.py | 18 ++++++++++++------ 2 files changed, 13 insertions(+), 6 deletions(-) diff --git a/src/CHANGES.txt b/src/CHANGES.txt index 5c8f821..6136f81 100644 --- a/src/CHANGES.txt +++ b/src/CHANGES.txt @@ -9,6 +9,7 @@ RELEASE 2.X.X - From Anatoly Techtonik: - Added ability to run scripts/scons.py directly from source checkout - Hide deprecated --debug={dtree,stree,tree} from --help output + - Error messages from option parser now include hints about valid choices From Juan Lang: - Fix WiX Tool to use .wixobj rather than .wxiobj for compiler output diff --git a/src/engine/SCons/Script/SConsOptions.py b/src/engine/SCons/Script/SConsOptions.py index 6f5293d..645ab11 100644 --- a/src/engine/SCons/Script/SConsOptions.py +++ b/src/engine/SCons/Script/SConsOptions.py @@ -268,8 +268,9 @@ class SConsOptionParser(optparse.OptionParser): preserve_unknown_options = False def error(self, msg): + # overriden OptionValueError exception handler self.print_usage(sys.stderr) - sys.stderr.write("SCons error: %s\n" % msg) + sys.stderr.write("SCons Error: %s\n" % msg) sys.exit(2) def _process_long_opt(self, rargs, values): @@ -568,11 +569,15 @@ def Parser(version): action="store_true", help="Print build actions for files from CacheDir.") + def opt_invalid(group, value, options): + errmsg = "`%s' is not a valid %s option type, try:\n" % (value, group) + return errmsg + " %s" % ", ".join(options) + config_options = ["auto", "force" ,"cache"] def opt_config(option, opt, value, parser, c_options=config_options): if not value in c_options: - raise OptionValueError("Warning: %s is not a valid config type" % value) + raise OptionValueError(opt_invalid('config', value, c_options)) setattr(parser.values, option.dest, value) opt_config_help = "Controls Configure subsystem: %s." \ % ", ".join(config_options) @@ -617,7 +622,7 @@ def Parser(version): t = (SCons.Warnings.DeprecatedDebugOptionsWarning, w) parser.values.delayed_warnings.append(t) else: - raise OptionValueError("Warning: %s is not a valid debug type" % value) + raise OptionValueError(opt_invalid('debug', value, debug_options)) opt_debug_help = "Print various types of debugging information: %s." \ % ", ".join(debug_options) op.add_option('--debug', @@ -631,7 +636,7 @@ def Parser(version): try: diskcheck_value = diskcheck_convert(value) except ValueError, e: - raise OptionValueError("Warning: `%s' is not a valid diskcheck type" % e) + raise OptionValueError("`%s' is not a valid diskcheck type" % e) setattr(parser.values, option.dest, diskcheck_value) op.add_option('--diskcheck', @@ -643,7 +648,8 @@ def Parser(version): def opt_duplicate(option, opt, value, parser): if not value in SCons.Node.FS.Valid_Duplicates: - raise OptionValueError("`%s' is not a valid duplication style." % value) + raise OptionValueError(opt_invalid('duplication', value, + SCons.Node.FS.Valid_Duplicates)) setattr(parser.values, option.dest, value) # Set the duplicate style right away so it can affect linking # of SConscript files. @@ -808,7 +814,7 @@ def Parser(version): elif o == 'status': tp.status = True else: - raise OptionValueError("Warning: %s is not a valid --tree option" % o) + raise OptionValueError(opt_invalid('--tree', o, tree_options)) parser.values.tree_printers.append(tp) opt_tree_help = "Print a dependency tree in various formats: %s." \ -- cgit v0.12 From fe91cb8242f03fd95187b7c25bde6614d491bc5e Mon Sep 17 00:00:00 2001 From: Gary Oberbrunner Date: Sun, 9 Dec 2012 01:42:32 +0000 Subject: Updated tests for Anatoly Techtonik's option error handling improvements. --- test/option--duplicate.py | 3 ++- test/option--tree.py | 60 +++++++++++++++++++++++++++++++++++++++++++++++ test/option-unknown.py | 4 ++-- 3 files changed, 64 insertions(+), 3 deletions(-) create mode 100644 test/option--tree.py diff --git a/test/option--duplicate.py b/test/option--duplicate.py index 7524c96..cccc185 100644 --- a/test/option--duplicate.py +++ b/test/option--duplicate.py @@ -123,7 +123,8 @@ RunTest('copy', type, bss) test.run(arguments='--duplicate=nonsense', status=2, stderr="""\ usage: scons [OPTION] [TARGET] ... -SCons error: `nonsense' is not a valid duplication style. +SCons Error: `nonsense' is not a valid duplication option type, try: + hard-soft-copy, soft-hard-copy, hard-copy, soft-copy, copy """) test.pass_test() diff --git a/test/option--tree.py b/test/option--tree.py new file mode 100644 index 0000000..a50433c --- /dev/null +++ b/test/option--tree.py @@ -0,0 +1,60 @@ +#!/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__" + +import TestSCons + +test = TestSCons.TestSCons() + +test.write('SConstruct', "") + +test.run(arguments = '-Q --tree=prune', + stdout = """scons: `.' is up to date. ++-. + +-SConstruct +""") + +test.run(arguments = '-Q --tree=foofoo', + stderr = """usage: scons [OPTION] [TARGET] ... + +SCons Error: `foofoo' is not a valid --tree option type, try: + all, derived, prune, status +""", + status = 2) + +test.run(arguments = '--debug=tree', + stderr = """ +scons: warning: The --debug=tree option is deprecated; please use --tree=all instead. +.* +""", + status = 0, match=TestSCons.match_re_dotall) + +test.pass_test() + +# Local Variables: +# tab-width:4 +# indent-tabs-mode:nil +# End: +# vim: set expandtab tabstop=4 shiftwidth=4: diff --git a/test/option-unknown.py b/test/option-unknown.py index cbda8dd..8b42762 100644 --- a/test/option-unknown.py +++ b/test/option-unknown.py @@ -33,14 +33,14 @@ test.write('SConstruct', "") test.run(arguments = '-Z', stderr = """usage: scons [OPTION] [TARGET] ... -SCons error: no such option: -Z +SCons Error: no such option: -Z """, status = 2) test.run(arguments = '--ZizzerZazzerZuzz', stderr = """usage: scons [OPTION] [TARGET] ... -SCons error: no such option: --ZizzerZazzerZuzz +SCons Error: no such option: --ZizzerZazzerZuzz """, status = 2) -- cgit v0.12 From 0ee050e090f0acbb3909cf42822a8b86dbafc3c0 Mon Sep 17 00:00:00 2001 From: anatoly techtonik Date: Sat, 8 Dec 2012 01:30:14 +0300 Subject: Removed some pre-Python 2.4 compatibility code --- QMTest/TestSCons_time.py | 20 -------------- src/engine/SCons/Script/SConscript.py | 9 ++----- src/engine/SCons/compat/_scons_builtins.py | 43 ------------------------------ src/script/scons.py | 18 +++++-------- 4 files changed, 8 insertions(+), 82 deletions(-) diff --git a/QMTest/TestSCons_time.py b/QMTest/TestSCons_time.py index ce9e0df..4a759c0 100644 --- a/QMTest/TestSCons_time.py +++ b/QMTest/TestSCons_time.py @@ -175,26 +175,6 @@ class TestSCons_time(TestCommon): TestCommon.__init__(self, **kw) - # Now that the testing object has been set up, check if we should - # skip the test due to the Python version. We need to be able to - # import __future__ (which scons-time.py uses for nested scopes) - # and to handle list comprehensions (just because we're avoiding - # the old map() and filter() idioms). - - try: - import __future__ - except ImportError: - version = sys.version.split()[0] - msg = 'scons-time does not work on Python version %s\n' % version - self.skip_test(msg) - - try: - eval('[x for x in [1, 2]]') - except SyntaxError: - version = sys.version.split()[0] - msg = 'scons-time does not work on Python version %s\n' % version - self.skip_test(msg) - def archive_split(self, path): if path[-7:] == '.tar.gz': return path[:-7], path[-7:] diff --git a/src/engine/SCons/Script/SConscript.py b/src/engine/SCons/Script/SConscript.py index aa555da..bd515d2 100644 --- a/src/engine/SCons/Script/SConscript.py +++ b/src/engine/SCons/Script/SConscript.py @@ -473,13 +473,8 @@ class SConsEnvironment(SCons.Environment.Base): def EnsurePythonVersion(self, major, minor): """Exit abnormally if the Python version is not late enough.""" - try: - v_major, v_minor, v_micro, release, serial = sys.version_info - python_ver = (v_major, v_minor) - except AttributeError: - python_ver = self._get_major_minor_revision(sys.version)[:2] - if python_ver < (major, minor): - v = sys.version.split(" ", 1)[0] + if sys.version_info < (major, minor): + v = sys.version.split()[0] print "Python %d.%d or greater required, but you have Python %s" %(major,minor,v) sys.exit(2) diff --git a/src/engine/SCons/compat/_scons_builtins.py b/src/engine/SCons/compat/_scons_builtins.py index 3c8a0e5..6218cd1 100644 --- a/src/engine/SCons/compat/_scons_builtins.py +++ b/src/engine/SCons/compat/_scons_builtins.py @@ -37,7 +37,6 @@ This module checks for the following builtins names: all() any() - sorted() memoryview() Implementations of functions are *NOT* guaranteed to be fully compliant @@ -101,48 +100,6 @@ except NameError: return self.obj[indx] builtins.memoryview = memoryview -try: - sorted -except NameError: - # Pre-2.4 Python has no sorted() function. - # - # The pre-2.4 Python list.sort() method does not support - # list.sort(key=) nor list.sort(reverse=) keyword arguments, so - # we must implement the functionality of those keyword arguments - # by hand instead of passing them to list.sort(). - def sorted(iterable, cmp=None, key=None, reverse=False): - if key is not None: - result = [(key(x), x) for x in iterable] - else: - result = iterable[:] - if cmp is None: - # Pre-2.3 Python does not support list.sort(None). - result.sort() - else: - result.sort(cmp) - if key is not None: - result = [t1 for t0,t1 in result] - if reverse: - result.reverse() - return result - builtins.sorted = sorted - -#if sys.version_info[:3] in ((2, 2, 0), (2, 2, 1)): -# def lstrip(s, c=string.whitespace): -# while s and s[0] in c: -# s = s[1:] -# return s -# def rstrip(s, c=string.whitespace): -# while s and s[-1] in c: -# s = s[:-1] -# return s -# def strip(s, c=string.whitespace, l=lstrip, r=rstrip): -# return l(r(s, c), c) -# -# object.__setattr__(str, 'lstrip', lstrip) -# object.__setattr__(str, 'rstrip', rstrip) -# object.__setattr__(str, 'strip', strip) - # Local Variables: # tab-width:4 # indent-tabs-mode:nil diff --git a/src/script/scons.py b/src/script/scons.py index cd8b432..46e6d2b 100644 --- a/src/script/scons.py +++ b/src/script/scons.py @@ -55,18 +55,12 @@ import sys # engine modules if they're in either directory. -# Check to see if the python version is > 3.0 which is currently unsupported -# If so exit with error message -try: - if sys.version_info >= (3,0,0): - msg = "scons: *** SCons version %s does not run under Python version %s.\n\ -Python 3.0 and later are not yet supported.\n" - sys.stderr.write(msg % (__version__, sys.version.split()[0])) - sys.exit(1) -except AttributeError: - # Pre-1.6 Python has no sys.version_info - # No need to check version as we then know the version is < 3.0.0 and supported - pass +if sys.version_info >= (3,0,0): + msg = "scons: *** SCons version %s does not run under Python version %s.\n\ +Python 3 is not yet supported.\n" + sys.stderr.write(msg % (__version__, sys.version.split()[0])) + sys.exit(1) + script_dir = sys.path[0] -- cgit v0.12 From 0ff075783f70190674512809c012d2467729e22d Mon Sep 17 00:00:00 2001 From: anatoly techtonik Date: Wed, 12 Dec 2012 16:26:08 +0300 Subject: Fix release date for SCons 2.2.0 --- src/Announce.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Announce.txt b/src/Announce.txt index e2b4001..a2197a1 100644 --- a/src/Announce.txt +++ b/src/Announce.txt @@ -19,7 +19,7 @@ effectively, please go to http://scons.org/lists.php#users to sign up for the scons-users mailing list. -RELEASE 2.2.0 - Mon, 09 Sep 2011 20:54:57 -0700 +RELEASE 2.2.0 - Mon, 05 Aug 2012 15:37:48 +0000 Please consult the RELEASE.txt file for a summary of changes since the last release and consult the CHANGES.txt file for complete a list of changes -- cgit v0.12 From ba2069cfbbed1bdc0b32dd6853aada258755884a Mon Sep 17 00:00:00 2001 From: anatoly techtonik Date: Wed, 12 Dec 2012 17:33:12 +0300 Subject: os.spawnv is here since Python 1.6, removing compatibility code --- runtest.py | 21 +++++---------------- test/Deprecated/SourceCode/Perforce/Perforce.py | 9 ++------- 2 files changed, 7 insertions(+), 23 deletions(-) diff --git a/runtest.py b/runtest.py index a88cfd2..55a16f5 100644 --- a/runtest.py +++ b/runtest.py @@ -390,22 +390,11 @@ if use_subprocess: else: has_subprocess = False # Set up lowest-common-denominator spawning of a process on both Windows - # and non-Windows systems that works all the way back to Python 1.5.2. - try: - os.spawnv - except AttributeError: - def spawn_it(command_args): - pid = os.fork() - if pid == 0: - os.execv(command_args[0], command_args) - else: - pid, status = os.waitpid(pid, 0) - return (None, None, status >> 8) - else: - def spawn_it(command_args): - command = command_args[0] - command_args = [escape(c) for c in command_args] - return (None, None, os.spawnv(os.P_WAIT, command, command_args)) + # and non-Windows systems that works all the way back to Python 1.6 + def spawn_it(command_args): + command = command_args[0] + command_args = [escape(c) for c in command_args] + return (None, None, os.spawnv(os.P_WAIT, command, command_args)) class Base(object): def __init__(self, path, spe=None): diff --git a/test/Deprecated/SourceCode/Perforce/Perforce.py b/test/Deprecated/SourceCode/Perforce/Perforce.py index d732b57..ebf9cfb 100644 --- a/test/Deprecated/SourceCode/Perforce/Perforce.py +++ b/test/Deprecated/SourceCode/Perforce/Perforce.py @@ -85,13 +85,8 @@ class TestPerforce(TestSCons.TestSCons): # We don't use self.run() because the TestCmd logic will hang # waiting for the daemon to exit, even when we pass it # the -d option. - try: - spawnv = os.spawnv - except AttributeError: - os.system(' '.join(args)) - else: - spawnv(os.P_NOWAIT, self.p4d, args) - self.sleep(2) + os.spawnv(os.P_NOWAIT, self.p4d, args) + self.sleep(2) else: import socket s = socket.socket() -- cgit v0.12 From 58b9a8a944854346f09f0502147429303211f8dc Mon Sep 17 00:00:00 2001 From: Gary Oberbrunner Date: Fri, 14 Dec 2012 01:05:33 +0000 Subject: Fix failing unit test. Removed test that tested for 1.x python behavior since the code no longer supports versions back that far. --- test/EnsurePythonVersion.py | 52 --------------------------------------------- 1 file changed, 52 deletions(-) diff --git a/test/EnsurePythonVersion.py b/test/EnsurePythonVersion.py index 8e1a0f3..b40bc71 100644 --- a/test/EnsurePythonVersion.py +++ b/test/EnsurePythonVersion.py @@ -43,58 +43,6 @@ Exit(0) test.run(status=2) -test.write('SConstruct', """\ -import sys -try: - delattr(sys, 'version_info') -except AttributeError: - pass -sys.version = '2.3b1 (#0, Feb 24 2003, 19:13:11)\\n' -EnsurePythonVersion(1,3) -Exit(0) -""") - -test.run() - -test.write('SConstruct', """\ -import sys -try: - delattr(sys, 'version_info') -except AttributeError: - pass -sys.version = '2.3+ (#0, Feb 24 2003, 19:13:11)\\n' -EnsurePythonVersion(2,2) -Exit(0) -""") - -test.run() - -test.write('SConstruct', """\ -import sys -try: - delattr(sys, 'version_info') -except AttributeError: - pass -sys.version = '2.3b1 (#0, Feb 24 2003, 19:13:11)\\n' -EnsurePythonVersion(2,3) -Exit(0) -""") - -test.run() - -test.write('SConstruct', """\ -import sys -try: - delattr(sys, 'version_info') -except AttributeError: - pass -sys.version = '2.3b1 (#0, Feb 24 2003, 19:13:11)\\n' -EnsurePythonVersion(2,4) -Exit(0) -""") - -test.run(status=2) - test.pass_test() -- cgit v0.12 From 1bf9aa83fc024950012dd76d110443fc2d30c92a Mon Sep 17 00:00:00 2001 From: William Deegan Date: Fri, 14 Dec 2012 18:07:37 -0800 Subject: kick buildbot --- README.rst | 1 + 1 file changed, 1 insertion(+) diff --git a/README.rst b/README.rst index d2492ba..862d323 100644 --- a/README.rst +++ b/README.rst @@ -751,3 +751,4 @@ With plenty of help from the SCons Development team: \... and many others. __COPYRIGHT__ + -- cgit v0.12