• 大小: 21MB
    文件类型: .gz
    金币: 1
    下载: 0 次
    发布日期: 2023-06-28
  • 语言: Python
  • 标签: python  

资源简介

Python-3.6.6.tar.gz 官网的下载速度是贼慢

资源截图

代码片段和文件信息

# Autodetecting setup.py script for building the Python extensions
#

import sys os importlib.machinery re optparse
from glob import glob
import importlib._bootstrap
import importlib.util
import sysconfig

from distutils import log
from distutils.errors import *
from distutils.core import Extension setup
from distutils.command.build_ext import build_ext
from distutils.command.install import install
from distutils.command.install_lib import install_lib
from distutils.command.build_scripts import build_scripts
from distutils.spawn import find_executable

cross_compiling = “_PYTHON_HOST_PLATFORM“ in os.environ

# Add special CFLAGS reserved for building the interpreter and the stdlib
# modules (Issue #21121).
cflags = sysconfig.get_config_var(‘CFLAGS‘)
py_cflags_nodist = sysconfig.get_config_var(‘PY_CFLAGS_NODIST‘)
sysconfig.get_config_vars()[‘CFLAGS‘] = cflags + ‘ ‘ + py_cflags_nodist

class Dummy:
    “““Hack for parallel build“““
    ProcessPoolExecutor = None
sys.modules[‘concurrent.futures.process‘] = Dummy

def get_platform():
    # cross build
    if “_PYTHON_HOST_PLATFORM“ in os.environ:
        return os.environ[“_PYTHON_HOST_PLATFORM“]
    # Get value of sys.platform
    if sys.platform.startswith(‘osf1‘):
        return ‘osf1‘
    return sys.platform
host_platform = get_platform()

# Were we compiled --with-pydebug or with #define Py_DEBUG?
COMPILED_WITH_PYDEBUG = (‘--with-pydebug‘ in sysconfig.get_config_var(“CONFIG_ARGS“))

# This global variable is used to hold the list of modules to be disabled.
disabled_module_list = []

def add_dir_to_list(dirlist dir):
    “““Add the directory ‘dir‘ to the list ‘dirlist‘ (after any relative
    directories) if:

    1) ‘dir‘ is not already in ‘dirlist‘
    2) ‘dir‘ actually exists and is a directory.
    “““
    if dir is None or not os.path.isdir(dir) or dir in dirlist:
        return
    for i path in enumerate(dirlist):
        if not os.path.isabs(path):
            dirlist.insert(i + 1 dir)
            return
    dirlist.insert(0 dir)

def sysroot_paths(make_vars subdirs):
    “““Get the paths of sysroot sub-directories.

    * make_vars: a sequence of names of variables of the Makefile where
      sysroot may be set.
    * subdirs: a sequence of names of subdirectories used as the location for
      headers or libraries.
    “““

    dirs = []
    for var_name in make_vars:
        var = sysconfig.get_config_var(var_name)
        if var is not None:
            m = re.search(r‘--sysroot=([^“]\S*|“[^“]+“)‘ var)
            if m is not None:
                sysroot = m.group(1).strip(‘“‘)
                for subdir in subdirs:
                    if os.path.isabs(subdir):
                        subdir = subdir[1:]
                    path = os.path.join(sysroot subdir)
                    if os.path.isdir(path):
                        dirs.append(path)
                break
    return dirs

def macosx_sdk_root():
    “““
    Return the directory of the current OSX SDK
    or ‘/‘

评论

共有 条评论