playwright-roll
Installation
SKILL.md
Rolling Playwright Python
The goal of a roll is to move driver_version in setup.py to a new release, port every public API change introduced upstream during that interval, and suppress the rest, so that ./scripts/update_api.sh runs clean and the test suite still passes.
The previous human-facing summary lives in ../../../ROLLING.md. This skill is the operational playbook — read it end to end before starting.
Mental model
The Python port is hand-written code in playwright/_impl/, plus a generator (scripts/generate_*.py, scripts/documentation_provider.py) that:
- introspects the Python
_implclasses viainspect, - emits typed wrapper classes into
playwright/{async,sync}_api/_generated.py, and - diffs the introspected surface against
playwright/driver/package/api.json(downloaded inside the new driver wheel).
Anything in api.json that is missing or differently typed in _impl/ causes generation to fail. Three resolutions:
- PORT — the new API is intended for Python (no
langs.onlyfilter, orlangs.onlyincludes"python"). Implement it in_impl/. - MISMATCH — the API genuinely exists for Python but is shaped differently (a callback signature uses unions, a kwarg uses a legacy name, etc.) and there's a justified reason to keep the divergence. Add a precise line to
scripts/expected_api_mismatch.txtwith a comment explaining why. - N/A — the commit only touches docs, has
* langs: js(or any other filter that excludes Python), is server-side, Electron-only, or was reverted later in the same release. No action.