2022-10-21 18:38:19 +00:00
|
|
|
diff --git a/playwright/_impl/_driver.py b/playwright/_impl/_driver.py
|
2024-09-19 14:19:46 +00:00
|
|
|
index 22b53b8..2d86626 100644
|
2022-10-21 18:38:19 +00:00
|
|
|
--- a/playwright/_impl/_driver.py
|
|
|
|
+++ b/playwright/_impl/_driver.py
|
2024-09-19 14:19:46 +00:00
|
|
|
@@ -23,14 +23,7 @@ from playwright._repo_version import version
|
|
|
|
|
|
|
|
|
2024-07-27 06:49:29 +00:00
|
|
|
def compute_driver_executable() -> Tuple[str, str]:
|
|
|
|
- driver_path = Path(inspect.getfile(playwright)).parent / "driver"
|
|
|
|
- cli_path = str(driver_path / "package" / "cli.js")
|
|
|
|
- if sys.platform == "win32":
|
2024-09-19 14:19:46 +00:00
|
|
|
- return (
|
|
|
|
- os.getenv("PLAYWRIGHT_NODEJS_PATH", str(driver_path / "node.exe")),
|
|
|
|
- cli_path,
|
|
|
|
- )
|
2024-07-27 06:49:29 +00:00
|
|
|
- return (os.getenv("PLAYWRIGHT_NODEJS_PATH", str(driver_path / "node")), cli_path)
|
2024-09-19 14:19:46 +00:00
|
|
|
+ return "@node@", "@driver@"
|
|
|
|
|
|
|
|
|
2024-07-27 06:49:29 +00:00
|
|
|
def get_driver_env() -> dict:
|
2022-10-21 18:38:19 +00:00
|
|
|
diff --git a/setup.py b/setup.py
|
2024-07-27 06:49:29 +00:00
|
|
|
index 8709e52..59784dd 100644
|
2022-10-21 18:38:19 +00:00
|
|
|
--- a/setup.py
|
|
|
|
+++ b/setup.py
|
|
|
|
@@ -141,25 +141,8 @@ class PlaywrightBDistWheelCommand(BDistWheelCommand):
|
|
|
|
base_wheel_location: str = glob.glob(os.path.join(self.dist_dir, "*.whl"))[0]
|
|
|
|
without_platform = base_wheel_location[:-7]
|
|
|
|
for wheel_bundle in wheels:
|
|
|
|
- download_driver(wheel_bundle["zip_name"])
|
|
|
|
- zip_file = (
|
|
|
|
- f"driver/playwright-{driver_version}-{wheel_bundle['zip_name']}.zip"
|
|
|
|
- )
|
|
|
|
- with zipfile.ZipFile(zip_file, "r") as zip:
|
|
|
|
- extractall(zip, f"driver/{wheel_bundle['zip_name']}")
|
|
|
|
wheel_location = without_platform + wheel_bundle["wheel"]
|
|
|
|
shutil.copy(base_wheel_location, wheel_location)
|
|
|
|
- with zipfile.ZipFile(wheel_location, "a") as zip:
|
|
|
|
- driver_root = os.path.abspath(f"driver/{wheel_bundle['zip_name']}")
|
|
|
|
- for dir_path, _, files in os.walk(driver_root):
|
|
|
|
- for file in files:
|
|
|
|
- from_path = os.path.join(dir_path, file)
|
|
|
|
- to_path = os.path.relpath(from_path, driver_root)
|
|
|
|
- zip.write(from_path, f"playwright/driver/{to_path}")
|
|
|
|
- zip.writestr(
|
|
|
|
- "playwright/driver/README.md",
|
|
|
|
- f"{wheel_bundle['wheel']} driver package",
|
|
|
|
- )
|
|
|
|
os.remove(base_wheel_location)
|
|
|
|
if InWheel:
|
|
|
|
for whlfile in glob.glob(os.path.join(self.dist_dir, "*.whl")):
|