当前位置: 首页>>代码示例>>Python>>正文


Python core.setup方法代码示例

本文整理汇总了Python中numpy.distutils.core.setup方法的典型用法代码示例。如果您正苦于以下问题:Python core.setup方法的具体用法?Python core.setup怎么用?Python core.setup使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在numpy.distutils.core的用法示例。


在下文中一共展示了core.setup方法的12个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: configuration

# 需要导入模块: from numpy.distutils import core [as 别名]
# 或者: from numpy.distutils.core import setup [as 别名]
def configuration(parent_package='', top_path=None):
    # Returns a dictionary suitable for passing to numpy.distutils.core.setup(..)

    from numpy.distutils.misc_util import Configuration

    # BEFORE importing setuptools, remove MANIFEST. Otherwise it may not be
    # properly updated when the contents of directories change (true for distutils,
    # not sure about setuptools).
    if os.path.exists('MANIFEST'):
        os.remove('MANIFEST')

    config = Configuration(None, parent_package, top_path)

    # Avoid non-useful msg:
    # "Ignoring attempt to set 'name' (from ... "
    config.set_options(ignore_setup_xxx_py=True,
                       assume_default_configuration=True,
                       delegate_options_to_subpackages=True,
                       quiet=True)

    config.add_subpackage('skmultiflow', subpackage_path='src/skmultiflow')

    return config 
开发者ID:scikit-multiflow,项目名称:scikit-multiflow,代码行数:25,代码来源:setup.py

示例2: setup_package

# 需要导入模块: from numpy.distutils import core [as 别名]
# 或者: from numpy.distutils.core import setup [as 别名]
def setup_package():

    # rewrite version file
    write_version_py()

    try:
        from numpy.distutils.core import setup
    except:
        from distutils.core import setup

    setup(
        name=NAME,
        maintainer=MAINTAINER,
        maintainer_email=MAINTAINER_EMAIL,
        description=DESCRIPTION,
        long_description=LONG_DESCRIPTION,
        url=URL,
        version=VERSION,
        download_url=DOWNLOAD_URL,
        license=LICENSE,
        classifiers=CLASSIFIERS,
        platforms=PLATFORMS,
        configuration=configuration,
        scripts=SCRIPTS,
    ) 
开发者ID:nguy,项目名称:artview,代码行数:27,代码来源:setup.py

示例3: setup

# 需要导入模块: from numpy.distutils import core [as 别名]
# 或者: from numpy.distutils.core import setup [as 别名]
def setup(self):
        if sys.platform == 'win32':
            pytest.skip('Fails with MinGW64 Gfortran (Issue #9673)')

        if self.module is not None:
            return

        # Check compiler availability first
        if not has_c_compiler():
            pytest.skip("No C compiler available")

        codes = []
        if self.sources:
            codes.extend(self.sources)
        if self.code is not None:
            codes.append(self.suffix)

        needs_f77 = False
        needs_f90 = False
        for fn in codes:
            if fn.endswith('.f'):
                needs_f77 = True
            elif fn.endswith('.f90'):
                needs_f90 = True
        if needs_f77 and not has_f77_compiler():
            pytest.skip("No Fortran 77 compiler available")
        if needs_f90 and not has_f90_compiler():
            pytest.skip("No Fortran 90 compiler available")

        # Build the module
        if self.code is not None:
            self.module = build_code(self.code, options=self.options,
                                     skip=self.skip, only=self.only,
                                     suffix=self.suffix,
                                     module_name=self.module_name)

        if self.sources is not None:
            self.module = build_module(self.sources, options=self.options,
                                       skip=self.skip, only=self.only,
                                       module_name=self.module_name) 
开发者ID:Frank-qlu,项目名称:recruit,代码行数:42,代码来源:util.py

示例4: setup

# 需要导入模块: from numpy.distutils import core [as 别名]
# 或者: from numpy.distutils.core import setup [as 别名]
def setup(self):
        if self.module is not None:
            return

        # Check compiler availability first
        if not has_c_compiler():
            raise SkipTest("No C compiler available")

        codes = []
        if self.sources:
            codes.extend(self.sources)
        if self.code is not None:
            codes.append(self.suffix)

        needs_f77 = False
        needs_f90 = False
        for fn in codes:
            if fn.endswith('.f'):
                needs_f77 = True
            elif fn.endswith('.f90'):
                needs_f90 = True
        if needs_f77 and not has_f77_compiler():
            raise SkipTest("No Fortran 77 compiler available")
        if needs_f90 and not has_f90_compiler():
            raise SkipTest("No Fortran 90 compiler available")

        # Build the module
        if self.code is not None:
            self.module = build_code(self.code, options=self.options,
                                     skip=self.skip, only=self.only,
                                     suffix=self.suffix,
                                     module_name=self.module_name)

        if self.sources is not None:
            self.module = build_module(self.sources, options=self.options,
                                       skip=self.skip, only=self.only,
                                       module_name=self.module_name) 
开发者ID:birforce,项目名称:vnpy_crypto,代码行数:39,代码来源:util.py

示例5: dummy_dist

# 需要导入模块: from numpy.distutils import core [as 别名]
# 或者: from numpy.distutils.core import setup [as 别名]
def dummy_dist():
    # create a dummy distribution.  It will look at any site configuration files
    # and parse the command line to pick up any user configured stuff.  The
    # resulting Distribution object is returned from setup.
    # Setting _setup_stop_after prevents the any commands from actually executing.
    distutils.core._setup_stop_after = "commandline"
    dist = setup(name="dummy")
    distutils.core._setup_stop_after = None
    return dist 
开发者ID:ktraunmueller,项目名称:Computable,代码行数:11,代码来源:platform_info.py

示例6: setup

# 需要导入模块: from numpy.distutils import core [as 别名]
# 或者: from numpy.distutils.core import setup [as 别名]
def setup(self):
        if sys.platform == 'win32':
            raise SkipTest('Fails with MinGW64 Gfortran (Issue #9673)')

        if self.module is not None:
            return

        # Check compiler availability first
        if not has_c_compiler():
            raise SkipTest("No C compiler available")

        codes = []
        if self.sources:
            codes.extend(self.sources)
        if self.code is not None:
            codes.append(self.suffix)

        needs_f77 = False
        needs_f90 = False
        for fn in codes:
            if fn.endswith('.f'):
                needs_f77 = True
            elif fn.endswith('.f90'):
                needs_f90 = True
        if needs_f77 and not has_f77_compiler():
            raise SkipTest("No Fortran 77 compiler available")
        if needs_f90 and not has_f90_compiler():
            raise SkipTest("No Fortran 90 compiler available")

        # Build the module
        if self.code is not None:
            self.module = build_code(self.code, options=self.options,
                                     skip=self.skip, only=self.only,
                                     suffix=self.suffix,
                                     module_name=self.module_name)

        if self.sources is not None:
            self.module = build_module(self.sources, options=self.options,
                                       skip=self.skip, only=self.only,
                                       module_name=self.module_name) 
开发者ID:Relph1119,项目名称:GraphicDesignPatternByPython,代码行数:42,代码来源:util.py

示例7: write_version_py

# 需要导入模块: from numpy.distutils import core [as 别名]
# 或者: from numpy.distutils.core import setup [as 别名]
def write_version_py(filename='scikits/umfpack/version.py'):
    cnt = """# THIS FILE IS GENERATED FROM scikit-umfpack SETUP.PY
short_version = '%(version)s'
version = '%(version)s'
full_version = '%(full_version)s'
git_revision = '%(git_revision)s'
release = %(isrelease)s

if not release:
    version = full_version
"""
    FULLVERSION, GIT_REVISION = get_version_info()

    a = open(filename, 'w')
    try:
        a.write(cnt % {'version': VERSION,
                       'full_version': FULLVERSION,
                       'git_revision': GIT_REVISION,
                       'isrelease': str(ISRELEASED)})
    finally:
        a.close()

###############################################################################
# Optional setuptools features
# We need to import setuptools early, if we want setuptools features,
# as it monkey-patches the 'setup' function

# For some commands, use setuptools 
开发者ID:scikit-umfpack,项目名称:scikit-umfpack,代码行数:30,代码来源:setup.py

示例8: _set_directories

