Skip to content

Commit

Permalink
Bump mypy from 1.10.1 to 1.11.1 (#570)
Browse files Browse the repository at this point in the history
Signed-off-by: dependabot[bot] <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Sam Bull <[email protected]>
  • Loading branch information
dependabot[bot] and Dreamsorcerer authored Jul 31, 2024
1 parent 3d43ce8 commit fabd0fa
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 4 deletions.
14 changes: 11 additions & 3 deletions aiohttp_debugtoolbar/panels/versions.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
import sys
from importlib.metadata import Distribution, version
from operator import itemgetter
from typing import ClassVar, Dict, List, Optional
from typing import ClassVar, Dict, List, Optional, TypedDict

from .base import DebugPanel

Expand All @@ -11,6 +11,14 @@
aiohttp_version = version("aiohttp")


class _Package(TypedDict):
version: str
lowername: str
name: str
dependencies: List[str]
url: Optional[str]


class VersionDebugPanel(DebugPanel):
"""
Panel that displays the Python version, the aiohttp version, and the
Expand All @@ -37,7 +45,7 @@ def get_packages(cls) -> List[Dict[str, str]]:
if VersionDebugPanel.packages:
return VersionDebugPanel.packages

packages = []
packages: List[_Package] = []
for distribution in Distribution.discover():
name = distribution.metadata["Name"]
dependencies = [d for d in distribution.requires or ()]
Expand All @@ -53,7 +61,7 @@ def get_packages(cls) -> List[Dict[str, str]]:
}
)

VersionDebugPanel.packages = sorted(packages, key=itemgetter("lowername"))
VersionDebugPanel.packages = sorted(packages, key=itemgetter("lowername")) # type: ignore[arg-type]
return VersionDebugPanel.packages

def _get_platform_name(self):
Expand Down
2 changes: 1 addition & 1 deletion requirements-dev.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
-r requirements.txt

mypy==1.10.1
mypy==1.11.1

0 comments on commit fabd0fa

Please sign in to comment.