Skip to content

Commit

Permalink
Tolerate distributions with no Name (#368)
Browse files Browse the repository at this point in the history
https://bugs.debian.org/1090247 shows a napari test failure caused by
this on Python 3.13. On closer inspection I found that
`/usr/lib/python3.13/dist-packages/coverage-7.6.0.egg-info` and
`/usr/lib/python3.13/dist-packages/tqdm-4.67.1.dist-info` existed with
no `Name` metadata field. This shouldn't cause a failure here.

Co-authored-by: Draga Doncila Pop <[email protected]>
  • Loading branch information
cjwatson and DragaDoncila authored Jan 17, 2025
1 parent e61a8af commit 5fd114b
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion src/npe2/manifest/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,13 @@ def plugin_name(self) -> str:

# look for a package name in the command id
dists = sorted(
(d.metadata["Name"] for d in distributions()), key=len, reverse=True
(
d.metadata["Name"]
for d in distributions()
if d.metadata["Name"] is not None
),
key=len,
reverse=True,
)
for name in dists:
if self.command.startswith(name): # pragma: no cover
Expand Down

0 comments on commit 5fd114b

Please sign in to comment.