Skip to content

Commit 122b25c

Browse files
committed
fix(wrap): declare pyyaml as a core dependency
`headroom wrap omp` lazily imports yaml to parse and merge omp's models.yml registry, but pyyaml was never declared, so a bare `pip install headroom-ai` (no extras) fails at wrap time with ModuleNotFoundError. Dev and test environments masked this: pyyaml arrives transitively through dev/ml extras (pre-commit, transformers). CI surfaced it as the lint failure on the merge commit: the lint job installs no project dependencies, so mypy flags the yaml import as import-untyped (typeshed publishes stubs for it). - pyproject.toml: add pyyaml>=6.0 to core dependencies - uv.lock: surgically add pyyaml to the headroom-ai dependencies and requires-dist metadata (same approach as headroomlabs-ai#2011; a full `uv lock` regeneration would undo that PR's intel-mac torch guard) - omp/runtime.py: annotate the import with type: ignore[import-untyped] following the psutil precedent (the lint env installs no deps)
1 parent f268e48 commit 122b25c

3 files changed

Lines changed: 4 additions & 1 deletion

File tree

headroom/providers/omp/runtime.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,7 @@ def inject_models_override(port: int, project: str | None = None) -> tuple[Path,
8888
* Any user-defined providers/models from the pre-wrap file are preserved:
8989
the override only deep-sets ``providers.anthropic.baseUrl``.
9090
"""
91-
import yaml
91+
import yaml # type: ignore[import-untyped] # PyYAML ships no stubs; lint env installs no deps
9292

9393
models_file = models_yml_path()
9494
backup = backup_path(models_file)

pyproject.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,7 @@ dependencies = [
5858
"rich>=13.0.0", # Rich terminal output
5959
"opentelemetry-api>=1.24.0", # Safe no-op OTEL API for instrumentation
6060
"ast-grep-cli>=0.30.0", # AST-aware code slicing (CodeCompressor); binary wheel
61+
"pyyaml>=6.0", # omp wrap: parse/merge omp's models.yml registry
6162
"tomli>=2.0.0; python_version < '3.11'", # tomllib backport for helper scripts
6263
]
6364

uv.lock

Lines changed: 2 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)