MCPcopy Index your code
hub / github.com/microsoft/playwright-python / ensure_driver_bundle

Function ensure_driver_bundle

setup.py:107–119  ·  view source on GitHub ↗
(zip_name: str)

Source from the content-addressed store, hash-verified

105
106
107def ensure_driver_bundle(zip_name: str) -> None:
108 destination_path = f"driver/playwright-{driver_version}-{zip_name}.zip"
109 if os.path.exists(destination_path):
110 return
111 # Assemble this platform's bundle by downloading the playwright-core npm
112 # package and the matching Node.js binary. Only the requested platform is
113 # built, so a wheel build downloads just the one Node.js binary it needs.
114 build_script = os.path.join(os.path.dirname(__file__), "scripts", "build_driver.py")
115 subprocess.check_call([sys.executable, build_script, zip_name])
116 if not os.path.exists(destination_path):
117 raise RuntimeError(
118 f"Driver bundle {destination_path} was not produced by scripts/build_driver.py."
119 )
120
121
122class PlaywrightBDistWheelCommand(BDistWheelCommand):

Callers 2

_build_wheelMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected