1. SCons
  2. Core
  3. SCons

Commits

Russel Winder  committed f849a26 Merge

Merge mainline.

Comments (0)

Files changed (18)

File QMTest/TestCmd.py Modified

View file
  • Ignore whitespace
  • Hide word diff
 import types
 
 
-PY3 = sys.version_info[0] == 3
+IS_PY3 = sys.version_info[0] == 3
+IS_WINDOWS = sys.platform == 'win32'
 
 
 class null(object):
         file = self.canonicalize(file)
         if mode[0] != 'r':
             raise ValueError("mode must begin with 'r'")
-        if PY3 and 'b' not in mode:
+        if IS_PY3 and 'b' not in mode:
             return open(file, mode, newline=newline).read()
         else:
             return open(file, mode).read()

File src/CHANGES.txt Modified

View file
  • Ignore whitespace
  • Hide word diff
 
 RELEASE 3.0.0.alpha.20170614 - Mon, 14 Jun 2017 12:23:56 -0400
 
+NOTE: This is a major release.  You should expect that some targets may rebuild when upgrading.
+Significant changes in some python action signatures. Also switching between PY 2 and PY 3.5, 3.6
+may cause rebuilds.  In no case should rebuilds not happen.
+
   From Richard West:
     - Added nested / namespace tool support
     - Added a small fix to the python3 tool loader when loading a tool as a package
       avoid too many open files.
     - Add __main__.py for `python -m SCons` in case it is on PYTHONPATH.
     - Always use highest available pickle protocol for efficiency.
+    - Remove unused command line fallback for the zip tool.
 
   From Gaurav Juvekar:
     - Fix issue #2832: Expand construction variables in 'chdir' argument of builders. (PR #463)

File src/engine/SCons/ActionTests.py Modified

View file
  • Ignore whitespace
  • Hide word diff
         def LocalFunc():
             pass
 
-        func_matches = [
-            b"0, 0, 0, 0,(),(),(d\000\000S),(),()",
-            b"0, 0, 0, 0,(),(),(d\x00\x00S),(),()",
-            ]
+        if TestCmd.IS_PY3 and TestCmd.IS_WINDOWS:
+            func_matches = [
+                b'0, 0, 0, 0,(),(),(d\x00S\x00),(),()',  # PY 3.6
+                b'0, 0, 0, 0,(),(),(d\x00\x00S),(),()',  # PY 3.5
+                ]
+        else:
+            func_matches = [
+                b"0, 0, 0, 0,(),(),(d\000\000S),(),()",
+                b"0, 0, 0, 0,(),(),(d\x00\x00S),(),()",
+                ]
 
         meth_matches = [
             b"1, 1, 0, 0,(),(),(d\000\000S),(),()",
         def LocalFunc():
             pass
 
-        func_matches = [
-            b"0, 0, 0, 0,(),(),(d\000\000S),(),()",
-            b"0, 0, 0, 0,(),(),(d\x00\x00S),(),()",
+        if TestCmd.IS_PY3 and TestCmd.IS_WINDOWS:
+            func_matches = [
+                b'0, 0, 0, 0,(),(),(d\x00S\x00),(),()',  # py 3.6
+                b'0, 0, 0, 0,(),(),(d\x00\x00S),(),()'   # py 3.5
+                ]
+            meth_matches = [
+                b'1, 1, 0, 0,(),(),(d\x00S\x00),(),()',  # py 3.6
+                b'1, 1, 0, 0,(),(),(d\x00\x00S),(),()',  # py 3.5
             ]
 
-        meth_matches = [
-            b"1, 1, 0, 0,(),(),(d\000\000S),(),()",
-            b"1, 1, 0, 0,(),(),(d\x00\x00S),(),()",
-        ]
+        else:
+            func_matches = [
+                b"0, 0, 0, 0,(),(),(d\000\000S),(),()",
+                b"0, 0, 0, 0,(),(),(d\x00\x00S),(),()",
+                ]
+
+            meth_matches = [
+                b"1, 1, 0, 0,(),(),(d\000\000S),(),()",
+                b"1, 1, 0, 0,(),(),(d\x00\x00S),(),()",
+            ]
 
         def factory(act, **kw):
             return SCons.Action.FunctionAction(act, kw)
 
         a = factory(GlobalFunc)
         c = a.get_contents(target=[], source=[], env=Environment())
-        # assert c in func_matches, repr(c)
         assert c in func_matches, "Got\n"+repr(c)+"\nExpected one of \n"+"\n".join([repr(f) for f in func_matches])
 
 
         lc = LocalClass()
         a = factory(lc.LocalMethod)
         c = a.get_contents(target=[], source=[], env=Environment())
-        assert c in meth_matches, repr(c)
+        assert c in meth_matches,  "Got\n"+repr(c)+"\nExpected one of \n"+"\n".join([repr(f) for f in meth_matches])
 
     def test_strfunction(self):
         """Test the FunctionAction.strfunction() method
         def LocalFunc():
             pass
 
-        func_matches = [
-            b"0, 0, 0, 0,(),(),(d\000\000S),(),()",
-            b"0, 0, 0, 0,(),(),(d\x00\x00S),(),()",
-            ]
+        if TestCmd.IS_PY3 and TestCmd.IS_WINDOWS:
+            func_matches = [
+                b'0, 0, 0, 0,(),(),(d\x00S\x00),(),()',
+                b'0, 0, 0, 0,(),(),(d\x00\x00S),(),()'
+                ]
+        else:
+            func_matches = [
+                b"0, 0, 0, 0,(),(),(d\000\000S),(),()",
+                b"0, 0, 0, 0,(),(),(d\x00\x00S),(),()",
+                ]
 
         meth_matches = [
             b"1, 1, 0, 0,(),(),(d\000\000S),(),()",
         def LocalFunc():
             pass
 
-        matches = [
-            b"d\000\000S",
-            b"d\\x00\\x00S"
-        ]
+        if TestCmd.IS_PY3 and TestCmd.IS_WINDOWS:
+            matches = [
+                b'd\x00S\x00',
+                b'd\x00\x00S'
+            ]
+        else:
+            matches = [
+                b"d\000\000S",
+                b"d\\x00\\x00S"
+            ]
 
         af = SCons.Action.ActionFactory(GlobalFunc, strfunc)
         ac = SCons.Action.ActionCaller(af, [], {})
         c = ac.get_contents([], [], Environment())
         assert c in matches, "Got\n"+repr(c)+"\nExpected one of \n"+"\n".join([repr(f) for f in matches])
 
-        matches = [
-            b'd\000\000S',
-            b"d\x00\x00S"
-        ]
+        # TODO: Same as above, why redefine?
+        # matches = [
+        #     b'd\000\000S',
+        #     b"d\x00\x00S"
+        # ]
 
         class LocalActFunc(object):
             def __call__(self):
             return a
 
         c = SCons.Action._function_contents(func1)
-        expected = bytearray('3, 3, 0, 0,(),(),(|\x00\x00S),(),()','utf-8')
-        assert expected == c, "Got\n"+repr(c)+"\nExpected \n"+repr(expected)+"\n"
+        if TestCmd.IS_PY3 and TestCmd.IS_WINDOWS:
+            expected = [b'3, 3, 0, 0,(),(),(|\x00S\x00),(),()',
+                        b'3, 3, 0, 0,(),(),(|\x00\x00S),(),()']
+        else:
+            expected = [b'3, 3, 0, 0,(),(),(|\x00\x00S),(),()']
+        assert c in expected, "Got\n"+repr(c)+"\nExpected one of \n"+"\n".join([repr(e) for e in expected])
 
 
     # @unittest.skip("Results vary between py2 and py3, not sure if test makes sense to implement")
         # See definition above
         o = TestClass()
         c = SCons.Action._object_contents(o)
-        expected = bytearray("(i__main__\nTestClass\np1\n(dp2\nS'a'\nS'a'\nsS'b'\nS'b'\nsb.", 'utf-8')
-        assert expected == c, "Got\n" + repr(c) + "\nExpected\n" + repr(expected)
+
+        if TestCmd.IS_PY3:
+            if TestCmd.IS_WINDOWS:
+                expected = [b'ccopy_reg\n_reconstructor\nq\x00(c__main__\nTestClass\nq\x01c__builtin__\nobject\nq\x02Ntq\x03Rq\x04}q\x05(X\x01\x00\x00\x00aq\x06h\x06X\x01\x00\x00\x00bq\x07h\x07ub.', # py 3.6
+                b'ccopy_reg\n_reconstructor\nq\x00(c__main__\nTestClass\nq\x01c__builtin__\nobject\nq\x02Ntq\x03Rq\x04}q\x05(X\x01\x00\x00\x00bq\x06h\x06X\x01\x00\x00\x00aq\x07h\x07ub.', # py 3.5
+                ]
+            else:
+                expected = [b'ccopy_reg\n_reconstructor\nq\x00(c__main__\nTestClass\nq\x01c__builtin__\nobject\nq\x02Ntq\x03Rq\x04}q\x05(X\x01\x00\x00\x00bq\x06h\x06X\x01\x00\x00\x00aq\x07h\x07ub.']
+        else:
+            if TestCmd.IS_WINDOWS:
+                expected = [b'(c__main__\nTestClass\nq\x01oq\x02}q\x03(U\x01aU\x01aU\x01bU\x01bub.']
+            else:
+                expected = [b'(c__main__\nTestClass\nq\x01oq\x02}q\x03(U\x01aU\x01aU\x01bU\x01bub.']
+
+        assert c in expected, "Got\n"+repr(c)+"\nExpected one of \n"+"\n".join([repr(e) for e in expected])
 
     # @unittest.skip("Results vary between py2 and py3, not sure if test makes sense to implement")
     def test_code_contents(self):
 
         code = compile("print('Hello, World!')", '<string>', 'exec')
         c = SCons.Action._code_contents(code)
-        expected = bytearray("0, 0, 0, 0,(N.),(),(d\x00\x00GHd\x01\x00S)", 'utf-8')
-        assert expected == c, "Got\n" + repr(c) + "\nExpected\n" + repr(expected)
+        if TestCmd.IS_PY3:
+            if TestCmd.IS_WINDOWS:
+                expected = [b'0, 0, 0, 0,(N.),(X\x05\x00\x00\x00printq\x00.),(e\x00d\x00\x83\x01\x01\x00d\x01S\x00)',
+                            b'0, 0, 0, 0,(N.),(X\x05\x00\x00\x00printq\x00.),(e\x00\x00d\x00\x00\x83\x01\x00\x01d\x01\x00S)'
+                            ]
+            else:
+                expected = [b'0, 0, 0, 0,(N.),(X\x05\x00\x00\x00printq\x00.),(e\x00\x00d\x00\x00\x83\x01\x00\x01d\x01\x00S)']
+        else:
+            expected = [b"0, 0, 0, 0,(N.),(),(d\x00\x00GHd\x01\x00S)"]
+        assert c in expected, "Got\n"+repr(c)+"\nExpected one of \n"+"\n".join([repr(e) for e in expected])
 
 
 

File src/engine/SCons/Tool/__init__.py Modified

View file
  • Ignore whitespace
  • Hide word diff
                 # Not sure what to do in the case that there already
                 # exists sys.modules[self.name] but the source file is
                 # different.. ?
-                spec.loader.exec_module(module)
+                module = spec.loader.load_module(spec.name)
 
                 sys.modules[found_name] = module
                 if add_to_scons_tools_namespace:

File src/engine/SCons/Tool/docbook/__init__.py Modified

View file
  • Ignore whitespace
  • Hide word diff
 import SCons.Tool
 import SCons.Util
 
+
+__debug_tool_location = False
 # Get full path to this script
 scriptpath = os.path.dirname(os.path.realpath(__file__))
 
         if cpriority is None:
             cpriority = cdict.keys()
         for cltool in cpriority:
+            if __debug_tool_location:
+                print("DocBook: Looking for %s"%cltool)
             clpath = env.WhereIs(cltool)
             if clpath:
+                if __debug_tool_location:
+                    print("DocBook: Found:%s"%cltool)
                 env[chainkey] = clpath
                 if not env[chainkey + 'COM']:
                     env[chainkey + 'COM'] = cdict[cltool]
         __detect_cl_tool(env, 'DOCBOOK_XSLTPROC', xsltproc_com, xsltproc_com_priority)
         __detect_cl_tool(env, 'DOCBOOK_XMLLINT', xmllint_com)
 
-    __detect_cl_tool(env, 'DOCBOOK_FOP', fop_com)
+    __detect_cl_tool(env, 'DOCBOOK_FOP', fop_com, ['fop','xep','jw'])
 
 #
 # Scanners

File src/engine/SCons/Tool/zip.py Modified

View file
  • Ignore whitespace
  • Hide word diff
 import SCons.Node.FS
 import SCons.Util
 
-try:
-    import zipfile
-    internal_zip = 1
-except ImportError:
-    internal_zip = 0
+import zipfile
 
-if internal_zip:
-    zipcompression = zipfile.ZIP_DEFLATED
-    def zip(target, source, env):
-        compression = env.get('ZIPCOMPRESSION', 0)
-        zf = zipfile.ZipFile(str(target[0]), 'w', compression)
-        for s in source:
-            if s.isdir():
-                for dirpath, dirnames, filenames in os.walk(str(s)):
-                    for fname in filenames:
-                        path = os.path.join(dirpath, fname)
-                        if os.path.isfile(path):
-                            zf.write(path, os.path.relpath(path, str(env.get('ZIPROOT', ''))))
-            else:
-                zf.write(str(s), os.path.relpath(str(s), str(env.get('ZIPROOT', ''))))
-        zf.close()
-else:
-    zipcompression = 0
-    zip = "$ZIP $ZIPFLAGS ${TARGET.abspath} $SOURCES"
+zipcompression = zipfile.ZIP_DEFLATED
+def zip(target, source, env):
+    compression = env.get('ZIPCOMPRESSION', 0)
+    zf = zipfile.ZipFile(str(target[0]), 'w', compression)
+    for s in source:
+        if s.isdir():
+            for dirpath, dirnames, filenames in os.walk(str(s)):
+                for fname in filenames:
+                    path = os.path.join(dirpath, fname)
+                    if os.path.isfile(path):
 
+                        zf.write(path, os.path.relpath(path, str(env.get('ZIPROOT', ''))))
+        else:
+            zf.write(str(s), os.path.relpath(str(s), str(env.get('ZIPROOT', ''))))
+    zf.close()
 
 zipAction = SCons.Action.Action(zip, varlist=['ZIPCOMPRESSION'])
 
     env['ZIPROOT']    = SCons.Util.CLVar('')
 
 def exists(env):
-    return internal_zip or env.Detect('zip')
+    return True
 
 # Local Variables:
 # tab-width:4

File src/script/scons.py Modified

View file
  • Ignore whitespace
  • Hide word diff
 # engine modules if they're in either directory.
 
 
-## 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)
+if (3,0,0) < sys.version_info < (3,5,0) or sys.version_info < (2,7,0):
+    msg = "scons: *** SCons version %s does not run under Python version %s.\n\
+Python < 3.5 is not yet supported.\n"
+    sys.stderr.write(msg % (__version__, sys.version.split()[0]))
+    sys.exit(1)
 
 
 script_dir = sys.path[0]

File src/setup.py Modified

View file
  • Ignore whitespace
  • Hide word diff
     os.chdir(head)
     sys.argv[0] = tail
 
-
 # flag if setup.py is run on win32 or _for_ win32 platform,
 # (when building windows installer on linux, for example)
 is_win32 = 0
 else:
     is_win32 = 1
 
-
 import distutils
 import distutils.core
 import distutils.command.install
 import distutils.command.build_scripts
 import distutils.msvccompiler
 
+
 def get_build_version():
     """ monkey patch distutils msvc version if we're not on windows.
     We need to use vc version 9 for python 2.7.x and it defaults to 6
     monkey patching"""
     return 9
 
+
 distutils.msvccompiler.get_build_version = get_build_version
 
 _install = distutils.command.install.install
 _install_scripts = distutils.command.install_scripts.install_scripts
 _build_scripts = distutils.command.build_scripts.build_scripts
 
+
 class _options(object):
     pass
 
+
 Options = _options()
 
 Installed = []
 
+
 def set_explicitly(name, args):
     """
     Return if the installation directory was set explicitly by the
             break
     return set
 
+
 class install(_install):
     user_options = _install.user_options + [
-                    ('no-scons-script', None,
-                     "don't install 'scons', only install 'scons-%s'" % Version),
-                    ('no-version-script', None,
-                     "don't install 'scons-%s', only install 'scons'" % Version),
-                    ('install-bat', None,
-                     "install 'scons.bat' script"),
-                    ('no-install-bat', None,
-                     "do not install 'scons.bat' script"),
-                    ('install-man', None,
-                     "install SCons man pages"),
-                    ('no-install-man', None,
-                     "do not install SCons man pages"),
-                    ('standard-lib', None,
-                     "install SCons library in standard Python location"),
-                    ('standalone-lib', None,
-                     "install SCons library in separate standalone directory"),
-                    ('version-lib', None,
-                     "install SCons library in version-numbered directory"),
-                   ]
+        ('no-scons-script', None,
+         "don't install 'scons', only install 'scons-%s'" % Version),
+        ('no-version-script', None,
+         "don't install 'scons-%s', only install 'scons'" % Version),
+        ('install-bat', None,
+         "install 'scons.bat' script"),
+        ('no-install-bat', None,
+         "do not install 'scons.bat' script"),
+        ('install-man', None,
+         "install SCons man pages"),
+        ('no-install-man', None,
+         "do not install SCons man pages"),
+        ('standard-lib', None,
+         "install SCons library in standard Python location"),
+        ('standalone-lib', None,
+         "install SCons library in separate standalone directory"),
+        ('version-lib', None,
+         "install SCons library in version-numbered directory"),
+    ]
     boolean_options = _install.boolean_options + [
-                       'no-scons-script',
-                       'no-version-script',
-                       'install-bat',
-                       'no-install-bat',
-                       'install-man',
-                       'no-install-man',
-                       'standard-lib',
-                       'standalone-lib',
-                       'version-lib'
-                      ]
+        'no-scons-script',
+        'no-version-script',
+        'install-bat',
+        'no-install-bat',
+        'install-man',
+        'no-install-man',
+        'standard-lib',
+        'standalone-lib',
+        'version-lib'
+    ]
 
     if hasattr(os, 'link'):
         user_options.append(
-                    ('hardlink-scons', None,
-                     "hard link 'scons' to the version-numbered script, don't make a separate 'scons' copy"),
-                     )
+            ('hardlink-scons', None,
+             "hard link 'scons' to the version-numbered script, don't make a separate 'scons' copy"),
+        )
         boolean_options.append('hardlink-script')
 
     if hasattr(os, 'symlink'):
         user_options.append(
-                    ('symlink-scons', None,
-                     "make 'scons' a symbolic link to the version-numbered script, don't make a separate 'scons' copy"),
-                     )
+            ('symlink-scons', None,
+             "make 'scons' a symbolic link to the version-numbered script, don't make a separate 'scons' copy"),
+        )
         boolean_options.append('symlink-script')
 
     def initialize_options(self):
         Options.hardlink_scons = self.hardlink_scons
         Options.symlink_scons = self.symlink_scons
 
