Skip to content

Commit 0620596

Browse files
authored
chore: drop Python 3.7 (microsoft#1980)
1 parent f8c4548 commit 0620596

File tree

7 files changed

+5
-238
lines changed

7 files changed

+5
-238
lines changed

.github/ISSUE_TEMPLATE/bug.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ assignees: ''
1010
**Context:**
1111
- Playwright Version: [what Playwright version do you use?]
1212
- Operating System: [e.g. Windows, Linux or Mac]
13-
- Python version: [e.g. 3.7, 3.9]
13+
- Python version: [e.g. 3.8, 3.9]
1414
- Browser: [e.g. All, Chromium, Firefox, WebKit]
1515
- Extra: [any specific details about your environment]
1616

.github/workflows/ci.yml

Lines changed: 1 addition & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -43,34 +43,13 @@ jobs:
4343
build:
4444
name: Build
4545
timeout-minutes: 45
46-
env:
47-
DEBUG: pw:*
48-
DEBUG_FILE: pw-log.txt
4946
strategy:
5047
fail-fast: false
5148
matrix:
5249
os: [ubuntu-latest, windows-latest, macos-latest]
53-
python-version: [3.7, 3.8]
50+
python-version: [3.8, 3.9]
5451
browser: [chromium, firefox, webkit]
5552
include:
56-
- os: ubuntu-latest
57-
python-version: 3.9
58-
browser: chromium
59-
- os: windows-latest
60-
python-version: 3.9
61-
browser: chromium
62-
- os: macos-latest
63-
python-version: 3.9
64-
browser: chromium
65-
- os: macos-11.0
66-
python-version: 3.9
67-
browser: chromium
68-
- os: macos-11.0
69-
python-version: 3.9
70-
browser: firefox
71-
- os: macos-11.0
72-
python-version: 3.9
73-
browser: webkit
7453
- os: ubuntu-latest
7554
python-version: '3.10'
7655
browser: chromium
@@ -129,18 +108,10 @@ jobs:
129108
- name: Test Async API
130109
if: matrix.os == 'ubuntu-latest'
131110
run: xvfb-run pytest tests/async --browser=${{ matrix.browser }} --timeout 90
132-
- uses: actions/upload-artifact@v3
133-
if: failure()
134-
with:
135-
name: ${{ matrix.browser }}-${{ matrix.os }}-${{ matrix.python-version }}
136-
path: pw-log.txt
137111

138112
test-stable:
139113
name: Stable
140114
timeout-minutes: 45
141-
env:
142-
DEBUG: pw:*
143-
DEBUG_FILE: pw-log.txt
144115
strategy:
145116
fail-fast: false
146117
matrix:
@@ -179,11 +150,6 @@ jobs:
179150
- name: Test Async API
180151
if: matrix.os == 'ubuntu-latest'
181152
run: xvfb-run pytest tests/async --browser=chromium --browser-channel=${{ matrix.browser-channel }} --timeout 90
182-
- uses: actions/upload-artifact@v3
183-
if: failure()
184-
with:
185-
name: ${{ matrix.browser-channel }}-${{ matrix.os }}
186-
path: pw-log.txt
187153

188154
build-conda:
189155
name: Conda Build

playwright/_impl/_driver.py

Lines changed: 0 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@
1212
# See the License for the specific language governing permissions and
1313
# limitations under the License.
1414

15-
import asyncio
1615
import inspect
1716
import os
1817
import sys
@@ -30,22 +29,6 @@ def compute_driver_executable() -> Path:
3029
return package_path / "driver" / "playwright.sh"
3130

3231

33-
if sys.version_info.major == 3 and sys.version_info.minor == 7:
34-
if sys.platform == "win32":
35-
# Use ProactorEventLoop in 3.7, which is default in 3.8
36-
asyncio.set_event_loop_policy(asyncio.WindowsProactorEventLoopPolicy())
37-
else:
38-
# Prevent Python 3.7 from throwing on Linux:
39-
# RuntimeError: Cannot add child handler, the child watcher does not have a loop attached
40-
asyncio.get_event_loop()
41-
try:
42-
asyncio.get_child_watcher()
43-
except Exception:
44-
# uvloop does not support child watcher
45-
# see https://github.com/microsoft/playwright-python/issues/582
46-
pass
47-
48-
4932
def get_driver_env() -> dict:
5033
env = os.environ.copy()
5134
env["PW_LANG_NAME"] = "python"

playwright/sync_api/_context_manager.py

Lines changed: 0 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,6 @@
1313
# limitations under the License.
1414

1515
import asyncio
16-
import sys
1716
from typing import TYPE_CHECKING, Any, Optional, cast
1817

1918
from greenlet import greenlet
@@ -50,20 +49,6 @@ def __enter__(self) -> SyncPlaywright:
5049
Please use the Async API instead."""
5150
)
5251

53-
# In Python 3.7, asyncio.Process.wait() hangs because it does not use ThreadedChildWatcher
54-
# which is used in Python 3.8+. This is unix specific and also takes care about
55-
# cleaning up zombie processes. See https://bugs.python.org/issue35621
56-
if (
57-
sys.version_info[0] == 3
58-
and sys.version_info[1] == 7
59-
and sys.platform != "win32"
60-
and isinstance(asyncio.get_child_watcher(), asyncio.SafeChildWatcher)
61-
):
62-
from ._py37ThreadedChildWatcher import ThreadedChildWatcher # type: ignore
63-
64-
self._watcher = ThreadedChildWatcher()
65-
asyncio.set_child_watcher(self._watcher) # type: ignore
66-
6752
# Create a new fiber for the protocol dispatcher. It will be pumping events
6853
# until the end of times. We will pass control to that fiber every time we
6954
# block while waiting for a response.

playwright/sync_api/_py37ThreadedChildWatcher.py

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

pyproject.toml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ asyncio_mode = "auto"
1515

1616
[tool.mypy]
1717
ignore_missing_imports = true
18-
python_version = "3.7"
18+
python_version = "3.8"
1919
warn_unused_ignores = false
2020
warn_redundant_casts = true
2121
warn_unused_configs = true
@@ -32,7 +32,7 @@ profile = "black"
3232
[tool.pyright]
3333
include = ["playwright", "tests/sync"]
3434
ignore = ["tests/async/", "scripts/", "examples/"]
35-
pythonVersion = "3.7"
35+
pythonVersion = "3.8"
3636
reportMissingImports = false
3737
reportTypedDictNotRequiredAccess = false
3838
reportCallInDefaultInitializer = true

setup.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -221,15 +221,14 @@ def _download_and_extract_local_driver(
221221
"Topic :: Internet :: WWW/HTTP :: Browsers",
222222
"Intended Audience :: Developers",
223223
"Programming Language :: Python :: 3",
224-
"Programming Language :: Python :: 3.7",
225224
"Programming Language :: Python :: 3.8",
226225
"Programming Language :: Python :: 3.9",
227226
"Programming Language :: Python :: 3.10",
228227
"Programming Language :: Python :: 3.11",
229228
"License :: OSI Approved :: Apache Software License",
230229
"Operating System :: OS Independent",
231230
],
232-
python_requires=">=3.7",
231+
python_requires=">=3.8",
233232
cmdclass={"bdist_wheel": PlaywrightBDistWheelCommand},
234233
use_scm_version={
235234
"version_scheme": "post-release",

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy