Skip to content

Commit 55659c0

Browse files
committed
Add support for new architectures in manylinux2014
1 parent 8fc14ac commit 55659c0

File tree

1 file changed

+22
-11
lines changed

1 file changed

+22
-11
lines changed

auditwheel/policy/__init__.py

Lines changed: 22 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -11,14 +11,21 @@
1111
# https://docs.python.org/3/library/platform.html#platform.architecture
1212
bits = 8 * (8 if sys.maxsize > 2 ** 32 else 4)
1313

14-
_PLATFORM_REPLACEMENT_MAP = {
15-
'manylinux1_x86_64': ['linux_x86_64'],
16-
'manylinux2010_x86_64': ['linux_x86_64'],
17-
'manylinux2014_x86_64': ['linux_x86_64'],
18-
'manylinux1_i686': ['linux_i686'],
19-
'manylinux2010_i686': ['linux_i686'],
20-
'manylinux2014_i686': ['linux_i686'],
21-
}
14+
15+
_PLATFORM_REPLACEMENT_MAP = {}
16+
for _policy in {'manylinux1', 'manylinux2010'}:
17+
for _arch in {'x86_64', 'i686'}:
18+
_key = '{}_{}'.format(_policy, _arch)
19+
_value = 'linux_{}'.format(_arch)
20+
_PLATFORM_REPLACEMENT_MAP[_key] = [_value]
21+
22+
for _policy in {'manylinux2014'}:
23+
for _arch in {
24+
'x86_64', 'i686', 'aarch64', 'armv7l', 'ppc64', 'ppc64le', 's390x'
25+
}:
26+
_key = '{}_{}'.format(_policy, _arch)
27+
_value = 'linux_{}'.format(_arch)
28+
_PLATFORM_REPLACEMENT_MAP[_key] = [_value]
2229

2330

2431
def get_arch_name():
@@ -33,9 +40,13 @@ def get_arch_name():
3340

3441

3542
with open(join(dirname(abspath(__file__)), 'policy.json')) as f:
36-
_POLICIES = json.load(f)
37-
for p in _POLICIES:
38-
p['name'] = p['name'] + '_' + _ARCH_NAME
43+
_POLICIES = []
44+
_policies_temp = json.load(f)
45+
for _p in _policies_temp:
46+
_name = _p['name'] + '_' + _ARCH_NAME
47+
if _name in _PLATFORM_REPLACEMENT_MAP or _name.startswith('linux'):
48+
_p['name'] = _name
49+
_POLICIES.append(_p)
3950

4051
POLICY_PRIORITY_HIGHEST = max(p['priority'] for p in _POLICIES)
4152
POLICY_PRIORITY_LOWEST = min(p['priority'] for p in _POLICIES)

0 commit comments

Comments
 (0)