From 13038dc747aacc211fcc2a5cf2e7fafc1b3719b8 Mon Sep 17 00:00:00 2001 From: Teknium Date: Fri, 24 Apr 2026 16:05:12 -0700 Subject: [PATCH] fix(skills): ship google-workspace deps as [google] extra; make setup.py 3.9-parseable MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Closes #13626. Two follow-ups on top of the _hermes_home helper from @jerome-benoit's #12729: 1. Declare a [google] optional extra in pyproject.toml (google-api-python-client, google-auth-oauthlib, google-auth-httplib2) and include it in [all]. Packagers (Nix flake, Homebrew) now ship the deps by default, so `setup.py --check` does not need to shell out to pip at runtime — the imports succeed and install_deps() is never reached. This fixes the Nix breakage where pip/ensurepip are stripped. 2. Add `from __future__ import annotations` to setup.py so the PEP 604 `str | None` annotation parses on Python 3.9 (macOS system python). Previously system python3 SyntaxError'd before any code ran. install_deps() error message now also points users at the extra instead of just the raw pip command. --- pyproject.toml | 10 ++++++++++ skills/productivity/google-workspace/scripts/setup.py | 8 +++++++- 2 files changed, 17 insertions(+), 1 deletion(-) diff --git a/pyproject.toml b/pyproject.toml index 1418df6d8..4b7e8816a 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -78,6 +78,15 @@ termux = [ ] dingtalk = ["dingtalk-stream>=0.20,<1", "alibabacloud-dingtalk>=2.0.0", "qrcode>=7.0,<8"] feishu = ["lark-oapi>=1.5.3,<2", "qrcode>=7.0,<8"] +google = [ + # Required by the google-workspace skill (Gmail, Calendar, Drive, Contacts, + # Sheets, Docs). Declared here so packagers (Nix, Homebrew) ship them with + # the [all] extra and users don't hit runtime `pip install` paths that fail + # in environments without pip (e.g. Nix-managed Python). + "google-api-python-client>=2.100,<3", + "google-auth-oauthlib>=1.0,<2", + "google-auth-httplib2>=0.2,<1", +] # `hermes dashboard` (localhost SPA + API). Not in core to keep the default install lean. web = ["fastapi>=0.104.0,<1", "uvicorn[standard]>=0.24.0,<1"] rl = [ @@ -110,6 +119,7 @@ all = [ "hermes-agent[voice]", "hermes-agent[dingtalk]", "hermes-agent[feishu]", + "hermes-agent[google]", "hermes-agent[mistral]", "hermes-agent[bedrock]", "hermes-agent[web]", diff --git a/skills/productivity/google-workspace/scripts/setup.py b/skills/productivity/google-workspace/scripts/setup.py index 70d7b0a10..851d8911b 100644 --- a/skills/productivity/google-workspace/scripts/setup.py +++ b/skills/productivity/google-workspace/scripts/setup.py @@ -21,6 +21,8 @@ Agent workflow: 6. Run --check to verify. Done. """ +from __future__ import annotations # allow PEP 604 `X | None` on Python 3.9+ + import argparse import json import os @@ -110,7 +112,11 @@ def install_deps(): return True except subprocess.CalledProcessError as e: print(f"ERROR: Failed to install dependencies: {e}") - print(f"Try manually: {sys.executable} -m pip install {' '.join(REQUIRED_PACKAGES)}") + print( + "On environments without pip (e.g. Nix), install the optional extra instead:" + ) + print(" pip install 'hermes-agent[google]'") + print(f"Or manually: {sys.executable} -m pip install {' '.join(REQUIRED_PACKAGES)}") return False