# 需要导入模块: from numpy.distutils import core [as 别名]
# 或者: from numpy.distutils.core import setup [as 别名]
def _set_directories(self):
        # directory paths
        self.curdir = os.path.dirname(os.path.abspath(__file__))
        # build directories
        self.build_assimulo = os.path.join("build","assimulo")
        self.build_assimulo_thirdparty = os.path.join(self.build_assimulo,'thirdparty')
        # destination directories
        self.desSrc = os.path.join(self.curdir,self.build_assimulo)
        self.desLib = os.path.join(self.desSrc,"lib")
        self.desSolvers = os.path.join(self.desSrc,"solvers")
        self.desExamples = os.path.join(self.desSrc,"examples")
        self.desMain = os.path.join(self.curdir,"build")
        self.desTests = os.path.join(self.desSrc,"tests")
        self.desTestsSolvers = os.path.join(self.desTests,"solvers")
        self.desThirdParty=dict([(thp,os.path.join(self.curdir,self.build_assimulo_thirdparty,thp)) 
                                          for thp in self.thirdparty_methods])
        # filelists
        
        self.fileSrc     = os.listdir("src")
        self.fileLib     = os.listdir(os.path.join("src","lib"))
        self.fileSolvers = os.listdir(os.path.join("src","solvers"))
        self.fileExamples= os.listdir("examples")
        self.fileMain    = ["setup.py","README","INSTALL","CHANGELOG","MANIFEST.in"]
        self.fileMainIncludes = ["README","CHANGELOG", "LICENSE"]
        self.fileTests   = os.listdir("tests")
        self.filelist_thirdparty=dict([(thp,os.listdir(os.path.join("thirdparty",thp))) 
                                         for thp in self.thirdparty_methods])
        self.fileTestsSolvers = os.listdir(os.path.join("tests","solvers")) 
开发者ID:modelon-community,项目名称:Assimulo,代码行数:30,代码来源:setup.py

示例9: setup_package

# 需要导入模块: from numpy.distutils import core [as 别名]
# 或者: from numpy.distutils.core import setup [as 别名]
def setup_package():
    from numpy.distutils.core import setup
    old_path = os.getcwd()
    local_path = os.path.dirname(os.path.abspath(sys.argv[0]))
    src_path = local_path

    os.chdir(local_path)
    sys.path.insert(0, local_path)

    # Run build
    old_path = os.getcwd()
    os.chdir(src_path)
    sys.path.insert(0, src_path)

    cwd = os.path.abspath(os.path.dirname(__file__))
    if not os.path.exists(os.path.join(cwd, 'PKG-INFO')):
        # Generate Cython sources, unless building from source release
        generate_cython(PACKAGE_NAME)

    try:
        setup(name=PACKAGE_NAME,
              author=AUTHOR,
              author_email=AUTHOR_EMAIL,
              url=URL,
              download_url=DOWNLOAD_URL,
              description=DESCRIPTION,
              long_description = LONG_DESCRIPTION,
              version=version(PACKAGE_NAME),
              license=LICENSE,
              configuration=configuration,
              keywords = ['time series','machine learning','bayesian statistics'],
              install_requires=['numpy', 'pandas', 'scipy', 'numdifftools','patsy'])
    finally:
        del sys.path[0]
        os.chdir(old_path)

    return 
开发者ID:RJT1990,项目名称:pyflux,代码行数:39,代码来源:setup.py

示例10: _get_compiler_status

# 需要导入模块: from numpy.distutils import core [as 别名]
# 或者: from numpy.distutils.core import setup [as 别名]
def _get_compiler_status():
    global _compiler_status
    if _compiler_status is not None:
        return _compiler_status

    _compiler_status = (False, False, False)

    # XXX: this is really ugly. But I don't know how to invoke Distutils
    #      in a safer way...
    code = """
import os
import sys
sys.path = %(syspath)s

def configuration(parent_name='',top_path=None):
    global config
    from numpy.distutils.misc_util import Configuration
    config = Configuration('', parent_name, top_path)
    return config

from numpy.distutils.core import setup
setup(configuration=configuration)

config_cmd = config.get_config_cmd()
have_c = config_cmd.try_compile('void foo() {}')
print('COMPILERS:%%d,%%d,%%d' %% (have_c,
                                  config.have_f77c(),
                                  config.have_f90c()))
sys.exit(99)
"""
    code = code % dict(syspath=repr(sys.path))

    with temppath(suffix='.py') as script:
        with open(script, 'w') as f:
            f.write(code)

        cmd = [sys.executable, script, 'config']
        p = subprocess.Popen(cmd, stdout=subprocess.PIPE,
                             stderr=subprocess.STDOUT)
        out, err = p.communicate()

    m = re.search(br'COMPILERS:(\d+),(\d+),(\d+)', out)
    if m:
        _compiler_status = (bool(int(m.group(1))), bool(int(m.group(2))),
                            bool(int(m.group(3))))
    # Finished
    return _compiler_status 
开发者ID:Frank-qlu,项目名称:recruit,代码行数:49,代码来源:util.py

