From: <mcf...@us...> - 2003-07-01 04:16:16
|
Update of /cvsroot/pydispatcher/dispatch In directory sc8-pr-cvs1:/tmp/cvs-serv6411 Added Files: setup.py Log Message: Very preliminary distutils setup script added --- NEW FILE: setup.py --- #!/usr/bin/env python """Installs PyDispatcher using distutils Run: python setup.py install to install the package from the source archive. """ if __name__ == "__main__": import sys,os, string from distutils.sysconfig import * from distutils.core import setup,Extension from distutils.command.build_ext import build_ext from distutils.command.install import install from distutils.command.install_data import install_data ##from my_install_data import * ############## ## 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', '.max','.gz','.bat') def nonPythonFile( file ): if string.lower( file ) == 'cvs': return 0 else: return (os.path.splitext( file )[1]).lower() not in excludedTypes dataDirectories = [ '.', 'tests', ] for directory in dataDirectories: finalFiles = [] for file in os.listdir( directory): fullFile = os.path.join( directory, file ) if os.path.isfile(fullFile) and nonPythonFile(fullFile): finalFiles.append (os.path.join(directory, file)) if finalFiles: dataFiles.append ( (os.path.join('dispatch',directory),finalFiles) ) ### Now the actual set up call setup ( name = "PyDispatcher", 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", license = "BSD-style, see license.txt for details", package_dir = { 'dispatch':'.', }, packages = [ 'dispatch', 'dispatch.test', ], # non python files of examples data_files = dataFiles, cmdclass = {'install_data':smart_install_data}, ) |