fix(deps): correct optional-dependency groups + clean errors for missing extras (0.6.1)#7
Open
Sahil170595 wants to merge 2 commits into
Open
fix(deps): correct optional-dependency groups + clean errors for missing extras (0.6.1)#7Sahil170595 wants to merge 2 commits into
Sahil170595 wants to merge 2 commits into
Conversation
…ing extras (0.6.1) Dependency audit (AST scan of the shipped package vs declared extras): - [bench] dropped psutil, pyyaml, structlog -- none are imported by the packaged code (only banterhearts, which is not shipped). - [bench] added pynvml -- it IS used (bench/metrics.py GPU env metadata, try/except-guarded) but was undeclared, so [bench] silently lacked it. - [refit] added platformdirs -- used by refit's output-path resolution. - [all] no longer pulls dev tools (pytest/ruff) onto end users; CI now installs .[all,dev]. Clean errors (httpx): - The serving backends import httpx at module load, so bench/measure/safety (and plan --measure) raised a raw ModuleNotFoundError traceback without the extra. Added require_extra() (commands/_deps.py), which checks availability via importlib without importing and fails loud-and-clean with an install hint. - Install hints no longer have their [extra] swallowed by Rich markup (the resolver hint rendered as "pip install chimeraforge", dropping [resolve]); dynamic error text is now escaped. Verified in a core-only (no-httpx) env: bench/measure/safety exit 1 with clean "install chimeraforge[bench|safety]" messages (0 tracebacks) and plan --model <hf-repo> shows chimeraforge[resolve]. 486 tests pass; lint/format clean.
CI (clean install) caught what my stale local env hid: test_monitoring.py exercises the banterhearts monitoring subsystem, which hard-imports psutil (system_profiler/performance_monitor) and structlog (logging). They are correctly out of [bench] (the shipped chimeraforge package never imports them) but ARE test-time deps, so they belong in [dev]. pyyaml stays removed (nothing imports it). Verified in a clean .[dev] venv: test_monitoring + test_cli_fail_loud pass.
This was referenced Jul 5, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What & why
A dependency audit (AST scan of the shipped package vs the declared extras) surfaced cruft, a gap, and a UX bug where a missing extra produced a raw traceback.
Dependency corrections
[bench]−psutil,pyyaml,structlogbanterhearts, which isn't packaged)[bench]+pynvmlbench/metrics.pyfor GPU env metadata (guarded) but undeclared →[bench]silently lacked it[refit]+platformdirsrefit's output-path resolution (was only in[bench])[all]−dev[all]were getting pytest/ruff; CI now installs.[all,dev]Clean errors (httpx)
The serving backends
import httpxat module load, sobench/measure/safety(andplan --measure) raised a rawModuleNotFoundErrortraceback when[bench]/[safety]wasn't installed — violating the repo's "fail loud, no raw tracebacks" standard.require_extra()(commands/_deps.py) checks availability viaimportlibwithout importing and fails loud-and-clean with an install hint.[extra]swallowed by Rich markup (the resolver hint rendered aspip install chimeraforge, dropping[resolve]) — dynamic error text is now escaped.Verification
Reproduced in a core-only (no-httpx) venv before/after:
bench/measureModuleNotFoundError+ tracebackError: this command needs the 'bench' extra … pip install "chimeraforge[bench]"(exit 1, 0 tracebacks)safetychimeraforge[safety]plan --model <hf-repo>pip install chimeraforgechimeraforge[resolve]require_extraregressions intest_cli_fail_loud.py); lint + format clean.Note
README/docs improvements already on
main(product-first re-center,docs/archive/) plus these dep fixes only reach the PyPI page on the next release — this PR is the 0.6.1 candidate.