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

fix: do not crash if pubsublite distribution can not be found when extracting semver #120

Merged
merged 13 commits into from Apr 21, 2021
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
8 changes: 7 additions & 1 deletion google/cloud/pubsublite/internal/wire/pubsub_context.py
Expand Up @@ -29,7 +29,13 @@ class _Semver(NamedTuple):


def _version() -> _Semver:
version = pkg_resources.get_distribution("google-cloud-pubsublite").version
try:
version = pkg_resources.get_distribution("google-cloud-pubsublite").version
except pkg_resources.DistributionNotFound:
_LOGGER.info(
"Failed to extract the google-cloud-pubsublite semver version. DistributionNotFound."
)
return _Semver(0, 0)
splits = version.split(".")
if len(splits) != 3:
_LOGGER.info(f"Failed to extract semver from {version}.")
Expand Down