Files
hermes-agent/setup.py
T
LeonSGP43 3a7ed7be08 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.
2026-05-18 20:52:35 -07:00

29 lines
687 B
Python

from __future__ import annotations
from collections import defaultdict
from pathlib import Path
from setuptools import setup
REPO_ROOT = Path(__file__).parent.resolve()
def _data_file_tree(root_name: str) -> list[tuple[str, list[str]]]:
root = REPO_ROOT / root_name
grouped: defaultdict[str, list[str]] = defaultdict(list)
for path in sorted(root.rglob("*")):
if not path.is_file():
continue
rel_path = path.relative_to(REPO_ROOT)
grouped[str(rel_path.parent)].append(str(rel_path))
return sorted(grouped.items())
setup(
data_files=[
*_data_file_tree("skills"),
*_data_file_tree("optional-skills"),
]
)