Skip to content

Commit

Permalink
fix(get_trame_versions): avoid errors
Browse files Browse the repository at this point in the history
For some currently unknown reason, not every PathDistribution contains a "Name" in the metadata.
These are probably not trame packages and thus we can probably just ignore them. But if we notice
that we are missing trame packages in the future, we should potentially find an alternative way to
identify them.

Signed-off-by: Patrick Avery <patrick.avery@kitware.com>
  • Loading branch information
psavery committed Jul 19, 2024
1 parent 72e8598 commit ce320be
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion trame_vuetify/ui/vuetify.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ def get_trame_versions():

output = []
for pkg in importlib.metadata.distributions():
name = pkg.metadata["Name"]
name = pkg.metadata.get("Name", "")
if name.startswith("trame"):
version = get_version(name)
output.append(f"{name.replace('trame-', '')} == {version}")
Expand Down
2 changes: 1 addition & 1 deletion trame_vuetify/ui/vuetify3.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ def get_trame_versions():

output = []
for pkg in importlib.metadata.distributions():
name = pkg.metadata["Name"]
name = pkg.metadata.get("Name", "")
if name.startswith("trame"):
version = get_version(name)
output.append(f"{name.replace('trame-', '')} == {version}")
Expand Down

0 comments on commit ce320be

Please sign in to comment.