Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Drop Python 3.7 #507

Merged
merged 4 commits into from
Nov 19, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
8 changes: 1 addition & 7 deletions aiohttp_debugtoolbar/main.py
Original file line number Diff line number Diff line change
@@ -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
Expand Down
12 changes: 1 addition & 11 deletions aiohttp_debugtoolbar/panels/versions.py
Original file line number Diff line number Diff line change
@@ -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")
Expand Down Expand Up @@ -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"]
Expand Down
1 change: 0 additions & 1 deletion requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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
2 changes: 0 additions & 2 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand All @@ -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,
)
3 changes: 0 additions & 3 deletions tests/test_panels_versions.py
Original file line number Diff line number Diff line change
@@ -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)
Expand Down