fix: allow google-workspace skill scripts to run directly

- fall back to adding the repo root to sys.path when hermes_constants is not importable
- fixes direct execution of setup.py and google_api.py from the repo checkout
- keeps the upstream PR scoped to the google-workspace compatibility fix
This commit is contained in:
Zainan Victor Zhou 2026-04-06 13:01:14 -07:00 committed by Teknium
parent 1c0183ec71
commit 83df001d01
2 changed files with 14 additions and 2 deletions

View file

@ -27,7 +27,13 @@ import subprocess
import sys
from pathlib import Path
from hermes_constants import display_hermes_home, get_hermes_home
try:
from hermes_constants import display_hermes_home, get_hermes_home
except ModuleNotFoundError:
HERMES_AGENT_ROOT = Path(__file__).resolve().parents[4]
if HERMES_AGENT_ROOT.exists():
sys.path.insert(0, str(HERMES_AGENT_ROOT))
from hermes_constants import display_hermes_home, get_hermes_home
HERMES_HOME = get_hermes_home()
TOKEN_PATH = HERMES_HOME / "google_token.json"