Skip to content

Commit da0ea5c

Browse files
committed
Fix missing Tracing patch_file
Fixes #75
1 parent d44e13f commit da0ea5c

File tree

2 files changed

+8
-3
lines changed

2 files changed

+8
-3
lines changed

.github/workflows/patchright_workflow.yml

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,10 @@ on:
55
workflow_dispatch:
66
inputs:
77
version:
8-
description: 'Playwright Version'
8+
description: 'Playwright Version (Base)'
9+
default: ''
10+
patchright_release:
11+
description: 'Patchright Release Version'
912
default: ''
1013
# running every hour
1114
schedule:
@@ -50,6 +53,7 @@ jobs:
5053
- name: Check Release Version
5154
id: version_check
5255
run: |
56+
echo "patchright_release=${{ github.event.inputs.patchright_release }}" >> $GITHUB_ENV
5357
if [ -n "${{ github.event.inputs.version }}" ]; then
5458
echo "proceed=true" >>$GITHUB_OUTPUT
5559
echo "playwright_version=${{ github.event.inputs.version }}" >> $GITHUB_ENV

patch_python_package.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,7 @@
44

55
import toml
66

7-
patchright_version = os.environ.get('playwright_version')
8-
# patchright_version = "1.55.2"
7+
patchright_version = os.environ.get('patchright_release') or os.environ.get('playwright_version')
98

109
def patch_file(file_path: str, patched_tree: ast.AST) -> None:
1110
with open(file_path, "w") as f:
@@ -421,6 +420,8 @@ async def route_handler(route: Route) -> None:
421420
if isinstance(node, ast.AsyncFunctionDef) and node.name == "start":
422421
node.body.insert(0, ast.parse("await self._parent.install_inject_route()"))
423422

423+
patch_file("playwright-python/playwright/_impl/_tracing.py", tracing_tree)
424+
424425
# Patching playwright/async_api/_generated.py
425426
with open("playwright-python/playwright/async_api/_generated.py") as f:
426427
async_generated_source = f.read()

0 commit comments

Comments
 (0)