Skip to content

[Bug]: google-workspace skill setup.py fails — hermes_constants import + missing Google API deps #12722

@jerome-benoit

Description

@jerome-benoit

Bug Description

The google-workspace skill scripts (setup.py and google_api.py) cannot run with a standard python or python3 invocation:

  1. setup.py imports hermes_constants at module level, which is only available inside the Hermes nix/pip environment — not on the system Python. The fallback (Path(__file__).resolve().parents[4]) assumes a specific directory layout that does not match the installed skill path (~/.hermes/skills/productivity/google-workspace/scripts/).

  2. Neither script can install its own deps because the Hermes nix environment does not include pip or ensurepip. The _ensure_deps() auto-install in setup.py always fails with No module named pip.

  3. google_api.py does NOT depend on hermes_constants (it uses os.getenv("HERMES_HOME")), creating an inconsistency between the two scripts in the same skill.

Steps to Reproduce

# System python — fails (no hermes_constants)
python3 ~/.hermes/skills/productivity/google-workspace/scripts/setup.py --check

# Hermes nix python — fails (no Google API deps, no pip)
$HERMES_PYTHON ~/.hermes/skills/productivity/google-workspace/scripts/setup.py --check

Expected Behavior

setup.py should work the same way as google_api.py — using os.getenv("HERMES_HOME") as fallback when hermes_constants is unavailable, and the Google API deps should either be bundled in the Hermes environment or the skill should document the correct invocation.

Actual Behavior

setup.py crashes with ModuleNotFoundError: No module named 'hermes_constants' on any Python that is not the Hermes package environment with the correct PYTHONPATH.

Affected Component

  • Skills (skill loading, skill hub, skill guard)

Messaging Platform

N/A (CLI only)

Debug Report

N/A — this is a code-level issue visible by reading setup.py lines 31-37 vs google_api.py line 34.

Operating System

macOS (nix-managed Hermes installation)

Python Version

System: 3.9.6, Hermes env: 3.12.13

Hermes Version

0.9.0

Root Cause Analysis

setup.py lines 31-37:

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

The fallback re-raises the same ModuleNotFoundError. Compare with google_api.py line 34:

HERMES_HOME = Path(os.getenv("HERMES_HOME", Path.home() / ".hermes"))

Additionally, Google API dependencies (google-api-python-client, google-auth-oauthlib, google-auth-httplib2) are not included in the Hermes nix environment, and the nix env lacks pip/ensurepip to self-install them.

Proposed Fix

  1. In setup.py, replace the hermes_constants import with a fallback matching google_api.py:
try:
    from hermes_constants import display_hermes_home, get_hermes_home
    HERMES_HOME = get_hermes_home()
except (ModuleNotFoundError, Exception):
    HERMES_HOME = Path(os.getenv("HERMES_HOME", Path.home() / ".hermes"))
    def display_hermes_home():
        return "~/.hermes" if str(HERMES_HOME) == str(Path.home() / ".hermes") else str(HERMES_HOME)
  1. Add google-api-python-client, google-auth-oauthlib, google-auth-httplib2 to the Hermes environment dependencies (nix or pip).
  • I'd like to fix this myself and submit a PR

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions