Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
32 changes: 20 additions & 12 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,12 @@
from pathlib import Path

import setuptools
from auditwheel.wheeltools import InWheel

try:

from auditwheel.wheeltools import InWheel
except ImportError:
InWheel = None
from wheel.bdist_wheel import bdist_wheel as BDistWheelCommand

driver_version = "1.11.0-next-1618801354000"
Expand Down Expand Up @@ -110,17 +115,20 @@ def run(self) -> None:
zip.writestr("playwright/driver/README.md", "Universal Mac package")

os.remove(base_wheel_location)
for whlfile in glob.glob(os.path.join(self.dist_dir, "*.whl")):
os.makedirs("wheelhouse", exist_ok=True)
with InWheel(
in_wheel=whlfile,
out_wheel=os.path.join("wheelhouse", os.path.basename(whlfile)),
ret_self=True,
):
print("Updating RECORD file of %s" % whlfile)
shutil.rmtree(self.dist_dir)
print("Copying new wheels")
shutil.move("wheelhouse", self.dist_dir)
if InWheel:
for whlfile in glob.glob(os.path.join(self.dist_dir, "*.whl")):
os.makedirs("wheelhouse", exist_ok=True)
with InWheel(
in_wheel=whlfile,
out_wheel=os.path.join("wheelhouse", os.path.basename(whlfile)),
ret_self=True,
):
print("Updating RECORD file of %s" % whlfile)
shutil.rmtree(self.dist_dir)
print("Copying new wheels")
shutil.move("wheelhouse", self.dist_dir)
else:
print("auditwheel not installed, not updating RECORD file")


setuptools.setup(
Expand Down