Skip to content

Commit

Permalink
skip auditwheel, but relabel
Browse files Browse the repository at this point in the history
  • Loading branch information
bpuchala committed Aug 11, 2023
1 parent 4f242bb commit eddbbf4
Showing 1 changed file with 38 additions and 0 deletions.
38 changes: 38 additions & 0 deletions label_wheels.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
"""
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", "manylinux2014")
shutil.copyfile(
os.path.join(raw_dir, file), os.path.join(processed_dir, processed_file)
)

0 comments on commit eddbbf4

Please sign in to comment.