當前位置: 首頁>>代碼示例>>Python>>正文


Python pep425tags.get_abbr_impl方法代碼示例

本文整理匯總了Python中wheel.pep425tags.get_abbr_impl方法的典型用法代碼示例。如果您正苦於以下問題:Python pep425tags.get_abbr_impl方法的具體用法?Python pep425tags.get_abbr_impl怎麽用?Python pep425tags.get_abbr_impl使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在wheel.pep425tags的用法示例。


在下文中一共展示了pep425tags.get_abbr_impl方法的4個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。

示例1: get_tag

# 需要導入模塊: from wheel import pep425tags [as 別名]
# 或者: from wheel.pep425tags import get_abbr_impl [as 別名]
def get_tag(self):
        # bdist sets self.plat_name if unset, we should only use it for purepy
        # wheels if the user supplied it.
        if self.plat_name_supplied:
            plat_name = self.plat_name
        elif self.root_is_pure:
            plat_name = "any"
        else:
            plat_name = self.plat_name or get_platform()
            if (
                plat_name in ("linux-x86_64", "linux_x86_64")
                and sys.maxsize == 2147483647
            ):
                plat_name = "linux_i686"
        plat_name = plat_name.replace("-", "_").replace(".", "_")

        if self.root_is_pure:
            if self.universal:
                impl = "py2.py3"
            else:
                impl = self.python_tag
            tag = (impl, "none", plat_name)
        else:
            impl_name = get_abbr_impl()
            impl_ver = get_impl_ver()
            # PEP 3149
            abi_tag = str(get_abi_tag()).lower()
            tag = (impl_name + impl_ver, abi_tag, plat_name)
            supported_tags = pep425tags.get_supported(
                supplied_platform=plat_name if self.plat_name_supplied else None
            )
            # XXX switch to this alternate implementation for non-pure:
            assert tag == supported_tags[0], "%s != %s" % (tag, supported_tags[0])
        return tag 
開發者ID:microsoft,項目名稱:botbuilder-python,代碼行數:36,代碼來源:azure_bdist_wheel.py

示例2: from_current_system

# 需要導入模塊: from wheel import pep425tags [as 別名]
# 或者: from wheel.pep425tags import get_abbr_impl [as 別名]
def from_current_system(cls, session=None):
        """Gets a Uname object populated from the current system"""
        uname = platform.uname()
        fqdn = socket.getfqdn()
        system = uname[0]
        architecture, _ = platform.architecture()
        if system == "Windows":
            service_pack = platform.win32_ver()[2]
            kernel = uname[3]  # 5.1.2600
            release = uname[2]  # XP, 2000, 7
            version = uname[3] + service_pack  # 5.1.2600 SP3, 6.1.7601 SP1
        elif system == "Darwin":
            kernel = uname[2]  # 12.2.0
            release = "OSX"  # OSX
            version = platform.mac_ver()[0]  # 10.8.2
        elif system == "Linux":
            kernel = uname[2]  # 3.2.5
            release = platform.linux_distribution()[0]  # Ubuntu
            version = platform.linux_distribution()[1]  # 12.04

        # Emulate PEP 425 naming conventions - e.g. cp27-cp27mu-linux_x86_64.
        pep425tag = "%s%s-%s-%s" % (pep425tags.get_abbr_impl(),
                                    pep425tags.get_impl_ver(),
                                    str(pep425tags.get_abi_tag()).lower(),
                                    pep425tags.get_platform())

        return cls.from_keywords(
            session=session,
            system=system,
            architecture=architecture,
            node=uname[1],
            release=release,
            version=version,
            machine=uname[4],              # x86, x86_64
            kernel=kernel,
            fqdn=fqdn,
            pep425tag=pep425tag,
        ) 
開發者ID:google,項目名稱:rekall,代碼行數:40,代碼來源:agent.py

示例3: get_abi_tag

# 需要導入模塊: from wheel import pep425tags [as 別名]
# 或者: from wheel.pep425tags import get_abbr_impl [as 別名]
def get_abi_tag(python_version):
    # type: (Tuple[int, int]) -> Optional[str]
    """Return the ABI tag based on SOABI (if available) or emulate SOABI
    (CPython 2, PyPy).
    A replacement for pip._internal.models.pep425tags:get_abi_tag()
    """
    from wheel.pep425tags import get_config_var, get_abbr_impl, get_flag

    soabi = get_config_var("SOABI")
    impl = get_abbr_impl()
    abi = None  # type: Optional[str]

    if not soabi and impl in {"cp", "pp"} and hasattr(sys, "maxunicode"):
        d = ""
        m = ""
        u = ""
        is_cpython = impl == "cp"
        if get_flag("Py_DEBUG", lambda: hasattr(sys, "gettotalrefcount"), warn=False):
            d = "d"
        if python_version < (3, 8) and get_flag(
            "WITH_PYMALLOC", lambda: is_cpython, warn=False
        ):
            m = "m"
        if python_version < (3, 3) and get_flag(
            "Py_UNICODE_SIZE",
            lambda: sys.maxunicode == 0x10FFFF,
            expected=4,
            warn=False,
        ):
            u = "u"
        abi = "%s%s%s%s%s" % (impl, "".join(map(str, python_version)), d, m, u)
    elif soabi and soabi.startswith("cpython-"):
        abi = "cp" + soabi.split("-")[1]
    elif soabi:
        abi = soabi.replace(".", "_").replace("-", "_")

    return abi 
開發者ID:frostming,項目名稱:pdm,代碼行數:39,代碼來源:utils.py

示例4: expected_wheel_name

# 需要導入模塊: from wheel import pep425tags [as 別名]
# 或者: from wheel.pep425tags import get_abbr_impl [as 別名]
def expected_wheel_name(fmt):
    return fmt.format(get_abbr_impl() + get_impl_ver(), get_abi_tag()) 
開發者ID:asottile,項目名稱:pip-custom-platform,代碼行數:4,代碼來源:util.py


注:本文中的wheel.pep425tags.get_abbr_impl方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。