template instructions added - #5
Conversation
Code Review: python-package-templateReviewer Cursor Composer 2.5 Executive SummaryThis is a small, well-scoped Python package template with clear separation between configuration ( Automated checks (run during review):
Overall: Suitable as a starter template. Findings below are mostly maintainability, consistency, and “next step” improvements rather than blocking defects. Strengths
FindingsMedium — Duplicate
|
| Gap | Notes |
|---|---|
hello -V on subcommand |
Works at runtime (hello-world hello -V); only --version long form is tested in test_cli_hello_version. |
Config validation |
No tests for frozen immutability, invalid types, or optional future fields. |
| Library error paths | No negative tests (e.g., passing invalid config types if API expands). |
| Coverage tooling | README claims “comprehensive” coverage; no pytest-cov or coverage threshold in pyproject.toml. |
These are acceptable for a minimal template but worth calling out for consumers who copy the repo verbatim.
Low — README vs AGENTS CLI invocation
- README:
uv run hello-world hello - AGENTS.md:
uv run python -m python_package_template.cli hello
Both work; aligning on one canonical invocation reduces confusion for new contributors.
Low — No python -m python_package_template entry
There is no __main__.py. Module execution goes through python_package_template.cli. Adding __main__.py that delegates to app() would match common package conventions (python -m python_package_template).
Low — pyproject.toml license metadata
license = {text = "MIT"} is valid but older style. PEP 621 now prefers license = "MIT" (SPDX) where tooling supports it. Cosmetic for a template.
Nit — main() callback body is pass
The Typer callback exists only to attach --version. An ellipsis (...) or a one-line comment is slightly clearer than pass, but ruff/mypy are fine with current code.
Nit — REVIEW.md is gitignored
.gitignore lists REVIEW.md first. Agent instructions direct reviews into this file, so findings stay local unless force-added. Fine for ephemeral agent output; document if you want reviews committed in forks.
Security & Reliability
- Input surface: CLI
nameis a short string passed to an f-string greeting. No injection risk beyond odd output for empty or unusual names. - Dependencies: Pinned ranges in
pyproject.tomlwith lockfile (uv.lock). Template consumers should keepuv lock/ dependabot habits. - Ruff
Srules: Enabled globally; tests correctly allowS101(assert).
No issues requiring immediate action for this codebase size.
Alignment with AGENTS.md
| Directive | Status |
|---|---|
| Type hints on all signatures | Met |
| Google docstrings on public APIs | Met |
logging not print() in library code |
Met (typer.echo in CLI is appropriate) |
| Tests for behavior changes | Met for current features |
| Relative paths in code | Met (no hardcoded absolute paths) |
uv sync --dev before work |
Verified during review |
Suggested Priority Order (if improving the template)
- Deduplicate CLI version handling.
- Decide on
namevalidation (constraint + test, or explicit docs). - Add minimal CI workflow.
- Add
test_cli_hello_version_shortforhello -V(one line). - Optional:
__main__.py, SPDX license field,pytest-covin dev group.
Files Reviewed
python_package_template/__init__.pypython_package_template/config.pypython_package_template/hello.pypython_package_template/cli.pytests/test_hello.pytests/__init__.pypyproject.tomlREADME.mdAGENTS.md/AGENTS_MANUAL_CHECKS.md.gitignore
Small change adding additional instructions to README.md