summaryrefslogtreecommitdiff
path: root/www/py-playwright/files
diff options
context:
space:
mode:
Diffstat (limited to 'www/py-playwright/files')
-rw-r--r--www/py-playwright/files/patch-pyproject.toml17
-rw-r--r--www/py-playwright/files/patch-setup.py28
-rw-r--r--www/py-playwright/files/test-async.py14
-rw-r--r--www/py-playwright/files/test-sync.py11
4 files changed, 70 insertions, 0 deletions
diff --git a/www/py-playwright/files/patch-pyproject.toml b/www/py-playwright/files/patch-pyproject.toml
new file mode 100644
index 000000000000..7991fde60245
--- /dev/null
+++ b/www/py-playwright/files/patch-pyproject.toml
@@ -0,0 +1,17 @@
+--- pyproject.toml.orig 2025-09-02 18:47:12 UTC
++++ pyproject.toml
+@@ -1,5 +1,5 @@
+ [build-system]
+-requires = ["setuptools==80.9.0", "setuptools-scm==8.3.1", "wheel==0.45.1", "auditwheel==6.2.0"]
++requires = ["setuptools", "setuptools-scm", "wheel"]
+ build-backend = "setuptools.build_meta"
+
+ [project]
+@@ -9,7 +9,6 @@ readme = "README.md"
+ {name = "Microsoft Corporation"}
+ ]
+ readme = "README.md"
+-license = "Apache-2.0"
+ dynamic = ["version"]
+ requires-python = ">=3.9"
+ # Please when changing dependencies run the following commands to update requirements.txt:
diff --git a/www/py-playwright/files/patch-setup.py b/www/py-playwright/files/patch-setup.py
new file mode 100644
index 000000000000..1b7831869548
--- /dev/null
+++ b/www/py-playwright/files/patch-setup.py
@@ -0,0 +1,28 @@
+--- setup.py.orig 2025-08-28 09:27:29 UTC
++++ setup.py
+@@ -74,6 +74,16 @@ base_wheel_bundles = [
+ },
+ ]
+
++# override for FreeBSD: use the Linux one and update the node binary in it
++base_wheel_bundles = [
++ {
++ "wheel": "manylinux1_x86_64.whl",
++ "machine": platform.machine().lower(),
++ "platform": sys.platform,
++ "zip_name": "linux",
++ }
++]
++
+ if len(sys.argv) == 2 and sys.argv[1] == "--list-wheels":
+ for bundle in base_wheel_bundles:
+ print(bundle["wheel"])
+@@ -108,7 +118,7 @@ def download_driver(zip_name: str) -> None:
+ or "-beta" in driver_version
+ or "-next" in driver_version
+ ):
+- url = url + "next/"
++ pass # do not alter the URL
+ url = url + zip_file
+ temp_destination_path = destination_path + ".tmp"
+ print(f"Fetching {url}")
diff --git a/www/py-playwright/files/test-async.py b/www/py-playwright/files/test-async.py
new file mode 100644
index 000000000000..f047304580c0
--- /dev/null
+++ b/www/py-playwright/files/test-async.py
@@ -0,0 +1,14 @@
+import asyncio
+from playwright.async_api import async_playwright
+
+async def main():
+ async with async_playwright() as p:
+ #for browser_type in [p.chromium, p.firefox, p.webkit]:
+ for browser_type in [p.firefox]:
+ browser = await browser_type.launch()
+ page = await browser.new_page()
+ await page.goto('http://playwright.dev')
+ await page.screenshot(path=f'example-{browser_type.name}-async.png')
+ await browser.close()
+
+asyncio.run(main())
diff --git a/www/py-playwright/files/test-sync.py b/www/py-playwright/files/test-sync.py
new file mode 100644
index 000000000000..19e028c11173
--- /dev/null
+++ b/www/py-playwright/files/test-sync.py
@@ -0,0 +1,11 @@
+from playwright.sync_api import sync_playwright
+
+with sync_playwright() as p:
+ #for browser_type in [p.chromium, p.firefox, p.webkit]:
+ for browser_type in [p.firefox]:
+ browser = browser_type.launch()
+ page = browser.new_page()
+ page.goto('http://playwright.dev')
+ page.screenshot(path=f'example-{browser_type.name}-sync.png')
+ browser.close()
+