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 failure on missing google.auth inside container #122

Merged
merged 1 commit into from
Jan 25, 2024
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
10 changes: 8 additions & 2 deletions caliban/resources/caliban_launcher.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@

import argparse
import copy
import google.auth
from importlib.util import find_spec
import json
import logging
import os
Expand Down Expand Up @@ -153,7 +153,13 @@ def _ensure_non_null_project(env):

project_id = None
try:
_, project_id = google.auth.default()
if find_spec("google.auth") is not None:
import google.auth

_, project_id = google.auth.default()
else:
project_id = None

except Exception:
project_id = None

Expand Down
5 changes: 5 additions & 0 deletions setup.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,11 @@ addopts = --doctest-modules -v -s
[pycodestyle]
ignore = E111,E114

[yapf]
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I added these back so that my emacs autoformat wouldn't clobber the file. Time to switch fully to vs code for python...

based_on_style = google
indent_width = 2
split_before_first_argument = false

# pytest coverage options
[run]
omit =
Expand Down
Loading