@@ -6,8 +6,9 @@ description: Prepare a Playwright Python release. Checks open bugs, adds Python-
66# Preparing a Playwright Python release
77
88In this skill, ` 1.xx ` is the release (for example ` 1.64 ` ), and ` v1.xx.0 ` is its tag.
9- ` $PW_SRC_DIR ` is the roll checkout of ` microsoft/playwright ` (see the
10- ` playwright-roll ` skill, step 2).
9+ ` .upstream/ ` is the checkout of ` microsoft/playwright ` at the commit in
10+ ` DRIVER_VERSION ` (` python scripts/upstream.py checkout ` ). Only read from it: do not
11+ commit or switch branches there.
1112
1213Remotes: find the remote for ` microsoft/playwright-python ` with ` git remote -v ` .
1314The commands below call it ` upstream ` .
@@ -31,24 +32,35 @@ gh issue list --repo microsoft/playwright-python --state open \
3132If any are open, list them for the user and ask whether to continue. Do not
3233close or comment on issues.
3334
34- Check that the driver is rolled. ` DRIVER_VERSION ` (` npm= ` ) must be the driver
35- for the release: a ` 1.xx.y ` build, or a ` 1.xx.0-beta-… ` build from ` release-1.xx ` ,
36- as the user says, and ` rev= ` the commit that it is built from. If it is not, roll with the ` playwright-roll ` skill. This is often
37- already done. The roll commit goes into the release commit PR (step 3). When the
38- API roll for 1.xx is already on ` main ` , that PR only moves ` DRIVER_VERSION ` .
35+ Check that the driver is rolled. ` DRIVER_VERSION ` must be a commit of
36+ ` release-1.xx ` : the tag ` v1.xx.y ` , or the tip of the branch, as the user says. The
37+ driver reports the version of ` playwright-core ` at that commit, so it must be
38+ ` 1.xx.y ` :
39+
40+ ``` sh
41+ python scripts/upstream.py checkout
42+ git -C .upstream fetch origin release-1.xx
43+ git -C .upstream merge-base --is-ancestor " $( cat DRIVER_VERSION) " FETCH_HEAD && echo " on release-1.xx"
44+ git -C .upstream show " $( cat DRIVER_VERSION) " :packages/playwright-core/package.json | grep ' "version"'
45+ ```
46+
47+ If it is not, roll with the ` playwright-roll ` skill (` python scripts/upstream.py pin v1.xx.y ` ,
48+ or ` pin release-1.xx ` ). This is often already done. The roll commit goes into the
49+ release commit PR (step 3). When the API roll for 1.xx is already on ` main ` , that PR
50+ only moves ` DRIVER_VERSION ` .
3951
4052## 2. Release notes (microsoft/playwright)
4153
4254The Python notes in ` docs/src/release-notes-python.md ` are written in
4355` microsoft/playwright ` together with the Node.js notes. The
4456` playwright-release-notes ` skill there
45- (` $PW_SRC_DIR/ .claude/skills/playwright-release-notes/SKILL.md` ) covers that,
57+ (` .claude/skills/playwright-release-notes/SKILL.md ` on ` main ` ) covers that,
4658including the Python code style. Check that the ` ## Version 1.xx ` section is on the
4759release branch:
4860
4961``` sh
50- git -C " $PW_SRC_DIR " fetch origin release-1.xx
51- git -C " $PW_SRC_DIR " show FETCH_HEAD:docs/src/release-notes-python.md | grep -n ' ^## Version 1.xx$'
62+ git -C .upstream fetch origin release-1.xx
63+ git -C .upstream show FETCH_HEAD:docs/src/release-notes-python.md | grep -n ' ^## Version 1.xx$'
5264```
5365
5466If it is missing, tell the user: it should have landed with the Node.js notes.
@@ -66,20 +78,22 @@ different exception type. Leave out minor bug fixes, internal changes, and anyth
6678the notes already cover. If nothing is significant, go to step 3. Otherwise list
6779the changes for the user and ask whether to add them to the notes.
6880
69- To add them, write them in the roll checkout, on a branch from ` origin/main ` :
81+ To add them, write them in a worktree of ` .upstream/ ` next to this repository, on a
82+ branch from ` origin/main ` . ` .upstream/ ` itself stays at the pin.
7083
7184``` sh
72- git -C " $PW_SRC_DIR " fetch origin main
73- git -C " $PW_SRC_DIR " checkout -b release-notes-1.xx-python origin/main
85+ notes=" $( dirname " $PWD " ) /playwright-release-notes-1.xx"
86+ git -C .upstream fetch origin main
87+ git -C .upstream worktree add -b release-notes-1.xx-python " $notes " origin/main
7488```
7589
7690Commit, push to the user's fork of ` microsoft/playwright ` , and open the PR. If
7791the checkout has no remote for the fork, add one. ` gh api user --jq .login `
7892gives the user's login.
7993
8094``` sh
81- git -C " $PW_SRC_DIR " commit -am " docs: release notes for v1.xx Python"
82- git -C " $PW_SRC_DIR " push < fork-remote> release-notes-1.xx-python
95+ git -C " $notes " commit -am " docs: release notes for v1.xx Python"
96+ git -C " $notes " push < fork-remote> release-notes-1.xx-python
8397gh pr create --repo microsoft/playwright --head < login> :release-notes-1.xx-python \
8498 --title " docs: release notes for v1.xx Python" \
8599 --body " - Update the \` Version 1.xx\` Python release notes with upstream and Python-specific changes"
@@ -88,20 +102,19 @@ gh pr create --repo microsoft/playwright --head <login>:release-notes-1.xx-pytho
88102After the PR merges, it needs a cherry-pick to ` release-1.xx ` (the
89103` playwright-cherry-pick ` skill in ` microsoft/playwright ` ).
90104
91- Then put the roll checkout back on the release branch. ` ./scripts/update_api.sh `
92- reads the docs from it. Run the checkout checks from step 2 of the
93- ` playwright-roll ` skill.
105+ Then remove the worktree:
94106
95107``` sh
96- git -C " $PW_SRC_DIR " checkout release-1.xx
108+ git -C .upstream worktree remove " $notes "
97109```
98110
99111## 3. Release commit (playwright-python)
100112
101113Open a PR from the branch with the roll commit:
102114
103115- Title: ` chore: roll Playwright to v1.xx.y ` , where ` v1.xx.y ` is the Python
104- release version, even when ` DRIVER_VERSION ` is a beta build.
116+ release version, even when ` DRIVER_VERSION ` is the tip of ` release-1.xx ` and not
117+ a tag.
105118- Description: the Python release notes, in GitHub markdown (see below).
106119 The user copies this description into the GitHub release, so for this PR it
107120 replaces the "keep PR descriptions short" rule in ` AGENTS.md ` .
0 commit comments