Repository navigation
fix(deps): make installs without dev dependencies work - #573
Conversation
tree-sitter-language-pack 1.6.3, the newest release the <1.8 cap allowed, installs without an importable module, so a fresh resolve made every audit crash while loading controls. Cap it at <1.6.3. celpy.c7nlib imports packaging, which cel-python does not declare. Outside a dev environment (where pytest brings it in) every control with an expr was ERROR. Declare packaging in darnit-core. uv.lock: the two specifier lines only; locked versions are unchanged. Signed-off-by: Marc-cn <130138935+Marc-cn@users.noreply.github.com> Assisted-by: Claude:claude-fable-5-1
mlieberman85
left a comment
There was a problem hiding this comment.
Thanks, this reproduces exactly as described and the fix checks out. I also reproduced the tree-sitter half on macOS with Python 3.14, since 1.6.3 ships a cp314 mac wheel with the same _native/ layout. So it isn't Linux-only.
- Please add
Closes #441. Core importspackagingitself (core/composition.py:363,config/framework_schema.py:1403), so could the pyproject comment say that rather than only celpy? - While you're there, could you fix the stale comment at
framework_schema.py:1401-1402and the CLAUDE.md note that sayspackagingis undeclared? - Yes please to the non-dev install + one-audit CI job, here or as a follow-up.
release-smoke.ymlonly checks--version/imports, and our container ispython:3.12-slim+pip install darnit-mcp, which is exactly the combination that resolves 1.6.3.
I'd like this in before #559 cuts 0.2.0.
Drafted with Claude Code; reviewed and posted by me.
Review feedback on darnitdevorg#573. Core imports packaging for PEP 440 version constraints (core/composition.py, config/framework_schema.py); the pyproject comment credited only celpy. Correct the comment in framework_schema.py that called it a transitive dependency, and the CLAUDE.md note that said it was undeclared. Signed-off-by: Marc-cn <130138935+Marc-cn@users.noreply.github.com> Assisted-by: Claude:claude-fable-5-1
|
Thanks for checking on macOS, I added that to the description. Pushed a second commit with your points:
CI job: yes. I'll open it as a follow-up PR so this one can go in before 0.2.0. Plan: install the built wheels into a clean Drafted with Claude; reviewed and posted by me. |
Summary
An install without the development dependencies does not work on main. That covers the "Quick install" in
docs/install/from-source.md(uv tool install --editable ...) and, as far as I can tell, any install from a built wheel. Two separate causes:tree-sitter-language-pack1.6.3 has no importable module. It is the newest release inside the>=1.5,<1.8range (there is no 1.7), so a fresh resolve picks it. The import guard inthreat_model/parsing.pythen reports "tree-sitter-language-pack is not installed", the baseline handlers fail to register, anddarnit auditends in anAuthorityViolationtraceback on the first plugin step type.packagingis not declared.darnit/sieve/cel_evaluator.pyimportscelpy.c7nlib, which doesfrom packaging.version import Version.cel-python0.5.0 does not declarepackaging. The guard reports "cel-python not installed" and every control with anexprisERROR.Neither shows up in the workspace or in CI:
uv.lockpinstree-sitter-language-pack1.5.0, andpackagingarrives with pytest.Changes:
packages/darnit-baseline/pyproject.toml: captree-sitter-language-packat<1.6.3.packages/darnit/pyproject.toml: addpackaging>=23.0.uv.lock: the two specifier lines only. Locked versions are unchanged.Closes #441.
Related: #268 (support for 1.8 and newer).
Type of Change
Framework Changes Checklist
docs/architecture/framework-design.md) if behavior changed (dependency metadata only, no behavior change)uv run python scripts/validate_sync.py --verboseand it passesTesting
uv run pytest tests/ -v): 5138 passed, 26 skipped (same as main)uv run ruff check .)Each release of
tree-sitter-language-packfrom 1.5.0 to 1.8.1, installed on its own withtree-sitter0.26.0 on RHEL 10.2 (x86_64, Python 3.12), parsing a one-line Python snippet:ModuleNotFoundError: No module named 'tree_sitter_language_pack'The documented install, into an empty tool directory, then
darnit audit --framework openssf-baseline --tags level=1on a one-file repository:AuthorityViolationtracebackpackagingI saw 1.6.3 fail on Linux x86_64 with Python 3.12. @mlieberman85 reproduced it on macOS with Python 3.14, so it is not Linux-only.
AI assistance
Claude Fable 5.1 diagnosed both causes with me, wrote the two dependency changes. I ran every command and checked the results myself. The commit carries an
Assisted-by: Claude:claude-fable-5-1.Additional Notes
ImportError, which pointed at the wrong cause both times. Including the original exception text in the message would help. Not changed here.<1.6.3and not!=1.6.3: every version it allows has been tested. Whichever you prefer.