示例#1
0
文件: setup.py 项目: xqding/mpi4py
def run_setup():
    """
    Call setup(*args, **kargs)
    """
    setup_args = metadata.copy()
    if setuptools:
        setup_args['zip_safe'] = False
    if setuptools and not os.getenv('CONDA_BUILD'):
        src = os.path.join('src', 'mpi4py.MPI.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=['mpi4py', 'mpi4py.futures'],
          package_dir={'mpi4py': 'src/mpi4py'},
          package_data={
              'mpi4py': [
                  '*.pxd',
                  'include/mpi4py/*.h',
                  'include/mpi4py/*.i',
                  'include/mpi4py/*.pxi',
              ]
          },
          ext_modules=[Ext(**ext) for ext in ext_modules()],
          libraries=[Lib(**lib) for lib in libraries()],
          executables=[Exe(**exe) for exe in executables()],
          **setup_args)
示例#2
0
文件: setup.py 项目: mpi4py/mpi4py
def run_setup():
    """
    Call setuptools.setup(*args, **kwargs)
    """
    try:
        import setuptools
    except ImportError:
        setuptools = None
    from mpidistutils import setup
    from mpidistutils import Extension  as Ext
    from mpidistutils import Executable as Exe
    #
    from mpidistutils import build_src
    build_src.sources = sources()
    #
    builder_args = dict(
        ext_modules = [Ext(**ext) for ext in extensions()],
        executables = [Exe(**exe) for exe in executables()],
    )
    if setuptools:
        builder_args['zip_safe'] = False
        metadata.update(metadata_extra)
    #
    setup_args = dict(i for d in (
        metadata,
        package_info,
        builder_args,
    ) for i in d.items())
    #
    setup(**setup_args)