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

Be more robust against invalid distribution list #132

Merged
merged 1 commit into from
Feb 7, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions robotpy_installer/pypackages.py
Original file line number Diff line number Diff line change
Expand Up @@ -150,6 +150,7 @@ def get_local_packages() -> Packages:
return {
canonicalize_name(dist.metadata["Name"]): [Version(dist.version)]
for dist in distributions()
if dist.metadata["Name"]
}


Expand Down
4 changes: 3 additions & 1 deletion robotpy_installer/roborio_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,9 @@ def get_rio_py_packages(ssh: SshController) -> typing.Dict[str, str]:
get_output=True,
)
assert result.stdout is not None
return json.loads(result.stdout)
d = json.loads(result.stdout)
# sometimes distributions.name or version is None
return {k: v for k, v in d.items() if k and v}


def get_kill_script() -> bytes:
Expand Down