Skip to content

Commit b565b23

Browse files
authored
Merge branch 'microsoft:main' into custom-iterator-for-faster-stack-trace
2 parents 3a97f3f + 9ab4db2 commit b565b23

File tree

5 files changed

+26
-33
lines changed

5 files changed

+26
-33
lines changed

.github/workflows/test_docker.yml

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,13 +19,16 @@ on:
1919
jobs:
2020
build:
2121
timeout-minutes: 120
22-
runs-on: ubuntu-24.04
22+
runs-on: ${{ matrix.runs-on }}
2323
strategy:
2424
fail-fast: false
2525
matrix:
2626
docker-image-variant:
2727
- jammy
2828
- noble
29+
runs-on:
30+
- ubuntu-24.04
31+
- ubuntu-24.04-arm
2932
steps:
3033
- uses: actions/checkout@v4
3134
- name: Set up Python
@@ -39,10 +42,12 @@ jobs:
3942
pip install -r requirements.txt
4043
pip install -e .
4144
- name: Build Docker image
42-
run: bash utils/docker/build.sh --amd64 ${{ matrix.docker-image-variant }} playwright-python:localbuild-${{ matrix.docker-image-variant }}
45+
run: |
46+
ARCH="${{ matrix.runs-on == 'ubuntu-24.04-arm' && 'arm64' || 'amd64' }}"
47+
bash utils/docker/build.sh --$ARCH ${{ matrix.docker-image-variant }} playwright-python:localbuild-${{ matrix.docker-image-variant }}
4348
- name: Test
4449
run: |
45-
CONTAINER_ID="$(docker run --rm -v $(pwd):/root/playwright --name playwright-docker-test --workdir /root/playwright/ -d -t playwright-python:localbuild-${{ matrix.docker-image-variant }} /bin/bash)"
50+
CONTAINER_ID="$(docker run --rm -e CI -v $(pwd):/root/playwright --name playwright-docker-test --workdir /root/playwright/ -d -t playwright-python:localbuild-${{ matrix.docker-image-variant }} /bin/bash)"
4651
# Fix permissions for Git inside the container
4752
docker exec "${CONTAINER_ID}" chown -R root:root /root/playwright
4853
docker exec "${CONTAINER_ID}" pip install -r local-requirements.txt

.github/workflows/trigger_internal_tests.yml

Lines changed: 0 additions & 27 deletions
This file was deleted.

playwright/_impl/_browser_type.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -171,7 +171,7 @@ def _user_data_dir(self, userDataDir: Optional[Union[str, Path]]) -> str:
171171
# Can be dropped once we drop Python 3.9 support (10/2025):
172172
# https://github.com/python/cpython/issues/82852
173173
if sys.platform == "win32" and sys.version_info[:2] < (3, 10):
174-
return pathlib.Path.cwd() / userDataDir
174+
return str(pathlib.Path.cwd() / userDataDir)
175175
return str(Path(userDataDir).resolve())
176176
return str(Path(userDataDir))
177177

setup.py

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,8 @@ def extractall(zip: zipfile.ZipFile, path: str) -> None:
9999

100100
def download_driver(zip_name: str) -> None:
101101
zip_file = f"playwright-{driver_version}-{zip_name}.zip"
102-
if os.path.exists("driver/" + zip_file):
102+
destination_path = "driver/" + zip_file
103+
if os.path.exists(destination_path):
103104
return
104105
url = "https://playwright.azureedge.net/builds/driver/"
105106
if (
@@ -109,9 +110,11 @@ def download_driver(zip_name: str) -> None:
109110
):
110111
url = url + "next/"
111112
url = url + zip_file
113+
temp_destination_path = destination_path + ".tmp"
112114
print(f"Fetching {url}")
113115
# Don't replace this with urllib - Python won't have certificates to do SSL on all platforms.
114-
subprocess.check_call(["curl", url, "-o", "driver/" + zip_file])
116+
subprocess.check_call(["curl", url, "-o", temp_destination_path])
117+
os.rename(temp_destination_path, destination_path)
115118

116119

117120
class PlaywrightBDistWheelCommand(BDistWheelCommand):

tests/common/test_signals.py

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,10 @@
2727
def _test_signals_async(
2828
browser_name: str, launch_arguments: Dict, wait_queue: "multiprocessing.Queue[str]"
2929
) -> None:
30+
# On Windows, hint to mypy and pyright that they shouldn't check this function
31+
if sys.platform == "win32":
32+
return
33+
3034
os.setpgrp()
3135
sigint_received = False
3236

@@ -67,6 +71,10 @@ async def main() -> None:
6771
def _test_signals_sync(
6872
browser_name: str, launch_arguments: Dict, wait_queue: "multiprocessing.Queue[str]"
6973
) -> None:
74+
# On Windows, hint to mypy and pyright that they shouldn't check this function
75+
if sys.platform == "win32":
76+
return
77+
7078
os.setpgrp()
7179
sigint_received = False
7280

@@ -103,6 +111,10 @@ def my_sig_handler(signum: int, frame: Any) -> None:
103111
def _create_signals_test(
104112
target: Any, browser_name: str, launch_arguments: Dict
105113
) -> None:
114+
# On Windows, hint to mypy and pyright that they shouldn't check this function
115+
if sys.platform == "win32":
116+
return
117+
106118
wait_queue: "multiprocessing.Queue[str]" = multiprocessing.Queue()
107119
process = multiprocessing.Process(
108120
target=target, args=[browser_name, launch_arguments, wait_queue]

0 commit comments

Comments
 (0)