Commit Graph
1 Commits
Author SHA1 Message Date
2892214881 fix(packaging): use direct CLI module entry point (#2665)
## Description

Corrects the packaged `headroom` console-script entry point so it loads
the concrete Click command from `headroom.cli.main:main` instead of
relying on the package-level `headroom.cli:main` re-export.

## Type of Change

- [x] Bug fix (non-breaking change that fixes an issue)
- [ ] New feature (non-breaking change that adds functionality)
- [ ] Breaking change (fix or feature that would cause existing
functionality to change)
- [ ] Documentation update
- [ ] Performance improvement
- [ ] Code refactoring (no functional changes)

## Changes Made

- Updated `[project.scripts] headroom` in `pyproject.toml` from
`headroom.cli:main` to `headroom.cli.main:main`.

## Testing

- [x] Unit tests pass (`pytest`)
- [ ] Linting passes (`ruff check .`) - not needed for this
metadata-only packaging target change
- [ ] Type checking passes (`mypy headroom`) - not needed for this
metadata-only packaging target change
- [ ] New tests added for new functionality - not applicable; this
points the existing console script at the existing CLI command
- [x] Manual testing performed

### Test Output

```text
.\.venv\Scripts\python.exe -c "from importlib.metadata import EntryPoint; ep=EntryPoint(name='headroom', value='headroom.cli.main:main', group='console_scripts'); obj=ep.load(); import click; assert isinstance(obj, click.core.Command); print(obj.name)"
main

.\.venv\Scripts\python.exe -m headroom.cli --help
# exited successfully

.\.venv\Scripts\python.exe -m pytest tests/test_cli/test_main_help_version.py -q
5 passed
```

## Real Behavior Proof

- Environment: Windows checkout using the repository `.venv`.
- Exact command / steps: Loaded the proposed console-script entry point
with `importlib.metadata.EntryPoint`, verified it resolves to a Click
command, checked `python -m headroom.cli --help`, and ran the focused
CLI help/version tests.
- Observed result: `headroom.cli.main:main` resolves successfully to the
CLI command, module help still works, and the focused CLI tests pass.
- Not tested: rebuilding and installing a wheel from this branch; GitHub
package checks have not run because only governance checks are currently
present on the PR.

## Review Readiness

- [x] I have performed a self-review
- [x] This PR is ready for human review

## Checklist

- [x] My code follows the project's style guidelines
- [x] I have performed a self-review of my code
- [ ] I have commented my code, particularly in hard-to-understand areas
- not applicable for this one-line entry-point change
- [ ] I have made corresponding changes to the documentation - not
applicable; user-facing CLI behavior is unchanged
- [x] My changes generate no new warnings
- [ ] I have added tests that prove my fix is effective or that my
feature works - existing CLI tests cover the command surface
- [x] New and existing relevant tests pass locally with my changes
- [x] I did **not** edit `CHANGELOG.md`

## Screenshots (if applicable)

N/A - packaging entry-point change only.

## Additional Notes

This PR changes only the console-script target in `pyproject.toml`; it
does not change CLI behavior or command implementation.
<!-- devin-review-badge-begin -->

---

<a href="https://app.devin.ai/review/headroomlabs-ai/headroom/pull/2665"
target="_blank"><picture><source media="(prefers-color-scheme: dark)"
srcset="https://static.devin.ai/assets/gh-devin-review-dark.svg?v=4"><img
src="https://static.devin.ai/assets/gh-devin-review-light.svg?v=4"
alt="Devin Review"></picture></a>
<!-- devin-review-badge-end -->

---------

Co-authored-by: JD Davis <mxjerrett@gmail.com>
Co-authored-by: jd <jd@headroomlabs.ai>
Co-authored-by: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
2026-11-04 08:27:36 -06:00