diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 1762b729..88379167 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -49,7 +49,7 @@ jobs: name: Test strategy: matrix: - pyver: ['3.7', '3.8', '3.9', '3.10'] + pyver: ['3.8', '3.9', '3.10'] os: [ubuntu, macos, windows] include: - pyver: pypy-3.8 diff --git a/aiohttp_debugtoolbar/main.py b/aiohttp_debugtoolbar/main.py index 2c9ed999..32738219 100644 --- a/aiohttp_debugtoolbar/main.py +++ b/aiohttp_debugtoolbar/main.py @@ -1,12 +1,6 @@ import secrets -import sys from pathlib import Path -from typing import Iterable, Sequence, Tuple, Type, Union - -if sys.version_info >= (3, 8): - from typing import Literal, TypedDict -else: - from typing_extensions import Literal, TypedDict +from typing import Iterable, Literal, Sequence, Tuple, Type, TypedDict, Union import aiohttp_jinja2 import jinja2 diff --git a/aiohttp_debugtoolbar/panels/versions.py b/aiohttp_debugtoolbar/panels/versions.py index 44033954..671d0638 100644 --- a/aiohttp_debugtoolbar/panels/versions.py +++ b/aiohttp_debugtoolbar/panels/versions.py @@ -1,18 +1,11 @@ import platform import sys +from importlib.metadata import Distribution, version from operator import itemgetter from typing import ClassVar, Dict, List, Optional from .base import DebugPanel -if sys.version_info >= (3, 8): - from importlib.metadata import Distribution, version -else: - Distribution = None - - def version(_v): - return "" - __all__ = ("VersionDebugPanel",) aiohttp_version = version("aiohttp") @@ -44,9 +37,6 @@ def get_packages(cls) -> List[Dict[str, str]]: if VersionDebugPanel.packages: return VersionDebugPanel.packages - if Distribution is None: - return () # type: ignore[unreachable] - packages = [] for distribution in Distribution.discover(): name = distribution.metadata["Name"] diff --git a/requirements.txt b/requirements.txt index a67c8f09..b9a817c0 100644 --- a/requirements.txt +++ b/requirements.txt @@ -14,5 +14,4 @@ pytest-aiohttp==1.0.5 pytest-cov==4.1.0 pytest-sugar==0.9.7 pytest-timeout==2.2.0 -typing_extensions>=3.8; python_version<"3.8" yarl==1.9.2 diff --git a/setup.py b/setup.py index f274022b..141f317e 100644 --- a/setup.py +++ b/setup.py @@ -26,7 +26,6 @@ def read(fname): "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", @@ -41,7 +40,6 @@ def read(fname): install_requires=( "aiohttp>=3.8", "aiohttp_jinja2", - 'typing_extensions>=3.8; python_version<"3.8"', ), include_package_data=True, ) diff --git a/tests/test_panels_versions.py b/tests/test_panels_versions.py index a20590a5..19c70fbd 100644 --- a/tests/test_panels_versions.py +++ b/tests/test_panels_versions.py @@ -1,13 +1,10 @@ -import sys from unittest.mock import create_autospec -import pytest from aiohttp import web from aiohttp_debugtoolbar.panels import VersionDebugPanel -@pytest.mark.skipif(sys.version_info < (3, 8), reason="Missing importlib.metadata") async def test_packages(): request_mock = create_autospec(web.Request) panel = VersionDebugPanel(request_mock)