From 83df001d01e0de7fa84640ccd87c6b38777d8730 Mon Sep 17 00:00:00 2001 From: Zainan Victor Zhou Date: Mon, 6 Apr 2026 13:01:14 -0700 Subject: [PATCH] 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 --- .../productivity/google-workspace/scripts/google_api.py | 8 +++++++- skills/productivity/google-workspace/scripts/setup.py | 8 +++++++- 2 files changed, 14 insertions(+), 2 deletions(-) diff --git a/skills/productivity/google-workspace/scripts/google_api.py b/skills/productivity/google-workspace/scripts/google_api.py index 2a5c662a6..ece0c3ea0 100644 --- a/skills/productivity/google-workspace/scripts/google_api.py +++ b/skills/productivity/google-workspace/scripts/google_api.py @@ -27,7 +27,13 @@ from datetime import datetime, timedelta, timezone from email.mime.text import MIMEText 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" diff --git a/skills/productivity/google-workspace/scripts/setup.py b/skills/productivity/google-workspace/scripts/setup.py index 52a07427d..5e4924f9d 100644 --- a/skills/productivity/google-workspace/scripts/setup.py +++ b/skills/productivity/google-workspace/scripts/setup.py @@ -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"