Skip to content

Commit

Permalink
Update versions.py
Browse files Browse the repository at this point in the history
Addresses #60
  • Loading branch information
fsecada01 authored Jan 20, 2025
1 parent f6a2ee2 commit 2da9f1e
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions debug_toolbar/panels/versions.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,10 @@ def scripts(self) -> list[str]:
return scripts

async def generate_stats(self, request: Request, response: Response) -> Stats:
dists = {d.metadata.get("name", None): d for d in
metadata.distributions()}
packages = sorted(
metadata.distributions(),
key=lambda dist: dist.metadata["name"].lower(),
dists,
key=lambda dist: dist.lower() if dist else "",
)
return {"packages": packages}

0 comments on commit 2da9f1e

Please sign in to comment.