diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 84329cd1..9d17d3bf 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -50,7 +50,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 diff --git a/aiohttp_jinja2/__init__.py b/aiohttp_jinja2/__init__.py index 8cae9b7e..5d7381f1 100644 --- a/aiohttp_jinja2/__init__.py +++ b/aiohttp_jinja2/__init__.py @@ -1,5 +1,4 @@ import functools -import sys from typing import ( Any, Awaitable, @@ -7,6 +6,7 @@ Dict, Mapping, Optional, + Protocol, Sequence, Tuple, TypeVar, @@ -19,11 +19,6 @@ from aiohttp import web from aiohttp.abc import AbstractView -if sys.version_info >= (3, 8): - from typing import Protocol -else: - from typing_extensions import Protocol - from .helpers import GLOBAL_HELPERS from .typedefs import Filters diff --git a/aiohttp_jinja2/helpers.py b/aiohttp_jinja2/helpers.py index 80b60f86..fb367555 100644 --- a/aiohttp_jinja2/helpers.py +++ b/aiohttp_jinja2/helpers.py @@ -2,21 +2,15 @@ useful context functions, see http://jinja.pocoo.org/docs/dev/api/#jinja2.contextfunction """ -import sys -from typing import Any, Dict, Optional, Union +from typing import Dict, Optional, TypedDict, Union import jinja2 from aiohttp import web from yarl import URL -if sys.version_info >= (3, 8): - from typing import TypedDict - class _Context(TypedDict, total=False): - app: web.Application - -else: - _Context = Dict[str, Any] +class _Context(TypedDict, total=False): + app: web.Application @jinja2.pass_context diff --git a/setup.py b/setup.py index 9accb347..4e27e98d 100644 --- a/setup.py +++ b/setup.py @@ -27,13 +27,6 @@ def read(f): return Path(__file__).with_name(f).read_text() -install_requires = [ - "aiohttp>=3.6.3", - "jinja2>=3.0.0", - 'typing_extensions>=3.7.4; python_version<"3.8"', -] - - setup( name="aiohttp-jinja2", version=version, @@ -44,7 +37,6 @@ def read(f): "Intended Audience :: Developers", "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", @@ -59,7 +51,7 @@ def read(f): url="https://github.com/aio-libs/aiohttp_jinja2/", license="Apache 2", packages=["aiohttp_jinja2"], - python_requires=">=3.7", - install_requires=install_requires, + python_requires=">=3.8", + install_requires=("aiohttp>=3.6.3", "jinja2>=3.0.0"), include_package_data=True, )