Skip to content

Commit

Permalink
Drop Python 3.7 (#581)
Browse files Browse the repository at this point in the history
  • Loading branch information
Dreamsorcerer authored Jun 30, 2023
1 parent 635d0f1 commit fa0d38d
Show file tree
Hide file tree
Showing 9 changed files with 9 additions and 34 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ jobs:
name: Test
strategy:
matrix:
pyver: ['3.7', '3.8', '3.9', '3.10', '3.11']
pyver: ['3.8', '3.9', '3.10', '3.11']
os: [ubuntu, macos, windows]
include:
- pyver: pypy-3.8
Expand Down
3 changes: 0 additions & 3 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,7 +1,4 @@
env/
env35/
env36/
env37/
.idea/
__pycache__/
*.py[cod]
Expand Down
2 changes: 1 addition & 1 deletion README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ First let's create a clean python environment to work in and install aiohttp-dev
.. code:: shell
mkdir my_new_app && cd my_new_app
virtualenv -p `which python3.7` env
virtualenv -p `which python3` env
. env/bin/activate
pip install aiohttp-devtools create-aio-app
Expand Down
8 changes: 1 addition & 7 deletions aiohttp_devtools/logs.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,16 +3,10 @@
import logging.config
import platform
import re
import sys
import traceback
from io import StringIO
from types import TracebackType
from typing import Dict, Optional, Tuple, Type, Union

if sys.version_info < (3, 8):
from typing_extensions import Literal
else:
from typing import Literal
from typing import Dict, Literal, Optional, Tuple, Type, Union

import pygments
from devtools import pformat
Expand Down
8 changes: 1 addition & 7 deletions aiohttp_devtools/runserver/main.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
import asyncio
import os
import sys
from multiprocessing import set_start_method
from typing import Any, Type
from typing import Any, Type, TypedDict

from aiohttp.abc import AbstractAccessLogger
from aiohttp.web import Application
Expand All @@ -13,11 +12,6 @@
from .serve import HOST, check_port_open, create_auxiliary_app
from .watch import AppTask, LiveReloadTask

if sys.version_info < (3, 8):
from typing_extensions import TypedDict
else:
from typing import TypedDict


class RunServer(TypedDict):
app: Application
Expand Down
2 changes: 1 addition & 1 deletion setup.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -11,4 +11,4 @@ max-line-length = 120
max-complexity = 10

[bdist_wheel]
python-tag = py37.py38.py39.py310
python-tag = py38.py39.py310.py311
7 changes: 3 additions & 4 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,10 +22,10 @@
'Environment :: Console',
'Programming Language :: Python',
'Programming Language :: Python :: 3',
'Programming Language :: Python :: 3.7',
'Programming Language :: Python :: 3.8',
'Programming Language :: Python :: 3.9',
'Programming Language :: Python :: 3.10',
"Programming Language :: Python :: 3.11",
'Intended Audience :: Developers',
'Intended Audience :: Information Technology',
'Intended Audience :: System Administrators',
Expand Down Expand Up @@ -67,8 +67,7 @@
'click>=6.6',
'devtools>=0.6',
'Pygments>=2.2.0',
'watchfiles>=0.10',
'typing_extensions >= 3.7.4; python_version<"3.8"'
"watchfiles>=0.10"
],
python_requires='>=3.7',
python_requires=">=3.8",
)
2 changes: 1 addition & 1 deletion tests/test_runserver_cleanup.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ async def is_server_running() -> bool:

proc = await asyncio.create_subprocess_exec(
sys.executable, "-c", "from aiohttp_devtools.cli import runserver; runserver()", # same as `adev runserver`
str(Path(__file__).parent / "cleanup_app.py"), "--shutdown-by-url", "-v", # TODO(PY38): Remove str()
Path(__file__).parent / "cleanup_app.py", "--shutdown-by-url", "-v",
stdout=asyncio.subprocess.PIPE,
stderr=asyncio.subprocess.PIPE,
)
Expand Down
9 changes: 0 additions & 9 deletions tests/test_runserver_watch.py
Original file line number Diff line number Diff line change
@@ -1,9 +1,7 @@
import sys
import asyncio
from functools import partial
from unittest.mock import MagicMock, call

import pytest
from aiohttp import ClientSession
from aiohttp.web import Application

Expand All @@ -12,12 +10,6 @@
from .conftest import create_future


needs_py38_test = pytest.mark.skipif(
sys.version_info < (3, 8),
reason="This only works on Python >=3.8 because otherwise MagicMock can't be used in 'await' expression",
)


def create_awatch_mock(*results_):
results = results_ or [{("x", "/path/to/file")}]

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


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

0 comments on commit fa0d38d

Please sign in to comment.