+
 def get_scons_prefix(libdir, is_win32):
     """
     Return the right prefix for SCons library installation.  Find
                 return os.path.join(drive + head)
     return libdir
 
+
 def force_to_usr_local(self):
     """
     A hack to decide if we need to "force" the installation directories
             (self.install_dir[:9] == '/Library/' or
              self.install_dir[:16] == '/System/Library/'))
 
+
 class install_lib(_install_lib):
     def finalize_options(self):
         _install_lib.finalize_options(self)
         msg = "Installed SCons library modules into %s" % self.install_dir
         Installed.append(msg)
 
+
 class install_scripts(_install_scripts):
     def finalize_options(self):
         _install_scripts.finalize_options(self)
         pass
 
     def hardlink_scons(self, src, dst, ver):
-        try: os.unlink(dst)
-        except OSError: pass
+        try:
+            os.unlink(dst)
+        except OSError:
+            pass
         os.link(ver, dst)
 
     def symlink_scons(self, src, dst, ver):
-        try: os.unlink(dst)
-        except OSError: pass
+        try:
+            os.unlink(dst)
+        except OSError:
+            pass
         os.symlink(os.path.split(ver)[1], dst)
 
     def copy_scons(self, src, dst, *args):
-        try: os.unlink(dst)
-        except OSError: pass
+        try:
+            os.unlink(dst)
+        except OSError:
+            pass
         self.copy_file(src, dst)
         self.outfiles.append(dst)
 
                 self.copy_scons(src, scons_version_bat)
 
         # --- distutils copy/paste ---
