Skip to content

Commit 2aec2fa

Browse files
committed
devops: separate wheels for OS/drivers
1 parent 875b380 commit 2aec2fa

File tree

2 files changed

+25
-1
lines changed

2 files changed

+25
-1
lines changed

MANIFEST.in

+5-1
Original file line numberDiff line numberDiff line change
@@ -1 +1,5 @@
1-
recursive-include playwright/drivers *
1+
include playwright/drivers/browsers.json
2+
include playwright/*.py
3+
include README.md
4+
include SECURITY.md
5+
include LICENSE

build_package.py

+20
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,11 @@
1212
# See the License for the specific language governing permissions and
1313
# limitations under the License.
1414

15+
import glob
16+
import os
1517
import shutil
1618
import subprocess
19+
import zipfile
1720

1821
from playwright.path_utils import get_file_dirname
1922

@@ -29,3 +32,20 @@
2932
shutil.rmtree(_egg_dir)
3033

3134
subprocess.run("python setup.py sdist bdist_wheel", shell=True)
35+
36+
base_wheel_location = glob.glob("dist/*.whl")[0]
37+
without_platform = base_wheel_location[:-7]
38+
39+
pack_data = [
40+
("driver-linux", "manylinux1_x86_64.whl"),
41+
("driver-macos", "macosx_10_13_x86_64.whl"),
42+
("driver-win.exe", "win_amd64.whl"),
43+
]
44+
45+
for driver, wheel in pack_data:
46+
wheel_location = without_platform + wheel
47+
shutil.copy(base_wheel_location, wheel_location)
48+
with zipfile.ZipFile(wheel_location, "a") as zipf:
49+
driver_location = f"playwright/drivers/{driver}.gz"
50+
zipf.write(driver_location, driver_location)
51+
os.remove(base_wheel_location)

0 commit comments

Comments
 (0)