Skip to content

Commit fa0d38d

Browse files
Drop Python 3.7 (#581)
1 parent 635d0f1 commit fa0d38d

File tree

9 files changed

+9
-34
lines changed

9 files changed

+9
-34
lines changed

.github/workflows/ci.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ jobs:
5151
name: Test
5252
strategy:
5353
matrix:
54-
pyver: ['3.7', '3.8', '3.9', '3.10', '3.11']
54+
pyver: ['3.8', '3.9', '3.10', '3.11']
5555
os: [ubuntu, macos, windows]
5656
include:
5757
- pyver: pypy-3.8

.gitignore

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,4 @@
11
env/
2-
env35/
3-
env36/
4-
env37/
52
.idea/
63
__pycache__/
74
*.py[cod]

README.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@ First let's create a clean python environment to work in and install aiohttp-dev
7575
.. code:: shell
7676
7777
mkdir my_new_app && cd my_new_app
78-
virtualenv -p `which python3.7` env
78+
virtualenv -p `which python3` env
7979
. env/bin/activate
8080
pip install aiohttp-devtools create-aio-app
8181

aiohttp_devtools/logs.py

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -3,16 +3,10 @@
33
import logging.config
44
import platform
55
import re
6-
import sys
76
import traceback
87
from io import StringIO
98
from types import TracebackType
10-
from typing import Dict, Optional, Tuple, Type, Union
11-
12-
if sys.version_info < (3, 8):
13-
from typing_extensions import Literal
14-
else:
15-
from typing import Literal
9+
from typing import Dict, Literal, Optional, Tuple, Type, Union
1610

1711
import pygments
1812
from devtools import pformat

aiohttp_devtools/runserver/main.py

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,7 @@
11
import asyncio
22
import os
3-
import sys
43
from multiprocessing import set_start_method
5-
from typing import Any, Type
4+
from typing import Any, Type, TypedDict
65

76
from aiohttp.abc import AbstractAccessLogger
87
from aiohttp.web import Application
@@ -13,11 +12,6 @@
1312
from .serve import HOST, check_port_open, create_auxiliary_app
1413
from .watch import AppTask, LiveReloadTask
1514

16-
if sys.version_info < (3, 8):
17-
from typing_extensions import TypedDict
18-
else:
19-
from typing import TypedDict
20-
2115

2216
class RunServer(TypedDict):
2317
app: Application

setup.cfg

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,4 +11,4 @@ max-line-length = 120
1111
max-complexity = 10
1212

1313
[bdist_wheel]
14-
python-tag = py37.py38.py39.py310
14+
python-tag = py38.py39.py310.py311

setup.py

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -22,10 +22,10 @@
2222
'Environment :: Console',
2323
'Programming Language :: Python',
2424
'Programming Language :: Python :: 3',
25-
'Programming Language :: Python :: 3.7',
2625
'Programming Language :: Python :: 3.8',
2726
'Programming Language :: Python :: 3.9',
2827
'Programming Language :: Python :: 3.10',
28+
"Programming Language :: Python :: 3.11",
2929
'Intended Audience :: Developers',
3030
'Intended Audience :: Information Technology',
3131
'Intended Audience :: System Administrators',
@@ -67,8 +67,7 @@
6767
'click>=6.6',
6868
'devtools>=0.6',
6969
'Pygments>=2.2.0',
70-
'watchfiles>=0.10',
71-
'typing_extensions >= 3.7.4; python_version<"3.8"'
70+
"watchfiles>=0.10"
7271
],
73-
python_requires='>=3.7',
72+
python_requires=">=3.8",
7473
)

tests/test_runserver_cleanup.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ async def is_server_running() -> bool:
2626

2727
proc = await asyncio.create_subprocess_exec(
2828
sys.executable, "-c", "from aiohttp_devtools.cli import runserver; runserver()", # same as `adev runserver`
29-
str(Path(__file__).parent / "cleanup_app.py"), "--shutdown-by-url", "-v", # TODO(PY38): Remove str()
29+
Path(__file__).parent / "cleanup_app.py", "--shutdown-by-url", "-v",
3030
stdout=asyncio.subprocess.PIPE,
3131
stderr=asyncio.subprocess.PIPE,
3232
)

tests/test_runserver_watch.py

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,7 @@
1-
import sys
21
import asyncio
32
from functools import partial
43
from unittest.mock import MagicMock, call
54

6-
import pytest
75
from aiohttp import ClientSession
86
from aiohttp.web import Application
97

@@ -12,12 +10,6 @@
1210
from .conftest import create_future
1311

1412

15-
needs_py38_test = pytest.mark.skipif(
16-
sys.version_info < (3, 8),
17-
reason="This only works on Python >=3.8 because otherwise MagicMock can't be used in 'await' expression",
18-
)
19-
20-
2113
def create_awatch_mock(*results_):
2214
results = results_ or [{("x", "/path/to/file")}]
2315

@@ -76,7 +68,6 @@ async def test_multiple_file_change(event_loop, mocker):
7668
await app_task._session.close()
7769

7870

79-
@needs_py38_test
8071
async def test_python_no_server(event_loop, mocker):
8172
mocked_awatch = mocker.patch('aiohttp_devtools.runserver.watch.awatch')
8273
mocked_awatch.side_effect = create_awatch_mock({('x', '/path/to/file.py')})

0 commit comments

Comments
 (0)