From: <mcf...@us...> - 2003-07-06 21:22:55
|
Update of /cvsroot/pydispatcher/dispatch In directory sc8-pr-cvs1:/tmp/cvs-serv4655 Modified Files: setup.py Added Files: MANIFEST.in Log Message: Added automatic scanning for non-python files to include, created manifest file for source distribution specification. --- NEW FILE: MANIFEST.in --- include MANIFEST.in include license.txt include *.py include docs include docs/style include docs/images include *.html include *.css include *.png global-exclude *.bat Index: setup.py =================================================================== RCS file: /cvsroot/pydispatcher/dispatch/setup.py,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** setup.py 1 Jul 2003 04:51:25 -0000 1.2 --- setup.py 6 Jul 2003 21:22:52 -0000 1.3 *************** *** 8,15 **** if __name__ == "__main__": ! import sys,os, string from distutils.sysconfig import * from distutils.core import setup ### Now the actual set up call setup ( --- 8,56 ---- if __name__ == "__main__": ! import sys,os, string, fnmatch from distutils.sysconfig import * from distutils.core import setup + ############## + ## Following is from Pete Shinners, + ## apparently it will work around the reported bug on + ## some unix machines where the data files are copied + ## to weird locations if the user's configuration options + ## were entered during the wrong phase of the moon :) . + from distutils.command.install_data import install_data + class smart_install_data(install_data): + def run(self): + #need to change self.install_dir to the library dir + install_cmd = self.get_finalized_command('install') + self.install_dir = getattr(install_cmd, 'install_lib') + # should create the directory if it doesn't exist!!! + return install_data.run(self) + ############## + ### The following automates the inclusion of files while avoiding problems with UNIX + ### where case sensitivity matters. + dataFiles = [] + excludedTypes = ('.py','.pyc','.pyo','.db','.gz','.bat', ".cvsignore") + excludedDirectories = ('build','dist','cvs') + def nonPythonFile( file ): + """Is the fully-qualified name a non-python file""" + if os.path.isfile( file ): + return (os.path.splitext( file )[1]).lower() not in excludedTypes + def directoryWalker( argument, directory, files, prefix = "dispatch"): + """Walk the particular directory searching for non-python files + + prefix -- prefix directory appended to the destination + directories, normally the name of the target package + """ + if os.path.split(directory.lower())[-1] in excludedDirectories: + return + result = [] + for file in files: + file = os.path.join(directory,file ) + if nonPythonFile( file ): + result.append( file ) + if result: + argument.append((os.path.join(prefix,directory), result)) + os.path.walk( '.', directoryWalker, dataFiles) + ### Now the actual set up call setup ( *************** *** 17,21 **** version = "1.0.0a1", description = "Multi-producer-multi-consumer signal dispatching mechanism", ! author = "Patrick K. O'Brien, Mike Fletcher", author_email = "pyd...@li...", url = "http://pydispatcher.sourceforge.net", --- 58,62 ---- version = "1.0.0a1", description = "Multi-producer-multi-consumer signal dispatching mechanism", ! author = "Patrick K. O'Brien", author_email = "pyd...@li...", url = "http://pydispatcher.sourceforge.net", *************** *** 28,36 **** packages = [ 'dispatch', ! 'dispatch.test', ], ! # non python files of examples options = { 'sdist':{'use_defaults':0, 'force_manifest':1}, 'bdist_rpm':{ 'group':'Libraries/Python', --- 69,79 ---- packages = [ 'dispatch', ! 'dispatch.tests', ! 'dispatch.examples', ], ! options = { 'sdist':{'use_defaults':0, 'force_manifest':1}, + "install_lib":{"compile":0, "optimize":0}, 'bdist_rpm':{ 'group':'Libraries/Python', *************** *** 57,60 **** --- 100,105 ---- }, }, + data_files = dataFiles, + cmdclass = {'install_data':smart_install_data}, ) |