-        if hasattr(os, 'chmod') and hasattr(os,'stat'):
+        if hasattr(os, 'chmod') and hasattr(os, 'stat'):
             # Set the executable bits (owner, group, and world) on
             # all the scripts we just installed.
             for file in self.get_outputs():
                 else:
                     # Use symbolic versions of permissions so this script doesn't fail to parse under python3.x
                     exec_and_read_permission = stat.S_IXOTH | stat.S_IXUSR | stat.S_IXGRP | stat.S_IROTH | stat.S_IRUSR | stat.S_IRGRP
-                    mode_mask = 4095 # Octal 07777 used because python3 has different octal syntax than python 2
+                    mode_mask = 4095  # Octal 07777 used because python3 has different octal syntax than python 2
                     mode = ((os.stat(file)[stat.ST_MODE]) | exec_and_read_permission) & mode_mask
                     # log.info("changing mode of %s to %o", file, mode)
                     os.chmod(file, mode)
-        # --- /distutils copy/paste ---
+                    # --- /distutils copy/paste ---
+
 
 class build_scripts(_build_scripts):
     def finalize_options(self):
         _build_scripts.finalize_options(self)
         self.build_dir = os.path.join('build', 'scripts')
 
+
 class install_data(_install_data):
     def initialize_options(self):
         _install_data.initialize_options(self)
