-
Notifications
You must be signed in to change notification settings - Fork 4
Expand file tree
/
Copy pathlabel_wheels.py
More file actions
39 lines (30 loc) · 880 Bytes
/
label_wheels.py
File metadata and controls
39 lines (30 loc) · 880 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
"""
This is a workaround to avoid auditwheel adding
casm libraries from other wheels... just rename the wheel
Expects dist/<vers>_raw to contain wheels.
Then:
python label_wheels.py <vers>
Result: dist/<vers> contains renamed wheels
"""
import os
import shutil
import sys
print(sys.argv)
if len(sys.argv) != 2:
print("Expected: label_wheels.py <vers>")
exit(1)
vers = sys.argv[1]
raw_dir = f"dist/{vers}_raw"
if not os.path.exists(raw_dir):
print(f"Does not exist: {raw_dir}")
exit(1)
processed_dir = f"dist/{vers}"
if os.path.exists(processed_dir):
print(f"Error, directory already exists: {processed_dir}")
exit(1)
os.mkdir(processed_dir)
for file in os.listdir(raw_dir):
processed_file = file.replace("linux", "manylinux_2_28")
shutil.copyfile(
os.path.join(raw_dir, file), os.path.join(processed_dir, processed_file)
)