- checkout repo:
git clone https://github.com/microsoft/playwright-python - make sure local python is 3.10 or newer
- create virtual environment, if don't have one:
python -m venv env
- create virtual environment, if don't have one:
- activate venv:
source env/bin/activate - install all deps:
python -m pip install --upgrade pip
pip install -r local-requirements.txt
pip install -e .
- change the driver pin in
DRIVER_VERSION:npm=theplaywright-corenpm version (e.g.1.61.0) andrev=the commit it is built from (npm view playwright-core@<version> gitHead); refreshNODE_VERSION:python scripts/update_node_version.py - download the new driver:
python -m build --wheel(fetchesplaywright-corevianpm pack+ the matching Node.js binary and assembles the bundle; no source build). - generate API from the docs. This needs a separate
microsoft/playwrightcheckout used only for rolls, at therev=commit ofDRIVER_VERSIONand clean (git -C ../playwright-for-python fetch origin && git -C ../playwright-for-python checkout --detach <rev>):PW_SRC_DIR=../playwright-for-python ./scripts/update_api.sh - run
mypy playwright: every error in_generated.pypoints at an implementation method inplaywright/_impl/that lacks a new member or option. Implement it there, or record the difference inscripts/codegen/python_rules.js. - commit changes & send PR
- wait for bots to pass & merge the PR