Skip to content

Commit

Permalink
chore: cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
phil65 committed Oct 21, 2023
1 parent 80d532f commit 34f74b7
Showing 1 changed file with 3 additions and 5 deletions.
8 changes: 3 additions & 5 deletions mknodes/info/packageinfo.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
from __future__ import annotations

import collections
import contextlib
import functools

Expand Down Expand Up @@ -153,13 +154,10 @@ def authors(self) -> dict[str, str]:
@functools.cached_property
def extras(self) -> dict[str, list[str]]:
"""Return a dict containing extras and the packages {extra: [package_1, ...]}."""
extras: dict[str, list[str]] = {}
extras: collections.defaultdict = collections.defaultdict(list)
for dep in self._required_deps:
for extra in dep.extras:
if extra in extras:
extras[extra].append(dep.name)
else:
extras[extra] = [dep.name]
extras[extra].append(dep.name)
return extras

@functools.cached_property
Expand Down

0 comments on commit 34f74b7

Please sign in to comment.