本文整理汇总了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
示例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,
)
示例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
示例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())