From 7a42984158c86960339d8d95fd78e15851273116 Mon Sep 17 00:00:00 2001 From: feder-cr <85809106+feder-cr@users.noreply.github.com> Date: Tue, 30 Jun 2026 09:00:00 +0000 Subject: [PATCH] fix(deps): cap playwright <1.61 and pin it in the e2e clean venv Playwright 1.61.0 (2026-06-29) ships a Browser.setDefaultViewport Juggler call the published firefox-13 binary does not implement, so an unpinned pip install (the wrapper declared playwright>=1.40) breaks new_context on fresh installs. Cap the dependency to <1.61 and force the blessed pin in the e2e clean venv so CI tests the version users actually run. --- pyproject.toml | 4 ++-- tests/test_release_e2e.py | 10 ++++++++++ 2 files changed, 12 insertions(+), 2 deletions(-) diff --git a/pyproject.toml b/pyproject.toml index 4bf9262..c045edb 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -20,7 +20,7 @@ classifiers = [ "Programming Language :: Python :: 3.12", ] dependencies = [ - "playwright>=1.40", + "playwright>=1.40,<1.61", "platformdirs>=4", "requests[socks]>=2.31", "maxminddb>=2.2", @@ -30,7 +30,7 @@ dependencies = [ ] [project.optional-dependencies] -dev = ["pytest>=7", "pytest-mock>=3", "responses>=0.24", "build>=1", "pytest-rerunfailures>=14", "playwright>=1.40"] +dev = ["pytest>=7", "pytest-mock>=3", "responses>=0.24", "build>=1", "pytest-rerunfailures>=14", "playwright>=1.40,<1.61"] [tool.pytest.ini_options] markers = [ diff --git a/tests/test_release_e2e.py b/tests/test_release_e2e.py index e024399..28a54b2 100644 --- a/tests/test_release_e2e.py +++ b/tests/test_release_e2e.py @@ -128,6 +128,16 @@ def test_clean_install_from_git_main(clean_venv: Path): url = f"git+{REPO_URL}@{REV}" _run([str(clean_venv), "-m", "pip", "install", url], timeout=600) + # Pin Playwright to the version the shipped binary's Juggler is built for. + # The wrapper's dependency is an open range, so an unpinned install in this + # venv silently drifts onto whatever pip resolves to. Upstream Playwright + # releases ship Juggler-protocol changes (e.g. Browser.setDefaultViewport in + # 1.61) the published binary does not speak, which breaks new_context. Force + # the blessed pin so this venv (reused by the launch test) tests the version + # users are expected to run, not a future incompatible release. + pin = (Path(__file__).resolve().parents[1] / "scripts" / "playwright_pin.txt").read_text().strip() + _run([str(clean_venv), "-m", "pip", "install", f"playwright=={pin}", "--quiet"], timeout=180) + # Importability check — catches missing __init__ exports, broken syntax, # missing runtime deps. out = _run(