Esempio n. 1
0
    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
Esempio n. 2
0
    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
Esempio n. 3
0
    def get_tag(self):
        supported_tags = pep425tags.get_supported()

        if self.distribution.is_pure():
            if self.universal:
                impl = 'py2.py3'
            else:
                impl = self.python_tag
            tag = (impl, 'none', 'any')
        else:
            plat_name = self.plat_name
            if plat_name is None:
                plat_name = get_platform()
            plat_name = plat_name.replace('-', '_').replace('.', '_')
            impl_name = get_abbr_impl()
            impl_ver = get_impl_ver()
            # PEP 3149 -- no SOABI in Py 2
            # For PyPy?
            # "pp%s%s" % (sys.pypy_version_info.major,
            # sys.pypy_version_info.minor)
            abi_tag = sysconfig.get_config_vars().get('SOABI', 'none')
            if abi_tag.startswith('cpython-'):
                abi_tag = 'cp' + abi_tag.rsplit('-', 1)[-1]

            tag = (impl_name + impl_ver, abi_tag, plat_name)
            # XXX switch to this alternate implementation for non-pure:
            assert tag == supported_tags[0]
        return tag
Esempio n. 4
0
    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 wheel_get_platform()
            if plat_name in ('linux-x86_64',
                             'linux_x86_64') and sys.maxsize == 2147483647:
                plat_name = 'linux_i686'

            # To allow uploading to pypi, we need the wheel name
            # to contain 'manylinux1'.
            # The wheel which will be uploaded to pypi will be
            # built on RHEL7, so it doesn't completely qualify for
            # manylinux1 support, but it's the minimum requirement
            # for building Qt. We only enable this for x64 limited
            # api builds (which are the only ones uploaded to
            # pypi).
            # TODO: Add actual distro detection, instead of
            # relying on limited_api option.
            if (plat_name in ('linux-x86_64', 'linux_x86_64')
                    and sys.maxsize > 2147483647
                    and (self.py_limited_api or sys.version_info[0] == 2)):
                plat_name = 'manylinux1_x86_64'
        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()
            impl = impl_name + impl_ver
            # We don't work on CPython 3.1, 3.0.
            if self.py_limited_api and (impl_name +
                                        impl_ver).startswith('cp3'):
                impl = self.py_limited_api
                abi_tag = "abi3" if sys.platform != "win32" else "none"
            else:
                abi_tag = str(get_abi_tag()).lower()
            tag = (impl, 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:
            if (self.py_limited_api) or (plat_name in ('manylinux1_x86_64')
                                         and sys.version_info[0] == 2):
                return tag
            assert tag == supported_tags[0], "%s != %s" % (tag,
                                                           supported_tags[0])
            assert tag in supported_tags, (
                "would build wheel with unsupported tag {}".format(tag))
        return tag
Esempio n. 5
0
def improved_wheel_support():
    """get the wheel supported-tags from wheel, rather than vendor
    This fixes pypy3 support.
    """
    import pip.pep425tags
    from wheel.pep425tags import get_supported
    return patched(vars(pip.pep425tags), {
        'supported_tags': get_supported(),
    })
Esempio n. 6
0
def improved_wheel_support():
    """get the wheel supported-tags from wheel, rather than vendor
    This fixes pypy3 support.
    """
    import pip.pep425tags
    from wheel.pep425tags import get_supported
    return patched(vars(pip.pep425tags), {
        'supported_tags': get_supported(),
    })
Esempio n. 7
0
 def is_binary_compatible(self):
     with warnings.catch_warnings():
         # Ignore "Python ABI tag may be incorrect" warnings on Windows.
         # Windows wheels don't specify those anyway.
         if sys.platform.startswith('win'):
             warnings.simplefilter('ignore')
         supported_tags = pep425tags.get_supported()
     wheel_tag = (
         self.info.language_implementation_tag,
         self.info.abi_tag,
         self.info.platform_tag,
     )
     if wheel_tag not in supported_tags:
         return False
     return True
Esempio n. 8
0
 def compute_supported_versions(self):
     self.supported = pep425tags.get_supported()
import unittest

from wheel.pep425tags import get_supported
from wheel.install import WheelFile

WHEELPAT = "%(name)s-%(ver)s-%(pyver)s-%(abi)s-%(arch)s.whl"


def make_wheel(name, ver, pyver, abi, arch):
    name = WHEELPAT % dict(name=name, ver=ver, pyver=pyver, abi=abi, arch=arch)
    return WheelFile(name)


# This relies on the fact that generate_supported will always return the
# exact pyver, abi, and architecture for its first (best) match.
sup = get_supported()
pyver, abi, arch = sup[0]
genver = 'py' + pyver[2:]
majver = genver[:3]

COMBINATIONS = (
    ('bar', '0.9', 'py2.py3', 'none', 'any'),
    ('bar', '0.9', majver, 'none', 'any'),
    ('bar', '0.9', genver, 'none', 'any'),
    ('bar', '0.9', pyver, abi, arch),
    ('bar', '1.3.2', majver, 'none', 'any'),
    ('bar', '3.1', genver, 'none', 'any'),
    ('bar', '3.1', pyver, abi, arch),
    ('foo', '1.0', majver, 'none', 'any'),
    ('foo', '1.1', pyver, abi, arch),
    ('foo', '2.1', majver + '0', 'none', 'any'),
import unittest

from wheel.install import WheelFile
from wheel.pep425tags import get_supported

WHEELPAT = "%(name)s-%(ver)s-%(pyver)s-%(abi)s-%(arch)s.whl"
def make_wheel(name, ver, pyver, abi, arch):
    name = WHEELPAT % dict(name=name, ver=ver, pyver=pyver, abi=abi,
            arch=arch)
    return WheelFile(name)

# This relies on the fact that generate_supported will always return the
# exact pyver, abi, and architecture for its first (best) match.
sup = get_supported()
pyver, abi, arch = sup[0]
genver = 'py' + pyver[2:]
majver = genver[:3]

COMBINATIONS = (
    ('bar', '0.9', 'py2.py3', 'none', 'any'),
    ('bar', '0.9', majver, 'none', 'any'),
    ('bar', '0.9', genver, 'none', 'any'),
    ('bar', '0.9', pyver, abi, arch),
    ('bar', '1.3.2', majver, 'none', 'any'),
    ('bar', '3.1', genver, 'none', 'any'),
    ('bar', '3.1', pyver, abi, arch),
    ('foo', '1.0', majver, 'none', 'any'),
    ('foo', '1.1', pyver, abi, arch),
    ('foo', '2.1', majver + '0', 'none', 'any'),
    # This will not be compatible for Python x.0. Beware when we hit Python
    # 4.0, and don't test with 3.0!!!
Esempio n. 11
0
# Copyright 2016 LinkedIn Corp.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
#     http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#

from wheel.pep425tags import get_supported
from json import dump
import sys

supported_values = []
for entry in get_supported():
    supported_values.append({
        'pythonTag': entry[0],
        'abiTag': entry[1],
        'platformTag': entry[2]
    })

result_file = sys.argv[1]
with open(result_file, 'w') as outfile:
    dump(supported_values, outfile)
Esempio n. 12
0
#键盘鼠标事件

#鼠标点击动作
"""
click(element=None) 左击
context_click(element=None) 右击
double_click(element=None) 双击
move_to_element(element) 移动鼠标到元素中间(悬停)
drag_and_drop(source,target) source上按下左键拖动到target元素上
click_and_hold(element=None) 在元素上按下鼠标左键
release() 释放鼠标
perform() 执行ActionChains中存储的动作
"""

import wheel.pep425tags as w
print(w.get_supported())
Esempio n. 13
0
#
# Copyright 2016 LinkedIn Corp.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
#     http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#

from wheel.pep425tags import get_supported
from json import dump
import sys

supported_values = []
for entry in get_supported():
  supported_values.append( { 'pythonTag': entry[0], 'abiTag': entry[1], 'platformTag': entry[2] })

result_file = sys.argv[1]
with open(result_file, 'w') as outfile:
    dump(supported_values, outfile)

Esempio n. 14
0
# 			self._calc()
# 			print("计时结束")

# 	#内部方法,计算运行时间
# 	def _calc(self):
# 		self.lasted=[]
# 		self.prompt="总共运行了"
# 		for index in range(6):
# 			self.lasted.append(self.end[index]-self.begin[index])
# 			if self.lasted[index]:
# 				self.prompt+=(str(self.lasted[index])+self.unit[index])
# 		#为下一轮初始化
# 		self.begin=0
# 		self.end=0


# t1=MyTimer()
# print(t1)
# t1.start()
# t.sleep(1)
# print(t1)
# t.sleep(1.99)
# t1.stop()
# print(t1)


import wheel.pep425tags as w


print(type(w.get_supported()))