1
"""Rename the wheel so that pip will find it for more Pythons.
3
Python.org builds and Mac system Python are built as 'fat' binaries, including
4
both x86 (32 bit) and x86_64 (64 bit) executable code in one file. On these
5
Pythons, pip will look for wheels with fat libraries, tagged 'intel'. However,
6
all recent Mac systems run the 64 bit code.
8
Therefore, this script tells a small lie about the wheels we're producing. By
9
claiming they are fat ('intel') wheels, pip will install them on more Python
10
installations. This should not cause problems for the vast majority of users.
16
# There should be exactly one .whl
17
filenames = glob.glob('dist/*.whl')
19
if len(filenames) < 1:
20
sys.exit("No wheels found")
21
elif len(filenames) > 1:
22
print("Multiple wheels found:")
24
print(" {}".format(f))
30
print("Wheel already tagged 'intel':")
33
elif '_x86_64' not in path:
34
print("Didn't find '_x86_64' in wheel filename:")
38
new_path = path.replace('_x86_64', '_intel')
39
os.rename(path, new_path)
40
print("Renamed wheel to:")