+
     def finalize_options(self):
         _install_data.finalize_options(self)
         if force_to_usr_local(self):
         else:
             self.data_files = []
 
+
 description = "Open Source next-generation build tool."
 
 long_description = """Open Source next-generation build tool.
 ]
 
 arguments = {
-    'name'             : "scons",
-    'version'          : Version,
-    'description'      : description,
-    'long_description' : long_description,
-    'author'           : 'Steven Knight',
-    'author_email'     : 'knight@baldmt.com',
-    'url'              : "http://www.scons.org/",
-    'packages'         : ["SCons",
-                          "SCons.compat",
-                          "SCons.Node",
-                          "SCons.Options",
-                          "SCons.Platform",
-                          "SCons.Scanner",
-                          "SCons.Script",
-                          "SCons.Tool",
-                          "SCons.Tool.docbook",
-                          "SCons.Tool.MSCommon",
-                          "SCons.Tool.packaging",
-                          "SCons.Variables",
-                         ],
-    'package_dir'      : {'' : 'engine',
-                          'SCons.Tool.docbook' : 'engine/SCons/Tool/docbook'},
-    'package_data'     : {'SCons.Tool.docbook' : ['docbook-xsl-1.76.1/*',
-                                                  'docbook-xsl-1.76.1/common/*',
-                                                  'docbook-xsl-1.76.1/docsrc/*',
-                                                  'docbook-xsl-1.76.1/eclipse/*',
-                                                  'docbook-xsl-1.76.1/epub/*',
-                                                  'docbook-xsl-1.76.1/epub/bin/*',
-                                                  'docbook-xsl-1.76.1/epub/bin/lib/*',
-                                                  'docbook-xsl-1.76.1/epub/bin/xslt/*',
-                                                  'docbook-xsl-1.76.1/extensions/*',
-                                                  'docbook-xsl-1.76.1/fo/*',
-                                                  'docbook-xsl-1.76.1/highlighting/*',
-                                                  'docbook-xsl-1.76.1/html/*',
-                                                  'docbook-xsl-1.76.1/htmlhelp/*',
-                                                  'docbook-xsl-1.76.1/images/*',
-                                                  'docbook-xsl-1.76.1/images/callouts/*',
-                                                  'docbook-xsl-1.76.1/images/colorsvg/*',
-                                                  'docbook-xsl-1.76.1/javahelp/*',
-                                                  'docbook-xsl-1.76.1/lib/*',
-                                                  'docbook-xsl-1.76.1/manpages/*',
-                                                  'docbook-xsl-1.76.1/params/*',
-                                                  'docbook-xsl-1.76.1/profiling/*',
-                                                  'docbook-xsl-1.76.1/roundtrip/*',
-                                                  'docbook-xsl-1.76.1/slides/browser/*',
-                                                  'docbook-xsl-1.76.1/slides/fo/*',
-                                                  'docbook-xsl-1.76.1/slides/graphics/*',
-                                                  'docbook-xsl-1.76.1/slides/graphics/active/*',
-                                                  'docbook-xsl-1.76.1/slides/graphics/inactive/*',
-                                                  'docbook-xsl-1.76.1/slides/graphics/toc/*',
-                                                  'docbook-xsl-1.76.1/slides/html/*',
-                                                  'docbook-xsl-1.76.1/slides/htmlhelp/*',
-                                                  'docbook-xsl-1.76.1/slides/keynote/*',
-                                                  'docbook-xsl-1.76.1/slides/keynote/xsltsl/*',
-                                                  'docbook-xsl-1.76.1/slides/svg/*',
-                                                  'docbook-xsl-1.76.1/slides/xhtml/*',
-                                                  'docbook-xsl-1.76.1/template/*',
-                                                  'docbook-xsl-1.76.1/tests/*',
-                                                  'docbook-xsl-1.76.1/tools/bin/*',
-                                                  'docbook-xsl-1.76.1/tools/make/*',
-                                                  'docbook-xsl-1.76.1/webhelp/*',
-                                                  'docbook-xsl-1.76.1/webhelp/docs/*',
-                                                  'docbook-xsl-1.76.1/webhelp/docs/common/*',
-                                                  'docbook-xsl-1.76.1/webhelp/docs/common/css/*',
-                                                  'docbook-xsl-1.76.1/webhelp/docs/common/images/*',
-                                                  'docbook-xsl-1.76.1/webhelp/docs/common/jquery/*',
-                                                  'docbook-xsl-1.76.1/webhelp/docs/common/jquery/theme-redmond/*',
-                                                  'docbook-xsl-1.76.1/webhelp/docs/common/jquery/theme-redmond/images/*',
-                                                  'docbook-xsl-1.76.1/webhelp/docs/common/jquery/treeview/*',
-                                                  'docbook-xsl-1.76.1/webhelp/docs/common/jquery/treeview/images/*',
-                                                  'docbook-xsl-1.76.1/webhelp/docs/content/*',
-                                                  'docbook-xsl-1.76.1/webhelp/docs/content/search/*',
-                                                  'docbook-xsl-1.76.1/webhelp/docs/content/search/stemmers/*',
-                                                  'docbook-xsl-1.76.1/webhelp/docsrc/*',
-                                                  'docbook-xsl-1.76.1/webhelp/template/*',
-                                                  'docbook-xsl-1.76.1/webhelp/template/common/*',
-                                                  'docbook-xsl-1.76.1/webhelp/template/common/css/*',
-                                                  'docbook-xsl-1.76.1/webhelp/template/common/images/*',
-                                                  'docbook-xsl-1.76.1/webhelp/template/common/jquery/*',
-                                                  'docbook-xsl-1.76.1/webhelp/template/common/jquery/theme-redmond/*',
-                                                  'docbook-xsl-1.76.1/webhelp/template/common/jquery/theme-redmond/images/*',
-                                                  'docbook-xsl-1.76.1/webhelp/template/common/jquery/treeview/*',
-                                                  'docbook-xsl-1.76.1/webhelp/template/common/jquery/treeview/images/*',
-                                                  'docbook-xsl-1.76.1/webhelp/template/content/search/*',
-                                                  'docbook-xsl-1.76.1/webhelp/template/content/search/stemmers/*',
-                                                  'docbook-xsl-1.76.1/webhelp/xsl/*',
-                                                  'docbook-xsl-1.76.1/website/*',
-                                                  'docbook-xsl-1.76.1/xhtml/*',
-                                                  'docbook-xsl-1.76.1/xhtml-1_1/*',
-                                                  'utils/*']},
-    'data_files'       : [('man/man1', man_pages)],
-    'scripts'          : scripts,
-    'cmdclass'         : {'install'         : install,
-                          'install_lib'     : install_lib,
-                          'install_data'    : install_data,
-                          'install_scripts' : install_scripts,
-                          'build_scripts'   : build_scripts}
+    'name': "scons",
+    'version': Version,
+    'description': description,
+    'long_description': long_description,
+    'author': 'Steven Knight',
+    'author_email': 'knight@baldmt.com',
+    'url': "http://www.scons.org/",
+    'packages': ["SCons",
+                 "SCons.compat",
+                 "SCons.Node",
+                 "SCons.Options",
+                 "SCons.Platform",
+                 "SCons.Scanner",
+                 "SCons.Script",
+                 "SCons.Tool",
+                 "SCons.Tool.docbook",
+                 "SCons.Tool.MSCommon",
+                 "SCons.Tool.packaging",
+                 "SCons.Variables",
+                 ],
+    'package_dir': {'': 'engine',
+                    'SCons.Tool.docbook': 'engine/SCons/Tool/docbook'},
+    'package_data': {'SCons.Tool.docbook': ['docbook-xsl-1.76.1/*',
+                                            'docbook-xsl-1.76.1/common/*',
+                                            'docbook-xsl-1.76.1/docsrc/*',
+                                            'docbook-xsl-1.76.1/eclipse/*',
+                                            'docbook-xsl-1.76.1/epub/*',
+                                            'docbook-xsl-1.76.1/epub/bin/*',
+                                            'docbook-xsl-1.76.1/epub/bin/lib/*',
+                                            'docbook-xsl-1.76.1/epub/bin/xslt/*',
+                                            'docbook-xsl-1.76.1/extensions/*',
+                                            'docbook-xsl-1.76.1/fo/*',
+                                            'docbook-xsl-1.76.1/highlighting/*',
+                                            'docbook-xsl-1.76.1/html/*',
+                                            'docbook-xsl-1.76.1/htmlhelp/*',
+                                            'docbook-xsl-1.76.1/images/*',
+                                            'docbook-xsl-1.76.1/images/callouts/*',
+                                            'docbook-xsl-1.76.1/images/colorsvg/*',
+                                            'docbook-xsl-1.76.1/javahelp/*',
+                                            'docbook-xsl-1.76.1/lib/*',
+                                            'docbook-xsl-1.76.1/manpages/*',
+                                            'docbook-xsl-1.76.1/params/*',
+                                            'docbook-xsl-1.76.1/profiling/*',
+                                            'docbook-xsl-1.76.1/roundtrip/*',
+                                            'docbook-xsl-1.76.1/slides/browser/*',
+                                            'docbook-xsl-1.76.1/slides/fo/*',
+                                            'docbook-xsl-1.76.1/slides/graphics/*',
+                                            'docbook-xsl-1.76.1/slides/graphics/active/*',
+                                            'docbook-xsl-1.76.1/slides/graphics/inactive/*',
+                                            'docbook-xsl-1.76.1/slides/graphics/toc/*',
+                                            'docbook-xsl-1.76.1/slides/html/*',
+                                            'docbook-xsl-1.76.1/slides/htmlhelp/*',
+                                            'docbook-xsl-1.76.1/slides/keynote/*',
+                                            'docbook-xsl-1.76.1/slides/keynote/xsltsl/*',
+                                            'docbook-xsl-1.76.1/slides/svg/*',
+                                            'docbook-xsl-1.76.1/slides/xhtml/*',
+                                            'docbook-xsl-1.76.1/template/*',
+                                            'docbook-xsl-1.76.1/tests/*',
+                                            'docbook-xsl-1.76.1/tools/bin/*',
+                                            'docbook-xsl-1.76.1/tools/make/*',
+                                            'docbook-xsl-1.76.1/webhelp/*',
+                                            'docbook-xsl-1.76.1/webhelp/docs/*',
+                                            'docbook-xsl-1.76.1/webhelp/docs/common/*',
+                                            'docbook-xsl-1.76.1/webhelp/docs/common/css/*',
+                                            'docbook-xsl-1.76.1/webhelp/docs/common/images/*',
+                                            'docbook-xsl-1.76.1/webhelp/docs/common/jquery/*',
+                                            'docbook-xsl-1.76.1/webhelp/docs/common/jquery/theme-redmond/*',
+                                            'docbook-xsl-1.76.1/webhelp/docs/common/jquery/theme-redmond/images/*',
+                                            'docbook-xsl-1.76.1/webhelp/docs/common/jquery/treeview/*',
+                                            'docbook-xsl-1.76.1/webhelp/docs/common/jquery/treeview/images/*',
+                                            'docbook-xsl-1.76.1/webhelp/docs/content/*',
+                                            'docbook-xsl-1.76.1/webhelp/docs/content/search/*',
+                                            'docbook-xsl-1.76.1/webhelp/docs/content/search/stemmers/*',
+                                            'docbook-xsl-1.76.1/webhelp/docsrc/*',
+                                            'docbook-xsl-1.76.1/webhelp/template/*',
+                                            'docbook-xsl-1.76.1/webhelp/template/common/*',
+                                            'docbook-xsl-1.76.1/webhelp/template/common/css/*',
+                                            'docbook-xsl-1.76.1/webhelp/template/common/images/*',
+                                            'docbook-xsl-1.76.1/webhelp/template/common/jquery/*',
+                                            'docbook-xsl-1.76.1/webhelp/template/common/jquery/theme-redmond/*',
+                                            'docbook-xsl-1.76.1/webhelp/template/common/jquery/theme-redmond/images/*',
+                                            'docbook-xsl-1.76.1/webhelp/template/common/jquery/treeview/*',
+                                            'docbook-xsl-1.76.1/webhelp/template/common/jquery/treeview/images/*',
+                                            'docbook-xsl-1.76.1/webhelp/template/content/search/*',
+                                            'docbook-xsl-1.76.1/webhelp/template/content/search/stemmers/*',
+                                            'docbook-xsl-1.76.1/webhelp/xsl/*',
+                                            'docbook-xsl-1.76.1/website/*',
+                                            'docbook-xsl-1.76.1/xhtml/*',
+                                            'docbook-xsl-1.76.1/xhtml-1_1/*',
+                                            'utils/*']},
+    'data_files': [('man/man1', man_pages)],
+    'scripts': scripts,
+    'cmdclass': {'install': install,
+                 'install_lib': install_lib,
+                 'install_data': install_data,
+                 'install_scripts': install_scripts,
+                 'build_scripts': build_scripts}
 }
 
 distutils.core.setup(**arguments)

File test/toolpath/relative_import/image/SConstruct Added

View file
  • Ignore whitespace
  • Hide word diff
+env = Environment(tools=['TestTool1', 'TestTool1.TestTool1_2'], toolpath=['tools'])
+
+# Test a relative import within the root of the tools directory
+print("env['TestTool1'] =", env.get('TestTool1'))
+print("env['TestTool1_1'] =", env.get('TestTool1_1'))
+
+# Test a relative import within a sub dir
+print("env['TestTool1_2'] =", env.get('TestTool1_2'))
+print("env['TestTool1_2_1'] =", env.get('TestTool1_2_1'))
+print("env['TestTool1_2_2'] =", env.get('TestTool1_2_2'))

File test/toolpath/relative_import/image/tools/TestTool1/TestTool1_1.py Added

View file
  • Ignore whitespace
  • Hide word diff
+def generate(env):
+    env['TestTool1_1'] = 1
+def exists(env):
+    return 1

File test/toolpath/relative_import/image/tools/TestTool1/TestTool1_2/TestTool1_2_1.py Added

View file
  • Ignore whitespace
  • Hide word diff
+def generate(env):
+    env['TestTool1_2_1'] = 1
+def exists(env):
+    return 1

File test/toolpath/relative_import/image/tools/TestTool1/TestTool1_2/TestTool1_2_2/__init__.py Added

View file
  • Ignore whitespace
  • Hide word diff
+def generate(env):
+    env['TestTool1_2_2'] = 1
+def exists(env):
+    return 1

File test/toolpath/relative_import/image/tools/TestTool1/TestTool1_2/TestTool1_2_2/sconstest.skip Added

  • Ignore whitespace
  • Hide word diff
Empty file added.

File test/toolpath/relative_import/image/tools/TestTool1/TestTool1_2/__init__.py Added

View file
  • Ignore whitespace
  • Hide word diff
+from . import TestTool1_2_1
+from . import TestTool1_2_2
+
+def generate(env):
+    env['TestTool1_2'] = 1
+    TestTool1_2_1.generate(env)
+    TestTool1_2_2.generate(env)
+def exists(env):
+    TestTool1_2_1.exists(env)
+    TestTool1_2_2.exists(env)
+    return 1

File test/toolpath/relative_import/image/tools/TestTool1/TestTool1_2/sconstest.skip Added

  • Ignore whitespace
  • Hide word diff
Empty file added.

File test/toolpath/relative_import/image/tools/TestTool1/__init__.py Added

View file
  • Ignore whitespace
  • Hide word diff
+from . import TestTool1_1
+
+def generate(env):
+    env['TestTool1'] = 1
+    # Include another tool within the same directory
+    TestTool1_1.generate(env)
+def exists(env):
+    TestTool1_1.exists(env)
+    return 1

File test/toolpath/relative_import/image/tools/TestTool1/sconstest.skip Added

  • Ignore whitespace
  • Hide word diff
Empty file added.

File test/toolpath/relative_import/relative_import.py Added

View file
  • Ignore whitespace
  • Hide word diff
+#!/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 os.path
+import TestSCons
+
+test = TestSCons.TestSCons()
+
+test.dir_fixture('image')
+
+test.run(arguments = '.', stdout = """\
+scons: Reading SConscript files ...
+env['TestTool1'] = 1
+env['TestTool1_1'] = 1
+env['TestTool1_2'] = 1
+env['TestTool1_2_1'] = 1
+env['TestTool1_2_2'] = 1
+scons: done reading SConscript files.
+scons: Building targets ...
+scons: `.' is up to date.
+scons: done building targets.
+""")
+
+test.pass_test()
+
+# Local Variables:
+# tab-width:4
+# indent-tabs-mode:nil
+# End:
+# vim: set expandtab tabstop=4 shiftwidth=4: