[pywin32-checkins] pywin32 setup.py, 1.81.2.5, 1.81.2.6 setup3.py, 1.1.2.1, 1.1.2.2
OLD project page for the Python extensions for Windows
Brought to you by:
mhammond
From: Mark H. <mha...@us...> - 2008-11-26 07:17:49
|
Update of /cvsroot/pywin32/pywin32 In directory ddv4jf1.ch3.sourceforge.com:/tmp/cvs-serv14888 Modified Files: Tag: py3k setup.py setup3.py Log Message: Merge various changes from trunk and py3k-integration bzr branch Index: setup.py =================================================================== RCS file: /cvsroot/pywin32/pywin32/setup.py,v retrieving revision 1.81.2.5 retrieving revision 1.81.2.6 diff -C2 -d -r1.81.2.5 -r1.81.2.6 *** setup.py 24 Nov 2008 06:14:33 -0000 1.81.2.5 --- setup.py 26 Nov 2008 07:17:38 -0000 1.81.2.6 *************** *** 1,3 **** ! build_id="212.1" # may optionally include a ".{patchno}" suffix. # Putting buildno at the top prevents automatic __doc__ assignment, and # I *want* the build number at the top :) --- 1,3 ---- ! build_id="212.5" # may optionally include a ".{patchno}" suffix. # Putting buildno at the top prevents automatic __doc__ assignment, and # I *want* the build number at the top :) *************** *** 73,76 **** --- 73,77 ---- import _winreg + is_py3k = sys.version_info > (3,) # get this out of the way early on... # The rest of our imports. *************** *** 268,271 **** --- 269,273 ---- define_macros = define_macros or [] define_macros.append(("DISTUTILS_BUILD", None)) + define_macros.append(("_CRT_SECURE_NO_WARNINGS", None)) self.pch_header = pch_header self.extra_swig_commands = extra_swig_commands or [] *************** *** 306,320 **** return result dsp_path = os.path.dirname(dsp) for line in open(dsp, "r"): fields = line.strip().split("=", 2) if fields[0]=="SOURCE": ! if os.path.splitext(fields[1])[1].lower() in ['.cpp', '.c', '.i', '.rc', '.mc']: pathname = os.path.normpath(os.path.join(dsp_path, fields[1])) result.append(pathname) # Sort the sources so that (for example) the .mc file is processed first, # building this may create files included by other source files. - # Note that this requires a patch to distutils' ccompiler classes so that - # they build the sources in the order given. build_order = ".i .mc .rc .cpp".split() decorated = [(build_order.index(os.path.splitext(fname)[-1].lower()), fname) --- 308,333 ---- return result dsp_path = os.path.dirname(dsp) + seen_swigs = [] for line in open(dsp, "r"): fields = line.strip().split("=", 2) if fields[0]=="SOURCE": ! ext = os.path.splitext(fields[1])[1].lower() ! if ext in ['.cpp', '.c', '.i', '.rc', '.mc']: pathname = os.path.normpath(os.path.join(dsp_path, fields[1])) result.append(pathname) + if ext == '.i': + seen_swigs.append(pathname) + # ack - .dsp files may have references to the generated 'foomodule.cpp' + # from 'foo.i' - but we now do things differently... + for ss in seen_swigs: + base, ext = os.path.splitext(ss) + nuke = base + "module.cpp" + try: + result.remove(nuke) + except ValueError: + pass # Sort the sources so that (for example) the .mc file is processed first, # building this may create files included by other source files. build_order = ".i .mc .rc .cpp".split() decorated = [(build_order.index(os.path.splitext(fname)[-1].lower()), fname) *************** *** 391,395 **** unicode_mode = self.unicode_mode if unicode_mode is None: ! unicode_mode = sys.version_info > (3,) if unicode_mode: self.extra_compile_args.append("/DUNICODE") --- 404,408 ---- unicode_mode = self.unicode_mode if unicode_mode is None: ! unicode_mode = is_py3k if unicode_mode: self.extra_compile_args.append("/DUNICODE") *************** *** 484,492 **** # Start with 2to3 related stuff for py3k. ! is_py3k = sys.version_info > (3,) ! if is_py3k: def refactor_filenames(filenames): from lib2to3.refactor import RefactoringTool, get_fixers_from_package fixers = get_fixers_from_package('lib2to3.fixes') options = dict(doctests_only=False, fix=[], list_fixes=[], print_function=False, verbose=False, --- 497,512 ---- # Start with 2to3 related stuff for py3k. ! do_2to3 = False and is_py3k # XXX - py3k branch - syntax is already py3k! ! if do_2to3: ! # hack into the import fixer to remove the Tk fixers - they cause trouble ! # for some of our things with the same name. ! from lib2to3.fixes import fix_imports ! # 'Dialog' fixer causes pywin/mfc/dialog.py's DlgSimpleImport to subclass ! # a Tk dialog instead of a pywin one! ! del fix_imports.MAPPING["Dialog"] def refactor_filenames(filenames): from lib2to3.refactor import RefactoringTool, get_fixers_from_package fixers = get_fixers_from_package('lib2to3.fixes') + options = dict(doctests_only=False, fix=[], list_fixes=[], print_function=False, verbose=False, *************** *** 509,513 **** # 'build_py' command ! if is_py3k: # Force 2to3 to be run for py3k versions. class my_build_py(build_py): --- 529,533 ---- # 'build_py' command ! if do_2to3: # Force 2to3 to be run for py3k versions. class my_build_py(build_py): *************** *** 538,542 **** # 'build_scripts' command ! if is_py3k: class my_build_scripts(build_scripts): def copy_file(self, src, dest): --- 558,562 ---- # 'build_scripts' command ! if do_2to3: class my_build_scripts(build_scripts): def copy_file(self, src, dest): *************** *** 1090,1095 **** return build_ext.get_export_symbols(self, ext) ! def find_swig (self): ! if "SWIG" in os.environ: swig = os.environ["SWIG"] else: --- 1110,1119 ---- return build_ext.get_export_symbols(self, ext) ! def find_swig(self): ! if is_py3k and "SWIG_PY3" in os.environ: ! swig = os.environ["SWIG_PY3"] ! elif not is_py3k and "SWIG_PY2" in os.environ: ! swig = os.environ["SWIG_PY2"] ! elif "SWIG" in os.environ: swig = os.environ["SWIG"] else: *************** *** 1100,1104 **** return swig ! def swig_sources (self, sources, ext=None): new_sources = [] swig_sources = [] --- 1124,1128 ---- return swig ! def swig_sources(self, sources, ext=None): new_sources = [] swig_sources = [] *************** *** 1108,1115 **** # source -- but there should be an option to put SWIG output in # the temp dir. ! # XXX - Note that swig_wince_modules no longer #include the real ! # generated .cpp file (well, they do, but are avoided via the ! # pre-processor.) So this is no longer a reason we can't generate ! # directly to the temp directory. target_ext = '.cpp' for source in sources: --- 1132,1137 ---- # source -- but there should be an option to put SWIG output in # the temp dir. ! # Adding py3k to the mix means we *really* need to move to generating ! # to the temp dir... target_ext = '.cpp' for source in sources: *************** *** 1119,1124 **** continue swig_sources.append(source) ! # Patch up the filenames for SWIG modules that also build ! # under WinCE - see defn of swig_wince_modules for details if os.path.basename(base) in swig_interface_parents: swig_targets[source] = base + target_ext --- 1141,1145 ---- continue swig_sources.append(source) ! # Patch up the filenames for various special cases... if os.path.basename(base) in swig_interface_parents: swig_targets[source] = base + target_ext *************** *** 1127,1142 **** # More vile hacks. winxpmodule is built from win32gui.i - # just different #defines are setup for windows.h. new_target = os.path.join(os.path.dirname(base), ! "winxpguimodule") + target_ext ! swig_targets[source] = new_target ! new_sources.append(new_target) ! elif os.path.basename(base) in swig_wince_modules: ! # We need to add this .cpp to the sources, so it ! # will be built. ! new_target = base + 'module_win32' + target_ext swig_targets[source] = new_target new_sources.append(new_target) else: ! swig_targets[source] = base + 'module' + target_ext else: new_sources.append(source) --- 1148,1161 ---- # More vile hacks. winxpmodule is built from win32gui.i - # just different #defines are setup for windows.h. + pyver = sys.version_info[0] # 2 or 3! new_target = os.path.join(os.path.dirname(base), ! "winxpgui_py%d_swig%s" % (pyver, target_ext)) swig_targets[source] = new_target new_sources.append(new_target) else: ! pyver = sys.version_info[0] # 2 or 3! ! new_target = '%s_py%d_swig%s' % (base, pyver, target_ext) ! new_sources.append(new_target) ! swig_targets[source] = new_target else: new_sources.append(source) *************** *** 1172,1179 **** # build for any platform sees these as dirty. # This could probably go once we generate .cpp into the temp dir. ! if self.force or newer(os.path.abspath(source), os.path.abspath(target)): ! swig_cmd.extend(["-o", ! os.path.abspath(target), ! os.path.abspath(source)]) log.info("swigging %s to %s", source, target) out_dir = os.path.dirname(source) --- 1191,1200 ---- # build for any platform sees these as dirty. # This could probably go once we generate .cpp into the temp dir. ! fqsource = os.path.abspath(source) ! fqtarget = os.path.abspath(target) ! rebuild = self.force or newer(fqsource, fqtarget) ! log.debug("should swig %s->%s=%s", source, target, rebuild) ! if rebuild: ! swig_cmd.extend(["-o", fqtarget, fqsource]) log.info("swigging %s to %s", source, target) out_dir = os.path.dirname(source) *************** *** 1292,1295 **** --- 1313,1318 ---- except ImportError: ok = False + # XXX - verstamp still broken on py3k + ok = False if ok: stamp_script = os.path.join(sys.prefix, "Lib", "site-packages", *************** *** 1352,1356 **** def copy_file(self, src, dest): ! dest, copied = build_scripts.copy_file(self, src, dest) # 2to3 if not self.dry_run and copied: --- 1375,1379 ---- def copy_file(self, src, dest): ! dest, copied = install_data.copy_file(self, src, dest) # 2to3 if not self.dry_run and copied: *************** *** 1386,1390 **** ("win32api", "user32 advapi32 shell32 version", None, 0x0500, 'win32/src/win32apimodule.cpp win32/src/win32api_display.cpp'), ("win32cred", "AdvAPI32 credui", True, 0x0501, 'win32/src/win32credmodule.cpp'), ! ("win32crypt", "Crypt32", None, 0x0500, 'win32/src/win32crypt.i win32/src/win32cryptmodule.cpp'), ("win32file", "oleaut32", None, 0x0500), ("win32event", "user32", None), --- 1409,1413 ---- ("win32api", "user32 advapi32 shell32 version", None, 0x0500, 'win32/src/win32apimodule.cpp win32/src/win32api_display.cpp'), ("win32cred", "AdvAPI32 credui", True, 0x0501, 'win32/src/win32credmodule.cpp'), ! ("win32crypt", "Crypt32", None, 0x0500, 'win32/src/win32crypt.i'), ("win32file", "oleaut32", None, 0x0500), ("win32event", "user32", None), *************** *** 1392,1396 **** ("win32evtlog", "advapi32 oleaut32", None), # win32gui handled below ! ("win32job", "user32", None, 0x0500, 'win32/src/win32job.i win32/src/win32jobmodule.cpp'), ("win32lz", "lz32", None), ("win32net", "netapi32 advapi32", True, None, """ --- 1415,1419 ---- ("win32evtlog", "advapi32 oleaut32", None), # win32gui handled below ! ("win32job", "user32", True, 0x0500, 'win32/src/win32job.i'), ("win32lz", "lz32", None), ("win32net", "netapi32 advapi32", True, None, """ *************** *** 1407,1411 **** ("win32ras", "rasapi32 user32", None), ("win32security", "advapi32 user32 netapi32", True, 0x0500, """ ! win32/src/win32security.i win32/src/win32securitymodule.cpp win32/src/win32security_sspi.cpp win32/src/win32security_ds.cpp """), --- 1430,1434 ---- ("win32ras", "rasapi32 user32", None), ("win32security", "advapi32 user32 netapi32", True, 0x0500, """ ! win32/src/win32security.i win32/src/win32security_sspi.cpp win32/src/win32security_ds.cpp """), *************** *** 1414,1418 **** ("win32wnet", "netapi32 mpr", None), ("win32inet", "wininet", None, 0x500, """ ! win32/src/win32inet.i win32/src/win32inetmodule.cpp win32/src/win32inet_winhttp.cpp""" ), --- 1437,1441 ---- ("win32wnet", "netapi32 mpr", None), ("win32inet", "wininet", None, 0x500, """ ! win32/src/win32inet.i win32/src/win32inet_winhttp.cpp""" ), *************** *** 1466,1470 **** # winxptheme WinExt_win32("_winxptheme", ! sources = ["win32/src/_winxptheme.i", "win32/src/_winxpthememodule.cpp"], libraries="gdi32 user32 comdlg32 comctl32 shell32 Uxtheme", windows_h_version=0x0500, --- 1489,1493 ---- # winxptheme WinExt_win32("_winxptheme", ! sources = ["win32/src/_winxptheme.i"], libraries="gdi32 user32 comdlg32 comctl32 shell32 Uxtheme", windows_h_version=0x0500, *************** *** 1771,1778 **** } - # A list of modules that can also be built for Windows CE. These generate - # their .i to _win32.cpp or _wince.cpp. - swig_wince_modules = "win32event win32file win32gui win32process".split() - # .i files that are #included, and hence are not part of the build. Our .dsp # parser isn't smart enough to differentiate these. --- 1794,1797 ---- *************** *** 1893,1900 **** other_extensions ! if sys.version_info > (3,): py3k_skip_modules = \ """odbc win32evtlog win32print win32security win32inet adsi internet ! mapi shell bits ifilter isapi PyISAPI_loader """.split() ext_modules = [e for e in ext_modules if e.name not in py3k_skip_modules] --- 1912,1919 ---- other_extensions ! if is_py3k: py3k_skip_modules = \ """odbc win32evtlog win32print win32security win32inet adsi internet ! mapi bits ifilter isapi PyISAPI_loader """.split() ext_modules = [e for e in ext_modules if e.name not in py3k_skip_modules] Index: setup3.py =================================================================== RCS file: /cvsroot/pywin32/pywin32/Attic/setup3.py,v retrieving revision 1.1.2.1 retrieving revision 1.1.2.2 diff -C2 -d -r1.1.2.1 -r1.1.2.2 *** setup3.py 1 Oct 2008 13:08:17 -0000 1.1.2.1 --- setup3.py 26 Nov 2008 07:17:38 -0000 1.1.2.2 *************** *** 4,8 **** from lib2to3.refactor import RefactoringTool, get_fixers_from_package ! fixers = get_fixers_from_package('lib2to3.fixes') options = dict(doctests_only=False, fix=[], list_fixes=[], print_function=False, verbose=False, --- 4,8 ---- from lib2to3.refactor import RefactoringTool, get_fixers_from_package ! fixers = ['lib2to3.fixes.fix_print', 'lib2to3.fixes.fix_except', 'lib2to3.fixes.fix_imports'] #get_fixers_from_package('lib2to3.fixes') options = dict(doctests_only=False, fix=[], list_fixes=[], print_function=False, verbose=False, |