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

handle importlib-metadata deprecation #7774

Merged
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
7 changes: 4 additions & 3 deletions src/poetry/repositories/installed_repository.py
Expand Up @@ -257,9 +257,8 @@ def load(cls, env: Env, with_dependencies: bool = False) -> InstalledRepository:
if path in skipped:
continue

try:
name = canonicalize_name(distribution.metadata["name"])
except TypeError:
name = distribution.metadata.get("name") # type: ignore[attr-defined]
if name is None:
logger.warning(
(
"Project environment contains an invalid distribution"
Expand All @@ -271,6 +270,8 @@ def load(cls, env: Env, with_dependencies: bool = False) -> InstalledRepository:
skipped.add(path)
continue

name = canonicalize_name(name)

if name in seen:
continue

Expand Down