def download_version(version='current', dest_dir=None): """Download specific expyfun version Parameters ---------- version : str Version to check out (7-character git commit number). Can also be ``'current'`` (default) to download whatever the latest ``upstream/master`` version is. dest_dir : str | None Destination directory. If None, the current working directory is used. Notes ----- This function requires installation of ``gitpython``. """ _check_git() _check_version_format(version) if dest_dir is None: dest_dir = os.getcwd() if not isinstance(dest_dir, string_types) or not op.isdir(dest_dir): raise IOError('Destination directory {0} does not exist' ''.format(dest_dir)) if op.isdir(op.join(dest_dir, 'expyfun')): raise IOError('Destination directory {0} already has "expyfun" ' 'subdirectory'.format(dest_dir)) # fetch locally and get the proper version tempdir = _TempDir() expyfun_dir = op.join(tempdir, 'expyfun') # git will auto-create this dir repo_url = 'git://github.com/LABSN/expyfun.git' run_subprocess(['git', 'clone', repo_url, expyfun_dir]) version = _active_version(expyfun_dir) if version == 'current' else version try: run_subprocess(['git', 'checkout', version], cwd=expyfun_dir) except Exception as exp: raise RuntimeError('Could not check out version {0}: {1}' ''.format(version, str(exp))) assert _active_version(expyfun_dir) == version # install orig_dir = os.getcwd() os.chdir(expyfun_dir) sys.path.insert(0, expyfun_dir) # ensure our new "setup" is imported orig_stdout = sys.stdout try: from setup import git_version, setup_package assert git_version().lower() == version[:7].lower() sys.stdout = StringIO() with warnings.catch_warnings(record=True): # PEP440 setup_package(script_args=['build', '--build-purelib', dest_dir]) finally: sys.stdout = orig_stdout sys.path.pop(sys.path.index(expyfun_dir)) os.chdir(orig_dir) print('Successfully checked out expyfun version:\n\n%s\n\ninto ' 'destination directory:\n\n%s\n' % (version, op.join(dest_dir)))
def download_version(version, dest_dir=None): """Download specific expyfun version Parameters ---------- version : str Version to check out (7-character git commit number). dest_dir : str | None Destination directory. If None, the current working directory is used. Notes ----- This function requires installation of ``gitpython``. """ _check_git() _check_version_format(version) if dest_dir is None: dest_dir = os.getcwd() if not isinstance(dest_dir, string_types) or not op.isdir(dest_dir): raise IOError('Destination directory {0} does not exist' ''.format(dest_dir)) if op.isdir(op.join(dest_dir, 'expyfun')): raise IOError('Destination directory {0} already has "expyfun" ' 'subdirectory'.format(dest_dir)) # fetch locally and get the proper version tempdir = _TempDir() expyfun_dir = op.join(tempdir, 'expyfun') # git will auto-create this dir repo_url = 'git://github.com/LABSN/expyfun.git' run_subprocess(['git', 'clone', repo_url, expyfun_dir]) try: run_subprocess(['git', 'checkout', version], cwd=expyfun_dir) except Exception as exp: raise RuntimeError('Could not check out version {0}: {1}' ''.format(version, str(exp))) # install orig_dir = os.getcwd() os.chdir(expyfun_dir) sys.path.insert(0, expyfun_dir) # ensure our new "setup" is imported try: from setup import git_version, setup_package assert git_version().lower() == version[:7].lower() setup_package(script_args=['build', '--build-purelib', dest_dir]) finally: sys.path.pop(sys.path.index(expyfun_dir)) os.chdir(orig_dir)
description = "Intel Fortran Cross-Compiler for 64-bit MIC" executables = { 'version_cmd' : None, # set by update_executables 'compiler_f77' : [None, "-72"], 'compiler_f90' : [None], 'compiler_fix' : [None, "-FI"], 'linker_so' : ["<F90>", "-shared"], 'archiver' : ["ar", "-cr"], 'ranlib' : ["ranlib"] } def get_flags(self): # for Intel Fortran, -fp-model source is the same as precise without a compiler warning return ["-fPIC -shared -mmic -mkl -fp-model strict -g " + xcdirflags] def get_flags_linker_so(self): return self.get_flags() def get_flags_opt(self): return [''] def get_version(self): return "TODO" fcompiler.load_all_fcompiler_classes() # print fcompiler.fcompiler_class # {name: (name, klass, desc), ...} fcompiler.fcompiler_class['intelmic'] = ('intelmic', IntelMICFCompiler, IntelMICFCompiler.description) setup.setup_package()
import sys import py4a if __name__ == "__main__": py4a.patch_distutils() sys.argv = sys.argv[1:] # remove py4a # PyCrypto # import setup # numpy import setup setup.setup_package() # vi: ft=python:et:ts=4:nowrap:fdm=marker
"""Build python-scipy without xplt on archs where this causes the build to fail """ from setup import setup_package import os if __name__ == "__main__": ignore_packages = [] try: host_arch = os.environ['DEB_HOST_ARCH'] except KeyError: print 'DEB_HOST_ARCH not set. Running dpkg-architecture to find out' command = 'dpkg-architecture -qDEB_HOST_ARCH' host_arch = os.popen(command).read().strip() if host_arch in ('hppa', 'ia64', 'mips', 'mipsel', 's390'): ignore_packages.append('xplt') setup_package(ignore_packages)