MCPcopy Index your code
hub / github.com/google/adk-python / _get_project_id

Function _get_project_id

tests/remote/triggers/conftest.py:42–56  ·  view source on GitHub ↗

Return GCP project ID from env or gcloud config.

()

Source from the content-addressed store, hash-verified

40
41
42def _get_project_id() -> str | None:
43 """Return GCP project ID from env or gcloud config."""
44 project = os.environ.get("GCP_PROJECT_ID")
45 if project:
46 return project
47 try:
48 result = subprocess.run(
49 ["gcloud", "config", "get-value", "project"],
50 capture_output=True,
51 text=True,
52 check=False,
53 )
54 return result.stdout.strip() or None
55 except FileNotFoundError:
56 return None
57
58
59def _get_identity_token(audience: str) -> str | None:

Callers 1

terraform_outputsFunction · 0.85

Calls 3

stripMethod · 0.80
getMethod · 0.45
runMethod · 0.45

Tested by

no test coverage detected