fix(packaging): ship bundled skills in wheel

Salvages #23738 by @LeonSGP43. Wheel installs were missing skills/ and
optional-skills/ because pyproject's [tool.setuptools.packages.find]
only includes Python packages — the skills directories don't have
__init__.py so they were silently dropped from the wheel.

Adds setup.py with data_files spec emitting skills/* and optional-skills/*
under hermes_agent-<v>.data/data/, and a get_bundled_skills_dir() helper
in hermes_constants that discovers the wheel-installed location via
sysconfig before falling back to a source-checkout path. tools/skills_sync
uses the helper so 'hermes update' works for pip-installed users.
This commit is contained in:
LeonSGP43 2026-05-18 20:52:29 -07:00 committed by Teknium
parent 5fdcfd851f
commit 3a7ed7be08
3 changed files with 73 additions and 6 deletions

View file

@ -26,7 +26,7 @@ import logging
import os
import shutil
from pathlib import Path
from hermes_constants import get_hermes_home
from hermes_constants import get_bundled_skills_dir, get_hermes_home
from typing import Dict, List, Tuple
from utils import atomic_replace
@ -42,12 +42,10 @@ def _get_bundled_dir() -> Path:
"""Locate the bundled skills/ directory.
Checks HERMES_BUNDLED_SKILLS env var first (set by Nix wrapper),
then falls back to the relative path from this source file.
then a wheel-installed data dir, then falls back to the relative
path from this source file.
"""
env_override = os.getenv("HERMES_BUNDLED_SKILLS")
if env_override:
return Path(env_override)
return Path(__file__).parent.parent / "skills"
return get_bundled_skills_dir(Path(__file__).parent.parent / "skills")
def _read_manifest() -> Dict[str, str]: