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


Python distutils.core方法代码示例

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


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

示例1: get_num_build_jobs

# 需要导入模块: import distutils [as 别名]
# 或者: from distutils import core [as 别名]
def get_num_build_jobs():
    """
    Get number of parallel build jobs set by the --parallel command line
    argument of setup.py
    If the command did not receive a setting the environment variable
    NPY_NUM_BUILD_JOBS is checked. If that is unset, return the number of
    processors on the system, with a maximum of 8 (to prevent
    overloading the system if there a lot of CPUs).

    Returns
    -------
    out : int
        number of parallel jobs that can be run

    """
    from numpy.distutils.core import get_distribution
    try:
        cpu_count = len(os.sched_getaffinity(0))
    except AttributeError:
        cpu_count = multiprocessing.cpu_count()
    cpu_count = min(cpu_count, 8)
    envjobs = int(os.environ.get("NPY_NUM_BUILD_JOBS", cpu_count))
    dist = get_distribution()
    # may be None during configuration
    if dist is None:
        return envjobs

    # any of these three may have the job set, take the largest
    cmdattr = (getattr(dist.get_command_obj('build'), 'parallel', None),
               getattr(dist.get_command_obj('build_ext'), 'parallel', None),
               getattr(dist.get_command_obj('build_clib'), 'parallel', None))
    if all(x is None for x in cmdattr):
        return envjobs
    else:
        return max(x for x in cmdattr if x is not None) 
开发者ID:Frank-qlu,项目名称:recruit,代码行数:37,代码来源:misc_util.py

示例2: get_distribution

# 需要导入模块: import distutils [as 别名]
# 或者: from distutils import core [as 别名]
def get_distribution(self):
        """Return the distutils distribution object for self."""
        from numpy.distutils.core import get_distribution
        return get_distribution() 
开发者ID:Frank-qlu,项目名称:recruit,代码行数:6,代码来源:misc_util.py

示例3: append_to

# 需要导入模块: import distutils [as 别名]
# 或者: from distutils import core [as 别名]
def append_to(self, extlib):
        """Append libraries, include_dirs to extension or library item.
        """
        if is_sequence(extlib):
            lib_name, build_info = extlib
            dict_append(build_info,
                        libraries=self.libraries,
                        include_dirs=self.include_dirs)
        else:
            from numpy.distutils.core import Extension
            assert isinstance(extlib, Extension), repr(extlib)
            extlib.libraries.extend(self.libraries)
            extlib.include_dirs.extend(self.include_dirs) 
开发者ID:Frank-qlu,项目名称:recruit,代码行数:15,代码来源:misc_util.py

示例4: get_cmd

# 需要导入模块: import distutils [as 别名]
# 或者: from distutils import core [as 别名]
def get_cmd(cmdname, _cache={}):
    if cmdname not in _cache:
        import distutils.core
        dist = distutils.core._setup_distribution
        if dist is None:
            from distutils.errors import DistutilsInternalError
            raise DistutilsInternalError(
                  'setup distribution instance not initialized')
        cmd = dist.get_command_obj(cmdname)
        _cache[cmdname] = cmd
    return _cache[cmdname] 
开发者ID:Frank-qlu,项目名称:recruit,代码行数:13,代码来源:misc_util.py

示例5: get_numpy_include_dirs

# 需要导入模块: import distutils [as 别名]
# 或者: from distutils import core [as 别名]
def get_numpy_include_dirs():
    # numpy_include_dirs are set by numpy/core/setup.py, otherwise []
    include_dirs = Configuration.numpy_include_dirs[:]
    if not include_dirs:
        import numpy
        include_dirs = [ numpy.get_include() ]
    # else running numpy/core/setup.py
    return include_dirs 
开发者ID:Frank-qlu,项目名称:recruit,代码行数:10,代码来源:misc_util.py

示例6: get_num_build_jobs

# 需要导入模块: import distutils [as 别名]
# 或者: from distutils import core [as 别名]
def get_num_build_jobs():
    """
    Get number of parallel build jobs set by the --parallel command line
    argument of setup.py
    If the command did not receive a setting the environment variable
    NPY_NUM_BUILD_JOBS checked and if that is unset it returns 1.

    Returns
    -------
    out : int
        number of parallel jobs that can be run

    """
    from numpy.distutils.core import get_distribution
    envjobs = int(os.environ.get("NPY_NUM_BUILD_JOBS", 1))
    dist = get_distribution()
    # may be None during configuration
    if dist is None:
        return envjobs

    # any of these three may have the job set, take the largest
    cmdattr = (getattr(dist.get_command_obj('build'), 'parallel', None),
               getattr(dist.get_command_obj('build_ext'), 'parallel', None),
               getattr(dist.get_command_obj('build_clib'), 'parallel', None))
    if all(x is None for x in cmdattr):
        return envjobs
    else:
        return max(x for x in cmdattr if x is not None) 
开发者ID:ryfeus,项目名称:lambda-packs,代码行数:30,代码来源:misc_util.py

示例7: get_npy_pkg_dir

# 需要导入模块: import distutils [as 别名]
# 或者: from distutils import core [as 别名]
def get_npy_pkg_dir():
    """Return the path where to find the npy-pkg-config directory."""
    # XXX: import here for bootstrapping reasons
    import numpy
    d = os.path.join(os.path.dirname(numpy.__file__),
            'core', 'lib', 'npy-pkg-config')
    return d 
开发者ID:ryfeus,项目名称:lambda-packs,代码行数:9,代码来源:misc_util.py


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