def run_setup(): setup_args = metadata.copy() if setuptools: setup_args['zip_safe'] = False setup_args['install_requires'] = ['numpy'] PETSC_DIR = os.environ.get('PETSC_DIR') if not (PETSC_DIR and os.path.isdir(PETSC_DIR)): vstr = setup_args['version'].split('.')[:2] x, y = int(vstr[0]), int(vstr[1]) PETSC = ">=%s.%s,<%s.%s" % (x, y, x, y + 1) setup_args['install_requires'] += ['petsc' + PETSC] if setuptools: src = os.path.join('src', 'petsc4py.PETSc.c') has_src = os.path.exists(os.path.join(topdir, src)) has_git = os.path.isdir(os.path.join(topdir, '.git')) has_hg = os.path.isdir(os.path.join(topdir, '.hg')) suffix = os.path.join('src', 'binding', 'petsc4py') in_petsc = topdir.endswith(os.path.sep + suffix) if not has_src or has_git or has_hg or in_petsc: setup_args['setup_requires'] = ['Cython>=' + CYTHON] # setup(packages=[ 'petsc4py', 'petsc4py.lib', ], package_dir={ 'petsc4py': 'src', 'petsc4py.lib': 'src/lib' }, package_data={ 'petsc4py': [ 'include/petsc4py/*.h', 'include/petsc4py/*.i', 'include/petsc4py/*.pxd', 'include/petsc4py/*.pxi', 'include/petsc4py/*.pyx', 'PETSc.pxd', ], 'petsc4py.lib': ['petsc.cfg'], }, ext_modules=get_ext_modules(Extension), cmdclass={ 'config': config, 'build': build, 'build_src': build_src, 'build_ext': build_ext, 'install': install, 'clean': clean, 'test': test, 'sdist': sdist, }, **setup_args)
def run_setup(): setup_args = metadata.copy() if setuptools: setup_args['zip_safe'] = False setup_args['install_requires'] = ['numpy'] PETSC_DIR = os.environ.get('PETSC_DIR') if not (PETSC_DIR and os.path.isdir(PETSC_DIR)): vstr = setup_args['version'].split('.')[:2] x, y = int(vstr[0]), int(vstr[1]) PETSC = ">=%s.%s,<%s.%s" % (x, y, x, y+1) setup_args['install_requires'] += ['petsc'+PETSC] if setuptools: src = os.path.join('src', 'petsc4py.PETSc.c') has_src = os.path.exists(os.path.join(topdir, src)) has_git = os.path.isdir(os.path.join(topdir, '.git')) has_hg = os.path.isdir(os.path.join(topdir, '.hg')) if not has_src or has_git or has_hg: setup_args['setup_requires'] = ['Cython>='+CYTHON] # setup(packages = ['petsc4py', 'petsc4py.lib',], package_dir = {'petsc4py' : 'src', 'petsc4py.lib' : 'src/lib'}, package_data = {'petsc4py' : ['include/petsc4py/*.h', 'include/petsc4py/*.i', 'include/petsc4py/*.pxd', 'include/petsc4py/*.pxi', 'include/petsc4py/*.pyx', 'PETSc.pxd',], 'petsc4py.lib' : ['petsc.cfg'],}, ext_modules = get_ext_modules(Extension), cmdclass = {'config' : config, 'build' : build, 'build_src' : build_src, 'build_ext' : build_ext, 'install' : install, 'clean' : clean, 'test' : test, 'sdist' : sdist, }, **setup_args)