示例11: setup_package

# 需要导入模块: from numpy.distutils import core [as 别名]
# 或者: from numpy.distutils.core import setup [as 别名]
def setup_package():
    try:
        from numpy import get_include
    except ImportError:
        print('To install scikit-multiflow first install numpy.\n' +
              'For example, using pip:\n' +
              '$ pip install -U numpy')
        sys.exit(1)

    metadata = dict(name=DIST_NAME,
                    version=VERSION,
                    license=LICENSE,
                    url=URL,
                    download_url=DOWNLOAD_URL,
                    project_urls=PROJECT_URLS,
                    maintainer=MAINTAINER,
                    maintainer_email=MAINTAINER_EMAIL,
                    description=DESCRIPTION,
                    long_description=LONG_DESCRIPTION,
                    long_description_content_type='text/markdown',
                    package_dir={'': 'src'},
                    install_requires=INSTALL_REQUIRES,
                    setup_requires=['pytest-runner'],
                    tests_require=['pytest'],
                    classifiers=["Intended Audience :: Developers",
                                 "Intended Audience :: Science/Research",
                                 'Programming Language :: C',
                                 'Programming Language :: Python',
                                 "Programming Language :: Python :: 3",
                                 'Programming Language :: Python :: 3.5',
                                 'Programming Language :: Python :: 3.6',
                                 'Programming Language :: Python :: 3.7',
                                 'Programming Language :: Python :: 3.8',
                                 "Topic :: Scientific/Engineering",
                                 "Topic :: Scientific/Engineering :: Artificial Intelligence",
                                 "Topic :: Software Development",
                                 "License :: OSI Approved :: BSD License",
                                 'Operating System :: POSIX',
                                 'Operating System :: Unix',
                                 'Operating System :: MacOS',
                                 'Operating System :: Microsoft :: Windows'
                                 ],
                    python_requires=">=3.5",
                    zip_safe=False,  # the package can run out of an .egg file
                    include_package_data=True,
                    cmdclass={'sdist': sdist})

    if sys.version_info < (3, 5):
        raise RuntimeError("scikit-multiflow requires Python 3.5 or later. "
                           "The current Python version is {} installed in {}}.".
                           format(platform.python_version(), sys.executable))

    from numpy.distutils.core import setup

    metadata['configuration'] = configuration

    setup(**metadata) 
开发者ID:scikit-multiflow,项目名称:scikit-multiflow,代码行数:59,代码来源:setup.py

示例12: do_setup

# 需要导入模块: from numpy.distutils import core [as 别名]
# 或者: from numpy.distutils.core import setup [as 别名]
def do_setup():
    # setup the config
    metadata = dict(name=DISTNAME,
                    maintainer=MAINTAINER,
                    maintainer_email=MAINTAINER_EMAIL,
                    description=DESCRIPTION,
                    license=LICENSE,
                    version=VERSION,
                    classifiers=['Intended Audience :: Science/Research',
                                 'Intended Audience :: Developers',
                                 'Intended Audience :: Scikit-learn users',
                                 'Programming Language :: Python',
                                 'Topic :: Machine Learning',
                                 'Topic :: Software Development',
                                 'Topic :: Scientific/Engineering',
                                 'Operating System :: Microsoft :: Windows',
                                 'Operating System :: POSIX',
                                 'Operating System :: Unix',
                                 'Operating System :: MacOS',
                                 'Programming Language :: Python :: 2.7'
                                 ],
                    keywords='sklearn scikit-learn tensorflow auto-encoders neural-networks class-imbalance',
                    # packages=[DISTNAME],
                    # install_requires=REQUIREMENTS,
                    cmdclass=cmdclass)

    if len(sys.argv) == 1 or (
            len(sys.argv) >= 2 and ('--help' in sys.argv[1:] or
                                    sys.argv[1] in ('--help-commands',
                                                    'egg-info',
                                                    '--version',
                                                    'clean'))):
        # For these actions, NumPy is not required
        try:
            from setuptools import setup
        except ImportError:
            from distutils.core import setup

    else:  # we DO need numpy
        try:
            from numpy.distutils.core import setup
        except ImportError:
            raise RuntimeError('Need numpy to build %s' % DISTNAME)

        # add the config to the metadata
        metadata['configuration'] = configuration

    # call setup on the dict
    setup(**metadata) 
开发者ID:tgsmith61591,项目名称:smrt,代码行数:51,代码来源:setup.py


注:本文中的numpy.distutils.core.setup方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。