Beispiel #1
0
 def test_get_by_priority(self):
     _arch = get_arch_name()
     assert get_policy_name(70) == f'manylinux_2_24_{_arch}'
     assert get_policy_name(80) == f'manylinux2014_{_arch}'
     if _arch in {'x86_64', 'i686'}:
         assert get_policy_name(90) == f'manylinux2010_{_arch}'
         assert get_policy_name(100) == f'manylinux1_{_arch}'
     assert get_policy_name(0) == f'linux_{_arch}'
Beispiel #2
0
 def test_get_by_priority(self):
     _arch = get_arch_name()
     assert get_policy_name(65) == f"manylinux_2_27_{_arch}"
     assert get_policy_name(70) == f"manylinux_2_24_{_arch}"
     assert get_policy_name(80) == f"manylinux_2_17_{_arch}"
     if _arch in {"x86_64", "i686"}:
         assert get_policy_name(90) == f"manylinux_2_12_{_arch}"
         assert get_policy_name(100) == f"manylinux_2_5_{_arch}"
     assert get_policy_name(0) == f"linux_{_arch}"
Beispiel #3
0
def configure_parser(sub_parsers):
    policy_names = [p['name'] for p in load_policies()]
    highest_policy = get_policy_name(POLICY_PRIORITY_HIGHEST)
    help = "Vendor in external shared library dependencies of a wheel."
    p = sub_parsers.add_parser('repair', help=help, description=help)
    p.add_argument('WHEEL_FILE', help='Path to wheel file.')
    p.add_argument('-f',
                   '--force',
                   help='Override symbol version ABI check',
                   action='store_true')
    p.add_argument(
        '--plat',
        dest='PLAT',
        help='Desired target platform. (default: "%s")' % highest_policy,
        choices=policy_names,
        default=highest_policy)
    p.add_argument('-L',
                   '--lib-sdir',
                   dest='LIB_SDIR',
                   help=('Subdirectory in packages to store copied libraries.'
                         ' (default: ".libs")'),
                   default='.libs')
    p.add_argument('-w',
                   '--wheel-dir',
                   dest='WHEEL_DIR',
                   type=abspath,
                   help=('Directory to store delocated wheels (default:'
                         ' "wheelhouse/")'),
                   default='wheelhouse/')
    p.add_argument('--no-update-tags',
                   dest='UPDATE_TAGS',
                   action='store_false',
                   help=('Do not update the wheel filename tags and WHEEL info'
                         ' to match the repaired platform tag.'),
                   default=True)
    p.set_defaults(func=execute)
Beispiel #4
0
 def test_get_by_priority_duplicate(self):
     with pytest.raises(RuntimeError):
         get_policy_name(0)
Beispiel #5
0
 def test_get_by_priority_missing(self):
     assert get_policy_name(101) is None
Beispiel #6
0
 def test_get_by_priority(self):
     assert get_policy_name(100) == 'manylinux1_x86_64'
     assert get_policy_name(0) == 'linux_x86_64'
Beispiel #7
0
 def test_get_by_name_duplicate(self):
     """Duplicate priorities raise RuntimeError"""
     with pytest.raises(RuntimeError):
         get_policy_name(0)