[pywin32-checkins] pywin32 setup.py,1.12,1.13
OLD project page for the Python extensions for Windows
Brought to you by:
mhammond
From: Mark H. <mha...@us...> - 2005-07-07 14:46:26
|
Update of /cvsroot/pywin32/pywin32 In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv12286 Modified Files: setup.py Log Message: * Write Lib\site-packages\pywin32.version.txt with setup.py's build_id * Pythonwin's Help->About reads this value * binary installer's title is now 'pywin32-2xx' - now fits on the screen! * directsound extension optional based on existance of dsound.h * Check MSVC dirs as well as SDK dirs for optional include files. Index: setup.py =================================================================== RCS file: /cvsroot/pywin32/pywin32/setup.py,v retrieving revision 1.12 retrieving revision 1.13 diff -C2 -d -r1.12 -r1.13 *** setup.py 4 Jul 2005 05:40:27 -0000 1.12 --- setup.py 7 Jul 2005 14:46:07 -0000 1.13 *************** *** 1,3 **** ! build_number=204.1 # Putting buildno at the top prevents automatic __doc__ assignment, and # I *want* the build number at the top :) --- 1,3 ---- ! build_id="204.2" # Putting buildno at the top prevents automatic __doc__ assignment, and # I *want* the build number at the top :) *************** *** 49,52 **** --- 49,53 ---- from distutils.command.install_lib import install_lib from distutils.command.build_ext import build_ext + from distutils.command.build import build from distutils.command.install_data import install_data from distutils.dep_util import newer_group, newer *************** *** 266,269 **** --- 267,282 ---- ################################################################ + class my_build(build): + def run(self): + build.run(self) + # write a pywin32.version.txt. + ver_fname = os.path.join(self.build_base, "pywin32.version.txt") + try: + f = open(ver_fname, "wU") + f.write("%s\n" % build_id) + f.close() + except EnvironmentError, why: + print "Failed to open '%s': %s" % (ver_fname, why) + class my_build_ext(build_ext): *************** *** 329,334 **** % (ext.windows_h_version, self.windows_h_version) for h in ext.optional_headers: ! for d in self.include_dirs: if os.path.isfile(os.path.join(d, h)): break --- 342,348 ---- % (ext.windows_h_version, self.windows_h_version) + look_dirs = self.include_dirs + self.compiler.get_msvc_paths("include") for h in ext.optional_headers: ! for d in look_dirs: if os.path.isfile(os.path.join(d, h)): break *************** *** 549,553 **** objects, ext_filename, **kw) - def build_extension(self, ext): # It is well known that some of these extensions are difficult to --- 563,566 ---- *************** *** 774,786 **** class my_install_data(install_data): ! """A custom install_data command, which will install it's files ! into the standard directories (normally lib/site-packages). ! """ ! def finalize_options(self): ! if self.install_dir is None: ! installobj = self.distribution.get_command_obj('install') ! self.install_dir = installobj.install_lib ! print 'Installing data files to %s' % self.install_dir ! install_data.finalize_options(self) ################################################################ --- 787,799 ---- class my_install_data(install_data): ! """A custom install_data command, which will install it's files ! into the standard directories (normally lib/site-packages). ! """ ! def finalize_options(self): ! if self.install_dir is None: ! installobj = self.distribution.get_command_obj('install') ! self.install_dir = installobj.install_lib ! print 'Installing data files to %s' % self.install_dir ! install_data.finalize_options(self) ################################################################ *************** *** 944,947 **** --- 957,961 ---- WinExt_win32com('ifilter', libraries='ntquery'), WinExt_win32com('directsound', pch_header='directsound_pch.h', + optional_headers = ['dsound.h'], libraries='user32 dsound dxguid'), ] *************** *** 1200,1204 **** dist = setup(name="pywin32", ! version=str(build_number), description="Python for Window Extensions", long_description="Python extensions for Microsoft Windows\n" --- 1214,1218 ---- dist = setup(name="pywin32", ! version=str(build_id), description="Python for Window Extensions", long_description="Python extensions for Microsoft Windows\n" *************** *** 1211,1214 **** --- 1225,1229 ---- license="PSA", cmdclass = { #'install_lib': my_install_lib, + 'build': my_build, 'build_ext': my_build_ext, 'install_data': my_install_data, *************** *** 1217,1221 **** {"install_script": "pywin32_postinstall.py", "pre_install_script": "pywin32_preinstall.py", ! "title": "pywin32 extensions (build %s)" % (build_number,), }, }, --- 1232,1236 ---- {"install_script": "pywin32_postinstall.py", "pre_install_script": "pywin32_preinstall.py", ! "title": "pywin32-%s" % (build_id,), }, }, *************** *** 1232,1239 **** py_modules = py_modules, ! data_files=convert_optional_data_files([ 'PyWin32.chm', ]) + ! convert_data_files([ 'pythonwin/pywin/*.cfg', 'pythonwin/pywin/Demos/*.py', --- 1247,1255 ---- py_modules = py_modules, ! data_files=[('', ('build/pywin32.version.txt',))] + ! convert_optional_data_files([ 'PyWin32.chm', ]) + ! convert_data_files([ 'pythonwin/pywin/*.cfg', 'pythonwin/pywin/Demos/*.py', |