Skip to content

Commit

Permalink
Update versions.py
Browse files Browse the repository at this point in the history
  • Loading branch information
Dreamsorcerer authored Jul 31, 2024
1 parent f51e2c0 commit 0192da1
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 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: 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 Down

0 comments on commit 0192da1

Please sign in to comment.