mirror of
https://github.com/NousResearch/hermes-agent.git
synced 2026-06-01 07:01:41 +00:00
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:
parent
5fdcfd851f
commit
3a7ed7be08
3 changed files with 73 additions and 6 deletions
28
setup.py
Normal file
28
setup.py
Normal file
|
|
@ -0,0 +1,28 @@
|
|||
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"),
|
||||
]
|
||||
)
|
||||
Loading…
Add table
Add a link
Reference in a new issue