|
21 | 21 | from pathlib import Path
|
22 | 22 |
|
23 | 23 | import setuptools
|
24 |
| -from auditwheel.wheeltools import InWheel |
| 24 | + |
| 25 | +try: |
| 26 | + |
| 27 | + from auditwheel.wheeltools import InWheel |
| 28 | +except ImportError: |
| 29 | + InWheel = None |
25 | 30 | from wheel.bdist_wheel import bdist_wheel as BDistWheelCommand
|
26 | 31 |
|
27 | 32 | driver_version = "1.11.0-next-1618801354000"
|
@@ -110,17 +115,20 @@ def run(self) -> None:
|
110 | 115 | zip.writestr("playwright/driver/README.md", "Universal Mac package")
|
111 | 116 |
|
112 | 117 | os.remove(base_wheel_location)
|
113 |
| - for whlfile in glob.glob(os.path.join(self.dist_dir, "*.whl")): |
114 |
| - os.makedirs("wheelhouse", exist_ok=True) |
115 |
| - with InWheel( |
116 |
| - in_wheel=whlfile, |
117 |
| - out_wheel=os.path.join("wheelhouse", os.path.basename(whlfile)), |
118 |
| - ret_self=True, |
119 |
| - ): |
120 |
| - print("Updating RECORD file of %s" % whlfile) |
121 |
| - shutil.rmtree(self.dist_dir) |
122 |
| - print("Copying new wheels") |
123 |
| - shutil.move("wheelhouse", self.dist_dir) |
| 118 | + if InWheel: |
| 119 | + for whlfile in glob.glob(os.path.join(self.dist_dir, "*.whl")): |
| 120 | + os.makedirs("wheelhouse", exist_ok=True) |
| 121 | + with InWheel( |
| 122 | + in_wheel=whlfile, |
| 123 | + out_wheel=os.path.join("wheelhouse", os.path.basename(whlfile)), |
| 124 | + ret_self=True, |
| 125 | + ): |
| 126 | + print("Updating RECORD file of %s" % whlfile) |
| 127 | + shutil.rmtree(self.dist_dir) |
| 128 | + print("Copying new wheels") |
| 129 | + shutil.move("wheelhouse", self.dist_dir) |
| 130 | + else: |
| 131 | + print("auditwheel not installed, not updating RECORD file") |
124 | 132 |
|
125 | 133 |
|
126 | 134 | setuptools.setup(
|
|
0 commit comments