############################################################################ # Keith R. Jackson, LBNL #Copyright (c) 2003, The Regents of the University of California, #through Lawrence Berkeley National Laboratory #(subject to receipt of any required approvals from the U.S. Dept. of Energy). #All rights reserved. ########################################################################### """ pyGlobus 2.4 """ from distutils.core import setup, Extension from distutils.spawn import spawn from distutils.sysconfig import get_python_inc from distutils.sysconfig import get_config_vars from distutils.util import get_platform from os import environ, popen4 from os.path import isfile import sys, string, re, exceptions, glob, os import pickle from time import gmtime, strftime, time begin_time = time() SUN_CC = 'cc' LD_SHARED = "ld -G" CC_SHARED ="-KPIC" CC_OPTS = "-DNDEBUG -g" GLOBUS_LOCATION = None FLAVOR = "gcc32dbgpthr" RUN_SWIG = 0 WARNINGS_ON = 0 COMPILE_CC = 0 DEBUG = 0 MAKE_MFH_CACHE = 0 USE_MFH_CACHE = 0 RUN_EPYDOC = 0 RUN_EPYDOCIFY = 1 GLOBUS_LIBS = None GLOBUS_PACKAGES = None SWIG_ARGS = ["-python", "-noproxy", "-DHAVE_CONFIG_H", "-I%s" % get_python_inc(plat_specific=1)] GLOBUS_DEPS = {"util" : "globus_common"} MAKEFILE_HEADER = None BUILT_LIST = [] FAILED_LIST = [] MODULE_LIST = ['util','ftpClient','ftpControl','gassCache', 'gassCopy','gassServerEZ', 'myProxy', 'gassTransfer','gramClient','io','security', 'rlsClient'] HelpText = '\n***pyGlobus 2.4 setup.py*** \n',\ '--h This help text \n',\ '--flavor=X Set build flavor to X \n', \ '--run-swig Run SWIG to generate Globus shared objects. \n', \ ' Note: Only needs to be called if src or pyGlobus \n',\ ' source has been modified.\n',\ '--compile-cc Run compiler (Solaris only?) \n',\ ' --use-compiler=X Use compiler X for build \n',\ ' --with-modules=X Use X as list of modules to build rather than all. \n',\ ' --link-with=X Link with shared object list X. \n',\ ' --shared-args=X List of shared objects to build with. \n ',\ ' --compiler-opts=X List of compiler options to build with. \n', \ '--debug Build with debug options enabled. \n',\ '--run-epydoc Generate epydoc reference documentation. \n',\ '--make-gmfh-cache Generate Globus makefile header cache.\n',\ '--use-gmfh-cache Use Globus makefile header cache.\n\n',\ # Get GLOBUS_LOCATION, exit if it doesn't exist try: GLOBUS_LOCATION = environ["GLOBUS_LOCATION"] except KeyError: print "GLOBUS_LOCATION must be set before installing pyGlobus" sys.exit(-1) # Globus-2.2 requires GPT_LOCATION be set before running # globus-makefile-header # But not on windows, because there is no GPT on windows, d'oh if sys.platform != 'win32': try: environ["GPT_LOCATION"] except KeyError: print "GPT_LOCATION must be set before installing pyGlobus" sys.exit(-1) # parse special command line options and remove them # this way distutils won't attempt to parse them. args = sys.argv[1:] for arg in args: if string.find(arg, '--help') == 0: sys.argv.remove(arg) for x in HelpText: print x assert 0, '--help called. Exiting.' if string.find(arg, '--flavor=') == 0: FLAVOR = string.split(arg, '=')[1] sys.argv.remove(arg) elif string.find(arg, '--make-gmfh-cache') == 0: MAKE_MFH_CACHE = 1 sys.argv.remove(arg) elif string.find(arg, '--use-gmfh-cache') == 0: USE_MFH_CACHE = 1 sys.argv.remove(arg) elif string.find(arg, '--run-swig') == 0: RUN_SWIG = 1 sys.argv.remove(arg) elif string.find(arg, '--compile-cc') == 0: COMPILE_CC = 1 sys.argv.remove(arg) elif string.find(arg, '--use-compiler') == 0: if COMPILE_CC: SUN_CC = string.split(arg, '=')[1] sys.argv.remove(arg) else: print "You must specify --compile-cc if you want to specify a compiler" print "Exiting" sys.exit(1) elif string.find(arg, '--link-with') == 0: if COMPILE_CC: LD_SHARED = string.split(arg, '=')[1] sys.argv.remove(arg) else: print "You must specify --compile-cc if you want to specify linking options" print "Exiting" sys.exit(1) elif string.find(arg, '--shared-args') == 0: if COMPILE_CC: CC_SHARED = string.split(arg, '=')[1] sys.argv.remove(arg) else: print "You must specify --compile-cc if you want to specify shared argument options" print "Exiting" sys.exit(1) elif string.find(arg, '--compiler-opts') == 0: if COMPILE_CC: CC_OPTS = string.split(arg, '=')[1] sys.argv.remove(arg) else: print "You must specify --compile-cc if you want to specify compiler options" print "Exiting" sys.exit(1) elif string.find(arg, '--run-epydoc') == 0: RUN_EPYDOC = 1 sys.argv.remove(arg) elif string.find(arg, '--debug') == 0: DEBUG = 1 sys.argv.remove(arg) elif string.find(arg, '--with-modules') == 0: modules = string.split(arg, '=')[1] mList = [] while not modules == '': indx = modules.find(',') if indx == -1: mName = modules modules = '' else: mName = modules[:indx] modules = modules[indx +1:] mList.append(mName) MODULE_LIST = mList sys.argv.remove(arg) gmh_path_list = [os.path.join("%s", "sbin", "globus-makefile-header"), os.path.join("%s", "sbin", "globus-makefile-header.py"), os.path.join("%s", "bin", "globus-makefile-header"), os.path.join("%s", "bin", "globus-makefile-header.py")] #Find globus-makefile-header. If unable to find it, exit MAKEFILE_HEADER = None for gmhp in gmh_path_list: tp = gmhp % GLOBUS_LOCATION if isfile(tp): MAKEFILE_HEADER = "%s -flavor=%s" % (tp, FLAVOR) if MAKEFILE_HEADER == None: print "Unable to locate globus-makefile-header or globus-makefile-header.py in either $GLOBUS_LOCATION/[bin,sbin]. This must be found before installing pyGlobus." sys.exit(-2) errRegEx = r".*ERROR.*|\s*No packages were found.*" incRegEx = r"\s*GLOBUS_INCLUDES\s*=\s*" cflagsRegEx = r"\s*GLOBUS_CFLAGS\s*=\s*" pkgLibRegEx = r"\s*GLOBUS_PKG_LIBS\s*=\s*" ldFlagsRegEx = r"\s*GLOBUS_LDFLAGS\s*=\s*" libsRegEx = r"\s*GLOBUS_LIBS\s*=\s*" ERR_PATTERN = re.compile(errRegEx) INC_PATTERN = re.compile(incRegEx) CFLAGS_PATTERN = re.compile(cflagsRegEx) PKGLIBS_PATTERN = re.compile(pkgLibRegEx) LDFLAGS_PATTERN = re.compile(ldFlagsRegEx) LIBS_PATTERN = re.compile(libsRegEx) class DependencyException(exceptions.Exception): pass def build_module_lists(mList = MODULE_LIST): print "Checking for which modules to build" swigList = [] pyModList = [] eModList = [] for module in mList: if module == 'util': check_util(pyModList, eModList, swigList) elif module == 'ftpClient': check_ftpClient(pyModList, eModList, swigList) elif module == 'ftpControl': check_ftpControl(pyModList, eModList, swigList) elif module == 'gassCache': check_gassCache(pyModList, eModList, swigList) elif module == 'gassCopy': check_gassCopy(pyModList, eModList, swigList) elif module == 'gassServerEZ': check_gassServerEZ(pyModList, eModList, swigList) elif module == 'gassTransfer': check_gassTransfer(pyModList, eModList, swigList) elif module == 'gramClient': check_gramClient(pyModList, eModList, swigList) elif module == 'io': check_io(pyModList, eModList, swigList) elif module == 'security': check_security(pyModList, eModList, swigList) elif module == 'rlsClient': check_rlsClient(pyModList, eModList, swigList) elif module == 'myProxy': check_myProxy(pyModList, eModList, swigList) else: raise DependencyException , "bad name: %s in module_list" %(module) return pyModList, eModList, swigList def check_util(pyModList, eModList, swigList): print "Checking the util module" dep = "globus_common" try: libList, incList, cFlagsList, ldFlagsList = get_makefile_output(dep) except DependencyException, ex: print "Missing dependency to build the util package." print "This package is required to build all of pyGlobus." print "The following is the error message from globus-makefile-header." print ex.args print "Now exiting from the build." sys.exit(-1) e = Extension("utilc", ["src/util_wrap.c"], include_dirs=incList, library_dirs=ldFlagsList, extra_compile_args=cFlagsList, libraries=libList) eModList.append(e) swigList.append(("util.i", "util_wrap.c")) pyModList.append("pyGlobus.util") pyModList.append("pyGlobus.logUtil") pyModList.append("pyGlobus.test.test_util") pyModList.append("pyGlobus.test.test_pyGlobus") pyModList.append("pyGlobus.test.config") BUILT_LIST.append("util") print "The util module will be built" return def check_rlsClient(pyModList, eModList, swigList): print "Checking the rlsClient module" dep = "globus_rls_client" try: libList, incList, cFlagsList, ldFlagsList = get_makefile_output(dep) except DependencyException, ex: print "Missing dependency to build the rlsClient package." print "Will skip this package" print "The following error from globus-makefile-header lists the missing dependencies." print ex.args FAILED_LIST.append("rlsClient") return e = Extension("rlsClientc", ["src/rlsClient_wrap.c"], include_dirs=incList, library_dirs=ldFlagsList, extra_compile_args=cFlagsList, libraries=libList) eModList.append(e) swigList.append(("rlsClient.i", "rlsClient_wrap.c")) pyModList.append("pyGlobus.rlsClient") pyModList.append("pyGlobus.test.test_RlsClient") pyModList.append("pyGlobus.test.test_rlsClient") BUILT_LIST.append("rlsClient") print "The rlsClient module will be built" return def check_myProxy(pyModList, eModList, swigList): print "Checking the myProxy module" dep = "myproxy" try: libList, incList, cFlagsList, ldFlagsList = get_makefile_output(dep) except DependencyException, ex: print "Missing dependency to build the myProxy package." print "Will skip this package" print "The following error from globus-makefile-header lists the missing dependencies." print ex.args FAILED_LIST.append("myProxy") return e = Extension("myProxyc", ["src/myProxy_wrap.c"], include_dirs=incList, library_dirs=ldFlagsList, extra_compile_args=cFlagsList, libraries=libList) eModList.append(e) swigList.append(("myProxy.i", "myProxy_wrap.c")) pyModList.append("pyGlobus.myProxy") pyModList.append("pyGlobus.test.testMyProxy") BUILT_LIST.append("myProxy") print "The myProxy module will be built" return def check_ftpClient(pyModList, eModList, swigList): print "Checking the ftpClient module" dep = "globus_ftp_client" try: libList, incList, cFlagsList, ldFlagsList = get_makefile_output(dep) except DependencyException, ex: print "Missing dependency to build the ftpClient package." print "Will skip this package" print "The following error from globus-makefile-header lists the missing dependencies." print ex.args FAILED_LIST.append("ftpClient") return e = Extension("ftpClientc", ["src/ftpClient_wrap.c"], include_dirs=incList, library_dirs=ldFlagsList, extra_compile_args=cFlagsList, libraries=libList) eModList.append(e) swigList.append(("ftpClient.i", "ftpClient_wrap.c")) pyModList.append("pyGlobus.ftpClient") pyModList.append("pyGlobus.ftpClientAttr") pyModList.append("pyGlobus.ftpClientPlugin") pyModList.append("pyGlobus.test.test_FtpClient") pyModList.append("pyGlobus.test.test_FtpClientAttr") pyModList.append("pyGlobus.test.test_ftpClient") pyModList.append("pyGlobus.test.test_EasyFtpClient") pyModList.append("pyGlobus.test.test_FtpClientPlugin") BUILT_LIST.append("ftpClient") print "The ftpClient module will be built" return def check_ftpControl(pyModList, eModList, swigList): print "Checking the ftpControl module" dep = "globus_ftp_control" try: libList, incList, cFlagsList, ldFlagsList = get_makefile_output(dep) except DependencyException, ex: print "Missing dependency to build the ftpControl package." print "Will skip this package" print "The following error from globus-makefile-header lists the missing dependencies." print ex.args FAILED_LIST.append("ftpControl") return e = Extension("ftpControlc", ["src/ftpControl_wrap.c"], include_dirs=incList, library_dirs=ldFlagsList, extra_compile_args=cFlagsList, libraries=libList) eModList.append(e) swigList.append(("ftpControl.i", "ftpControl_wrap.c")) pyModList.append("pyGlobus.ftpControl") pyModList.append("pyGlobus.test.test_FtpControl") pyModList.append("pyGlobus.test.test_ftpControl") BUILT_LIST.append("ftpControl") print "The ftpControl module will be built" return def check_gassCache(pyModList, eModList, swigList): print "Checking the gassCache module" dep = "globus_gass_cache" try: libList, incList, cFlagsList, ldFlagsList = get_makefile_output(dep) except DependencyException, ex: print "Missing dependency to build the gassCache package." print "Will skip this package" print "The following error from globus-makefile-header lists the missing dependencies." print ex.args FAILED_LIST.append("gassCache") return e = Extension("gassCachec", ["src/gassCache_wrap.c"], include_dirs=incList, library_dirs=ldFlagsList, extra_compile_args=cFlagsList, libraries=libList) eModList.append(e) swigList.append(("gassCache.i", "gassCache_wrap.c")) pyModList.append("pyGlobus.gassCache") pyModList.append("pyGlobus.test.test_GassCache") pyModList.append("pyGlobus.test.test_gassCache") BUILT_LIST.append("gassCache") print "The gassCache module will be built" return def check_gassCopy(pyModList, eModList, swigList): print "Checking the gassCopy module" dep = "globus_gass_copy" try: libList, incList, cFlagsList, ldFlagsList = get_makefile_output(dep) except DependencyException, ex: print "Missing dependency to build the gassCopy package." print "Will skip this package" print "The following error from globus-makefile-header lists the missing dependencies." print ex.args FAILED_LIST.append("gassCopy") return e = Extension("gassCopyc", ["src/gassCopy_wrap.c"], include_dirs=incList, library_dirs=ldFlagsList, extra_compile_args=cFlagsList, libraries=libList) eModList.append(e) swigList.append(("gassCopy.i", "gassCopy_wrap.c")) pyModList.append("pyGlobus.gassCopy") pyModList.append("pyGlobus.test.test_GassCopy") pyModList.append("pyGlobus.test.test_gassCopy") BUILT_LIST.append("gassCopy") print "The gassCopy module will be built" return def check_gassServerEZ(pyModList, eModList, swigList): print "Checking the gassServerEZ module" dep = "globus_gass_server_ez" try: libList, incList, cFlagsList, ldFlagsList = get_makefile_output(dep) except DependencyException, ex: print "Missing dependency to build the gassServerEZ package." print "Will skip this package" print "The following error from globus-makefile-header lists the missing dependencies." print ex.args FAILED_LIST.append("gassServerEZ") return e = Extension("gassServerEZc", ["src/gassServerEZ_wrap.c"], include_dirs=incList, library_dirs=ldFlagsList, extra_compile_args=cFlagsList, libraries=libList) eModList.append(e) swigList.append(("gassServerEZ.i", "gassServerEZ_wrap.c")) pyModList.append("pyGlobus.gassServerEZ") pyModList.append("pyGlobus.test.test_GassServerEZ") pyModList.append("pyGlobus.test.test_gassServerEZ") BUILT_LIST.append("gassServerEZ") print "The gassServerEZ module will be built" return def check_gassTransfer(pyModList, eModList, swigList): print "Checking the gassTransfer module" dep = "globus_gass_transfer" try: libList, incList, cFlagsList, ldFlagsList = get_makefile_output(dep) except DependencyException, ex: print "Missing dependency to build the gassTransfer package." print "Will skip this package" print "The following error from globus-makefile-header lists the missing dependencies." print ex.args FAILED_LIST.append("gassTransfer") return e = Extension("gassTransferc", ["src/gassTransfer_wrap.c"], include_dirs=incList, library_dirs=ldFlagsList, extra_compile_args=cFlagsList, libraries=libList) eModList.append(e) swigList.append(("gassTransfer.i", "gassTransfer_wrap.c")) pyModList.append("pyGlobus.gassTransfer") pyModList.append("pyGlobus.test.test_GassTransfer") pyModList.append("pyGlobus.test.test_gassTransfer") BUILT_LIST.append("gassTransfer") print "The gassTransfer module will be built" return def check_gramClient(pyModList, eModList, swigList): print "Checking the gramClient module" dep = "globus_gram_client" try: libList, incList, cFlagsList, ldFlagsList = get_makefile_output(dep) except DependencyException, ex: print "Missing dependency to build the gramClient package." print "Will skip this package" print "The following error from globus-makefile-header lists the missing dependencies." print ex.args FAILED_LIST.append("gramClient") return e = Extension("gramClientc", ["src/gramClient_wrap.c"], include_dirs=incList, library_dirs=ldFlagsList, extra_compile_args=cFlagsList, libraries=libList) eModList.append(e) swigList.append(("gramClient.i", "gramClient_wrap.c")) pyModList.append("pyGlobus.rsl") pyModList.append("pyGlobus.gramClient") pyModList.append("pyGlobus.test.test_GramClient") pyModList.append("pyGlobus.test.test_gramClient") BUILT_LIST.append("gramClient") print "The gramClient module will be built" return def check_io(pyModList, eModList, swigList): print "Checking the io module" dep = "globus_io" try: libList, incList, cFlagsList, ldFlagsList = get_makefile_output(dep) except DependencyException, ex: print "Missing dependency to build the io package." print "Will skip this package" print "The following error from globus-makefile-header lists the missing dependencies." print ex.args FAILED_LIST.append("io") return e = Extension("ioc", ["src/io_wrap.c"], include_dirs=incList, library_dirs=ldFlagsList, extra_compile_args=cFlagsList, libraries=libList) eModList.append(e) swigList.append(("io.i", "io_wrap.c")) pyModList.append("pyGlobus.io") pyModList.append("pyGlobus.ioAttr") pyModList.append("pyGlobus.asynGSI") pyModList.append("pyGlobus.GSISOAP") pyModList.append("pyGlobus.GSIasyncore") pyModList.append("pyGlobus.test.test_GSITcpClient") pyModList.append("pyGlobus.test.test_io") pyModList.append("pyGlobus.test.test_GSITCPSocket") pyModList.append("pyGlobus.test.test_GSITCPSocketServer") pyModList.append("pyGlobus.test.testTcpClient") pyModList.append("pyGlobus.test.testTcpServer") BUILT_LIST.append("io") print "The io module will be built" return def check_security(pyModList, eModList, swigList): print "Checking the security module" dep = "globus_gss_assist" try: libList, incList, cFlagsList, ldFlagsList = get_makefile_output(dep) except DependencyException, ex: print "Missing dependency to build the security package." print "Will skip this package" print "The following error from globus-makefile-header lists the missing dependencies." print ex.args FAILED_LIST.append("security") return e = Extension("gsic", ["src/gsi_wrap.c"], include_dirs=incList, library_dirs=ldFlagsList, extra_compile_args=cFlagsList, libraries=libList) eModList.append(e) swigList.append(("gsi.i", "gsi_wrap.c")) pyModList.append("pyGlobus.security") pyModList.append("pyGlobus.test.test_GSSCred") pyModList.append("pyGlobus.test.test_GSSContext") pyModList.append("pyGlobus.test.test_GSSSimpleClasses") pyModList.append("pyGlobus.test.test_security") pyModList.append("pyGlobus.test.testGridProxyInit") pyModList.append("pyGlobus.test.test_SecurityFunctions") BUILT_LIST.append("security") print "The security module will be built" return def get_makefile_output(dep): pLibsStr = None eLibsStr = None cFlagsStr = None includeStr = None ldFlagsStr = None libList = [] incList = [] ldFlagsList = [] cFlagsList = [] if USE_MFH_CACHE==1: mfh_path = os.path.join('gmfh_cache',os.uname()[0],FLAVOR+'/') picklein = None try: picklein = pickle.load(open(mfh_path+dep)) except: ex = DependencyException('No cache file for %s' % (mfh_path+dep)) raise ex [libList, incList, cFlagsList, ldFlagsList] = picklein return libList, incList, cFlagsList, ldFlagsList inStrm, outStrm = popen4("%s %s" % (MAKEFILE_HEADER, dep)) for line in outStrm.readlines(): m = ERR_PATTERN.match(line) if m: raise DependencyException(line) m = INC_PATTERN.match(line) if m: includeStr = INC_PATTERN.split(line)[1] for str in string.split(includeStr): s = string.strip(str)[2:] incList.append(s) continue m = CFLAGS_PATTERN.match(line) if m: cFlagsStr = CFLAGS_PATTERN.split(line)[1] for str in string.split(cFlagsStr): if str =="-Wall": if WARNINGS_ON==1: cFlagsList.append(str) if str !="-Wall": cFlagsList.append(str) continue m = PKGLIBS_PATTERN.match(line) if m: pLibsStr = PKGLIBS_PATTERN.split(line)[1] i = 0 for str in string.split(pLibsStr): s = string.strip(str)[2:] libList.insert(i, s) i += 1 continue m = LDFLAGS_PATTERN.match(line) if m: ldFlagsStr = LDFLAGS_PATTERN.split(line)[1] for str in string.split(ldFlagsStr): s = string.strip(str)[2:] ldFlagsList.append(s) continue m = LIBS_PATTERN.match(line) if m: eLibsStr = LIBS_PATTERN.split(line)[1] for str in string.split(eLibsStr): s = string.strip(str)[2:] libList.append(s) continue if DEBUG: libList.append('wad') if MAKE_MFH_CACHE==1: mfh_path = os.path.join('gmfh_cache',os.uname()[0],FLAVOR+'/') cachefile = [] try: os.makedirs(mfh_path) except: pass try: os.system('rm '+mfh_path+dep) except: pass try: cachefile = open(mfh_path+dep,"w") except s: print 'open failed',s assert 0, 'make makefile header had problems loading cachefile, try --make-gmfh-cache first' saver = pickle.dump([libList,incList,cFlagsList,ldFlagsList], cachefile) return libList, incList, cFlagsList, ldFlagsList def make_data_list(): dirList = os.listdir(os.getcwd()) try: dirList.index("doc") except ValueError, ex: return [] l = [('doc/pyGlobus', glob.glob('doc' + os.sep + '*')), ('doc/pyGlobus' + os.sep + 'public', glob.glob('doc' + os.sep + 'public' + os.sep + '*')), ('doc/pyGlobus' + os.sep + 'private', glob.glob('doc' + os.sep + 'private' + os.sep + '*'))] try: l[0][1].remove('doc/public') except: pass try: l[0][1].remove('doc/private') except: pass return l # Distutils doesn't currently work with recent 1.3.x # versions of swig. def run_swig(swigList): for s in swigList: cmd = ["swig"] + SWIG_ARGS + ["-o", "./src/%s" % (s[1]), "./src/%s" % (s[0])] spawn(cmd, verbose=1) #Replace configuration variables to use the cc compiler and linker def run_compile_cc(cv): cv["CC"] = SUN_CC cv["CCSHARED"] = CC_SHARED cv["OPT"] = CC_OPTS cv["LDSHARED"] = LD_SHARED def run_epydocify(): # will copy epydocified files to $PYTHONPATH/pyGlobus # but keep pyGlobus/ source the same! try: spawn(['mkdir', 'pyGlobus/tmp-epydoc']) # i hope people didnt make a tmp directory in pyGlobus except: print 'whoopsie!' flist = glob.glob('pyGlobus/*.py') #find all files in pyGlobus directory and copy to tmp for x in flist: try: shutil.copyfile(x,'pyGlobus/tmp') except: print 'convert to pass!' runstr = [sys.executable, 'scripts/epydocify.py'] # run epydocify on all source in tmp dir runstr.extend(glob.glob('pyGlobus/tmp/*.py')) spawn(runstr,verbose=1) runstr = [sys.executable, 'scripts/epydocify.py', '--replace-old-source'] # run epydocify repsource on tmpdir flist = glob.glob('pyGlobus/tmp/*.py') try: flist.remove(glob.glob('pyGlobus/gasscache.py')) print flist except: print 'problem removing gasscache preformatted file' runstr.extend(flist) spawn(runstr,verbose=1) flist = glob.glob('pyGlobus/tmp/*.py') for x in flist: shutil.copyfile(x, os.environ['PYTHONPATH']+'/pyGlobus/') try: for x in flist: spawn(['rm','-rf', x]) spawn(['rmdir', 'pyGlobus/tmp']) except: pass def run_epydoc(): # this gets run on the $PYTHONPATH/pyGlobus directory plat = get_platform() vers = sys.version_info # dir = 'build%slib.%s-%i.%i%spyGlobus%s*.py' % (os.sep, plat, vers[0], # vers[1], os.sep, os.sep) dir = os.environ['PYTHONPATH'] + '/pyGlobus/*.py' flist = glob.glob(dir) cmd = ['epydoc','--ignore-param-mismatch','-o', 'doc'] for x in flist: x = x.replace(os.environ['PYTHONPATH'],'$PYTHONPATH') cmd.extend(flist) spawn(cmd, verbose=1) pyModList, eModList, swigList = build_module_lists() dataList = make_data_list() if RUN_SWIG: run_swig(swigList) #Remove flags from the compile line that through lots # of warnings. cv = get_config_vars() try: opts = cv["OPT"] opts = opts.replace("-Wall", "") opts = opts.replace("-Wstrict-prototypes", "") cv["OPT"] = opts except: print "No OPT environment variable set." pass if sys.platform[:6] == 'darwin': ld = cv['LDSHARED'] ld += " -bundle_loader %s" % sys.executable cv['LDSHARED'] = ld if COMPILE_CC: run_compile_cc(cv) setup(name="pyGlobus", version="gt-2.4.x-1.0.2", description="Python Globus Toolkit wrapper", author="Keith Jackson", author_email="KRJackson@lbl.gov", url="http://www-itg.lbl.gov/gtg/pyGlobus/", py_modules=pyModList, ext_package="pyGlobus", ext_modules=eModList, data_files=dataList) if RUN_EPYDOCIFY and RUN_EPYDOC: run_epydocify() if RUN_EPYDOC: run_epydoc() print "Built the following packages:\n" for mod in BUILT_LIST: print mod if not FAILED_LIST == []: print "\n\nFailed to build the following packages due to missing dependencies:\n" for mod in FAILED_LIST: print mod print 'Build finished at: ', strftime("%a, %d %b %Y %H:%M:%S +0000", gmtime()) print 'Completed in', time() - begin_time, 'seconds'