我们从Python开源项目中,提取了以下38个代码示例,用于说明如何使用wheel.pep425tags.get_abi_tag()。
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
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, ) # The rest will be automatically created as plain old data objects (PODO).
def __call__(self, args=None): sys.excepthook = terminal.error_handler parser = terminal.configure_parser(""" The piw-slave script is intended to be run on a standalone machine to build packages on behalf of the piw-master script. It is intended to be run as an unprivileged user with a clean home-directory. Any build dependencies you wish to use must already be installed. The script will run until it is explicitly terminated, either by Ctrl+C, SIGTERM, or by the remote piw-master script. """) parser.add_argument( '-m', '--master', env_var='PIW_MASTER', metavar='HOST', default='localhost', help="The IP address or hostname of the master server " "(default: %(default)s)") parser.add_argument( '-t', '--timeout', env_var='PIW_TIMEOUT', metavar='DURATION', default='3h', type=duration, help="The time to wait before assuming a build has failed; " "(default: %(default)s)") self.config = parser.parse_args(args) terminal.configure_logging(self.config.log_level, self.config.log_file) self.logger.info('PiWheels Slave version %s', __version__) ctx = zmq.Context.instance() queue = ctx.socket(zmq.REQ) queue.hwm = 1 queue.ipv6 = True queue.connect('tcp://{master}:5555'.format( master=self.config.master)) try: request = ['HELLO', self.config.timeout, pep425tags.get_impl_ver(), pep425tags.get_abi_tag(), pep425tags.get_platform()] while request is not None: queue.send_pyobj(request) reply, *args = queue.recv_pyobj() request = self.handle_reply(reply, *args) finally: queue.send_pyobj(['BYE']) ctx.destroy(linger=1000) ctx.term() # A general note about the design of the slave: the build slave is # deliberately designed to be "brittle". In other words to fall over and # die loudly in the event anything happens to go wrong (other than utterly # expected failures like wheels occasionally failing to build and file # transfers occasionally needing a retry). Hence all the apparently silly # asserts littering the functions below. # This is in stark constrast to the master which is expected to stay up and # carry on running even if a build slave goes bat-shit crazy and starts # sending nonsense (in which case it should calmly ignore it and/or attempt # to kill said slave with a "BYE" message).