Build a practical Python starter template#1
Conversation
Start from a small src-layout package with a Click entry point and tests.
Keep setup, formatting, checks, and lockfile management on a small predictable surface.
Run the quality gate in CI and validate release artifacts with small focused workflows.
Explain the default commands and add a compact PR template for review hygiene.
Make the README sound more like a real starter and less like a template pitch.
Keep the README header a little warmer without making the project feel noisy.
Show a minimal subcommand pattern without turning the template into a demo app.
There was a problem hiding this comment.
Pull request overview
Converts the repository into a small, strict Python starter template using uv, a src/ layout, Click-based CLI scaffolding, and a consistent local/CI workflow baseline.
Changes:
- Adds a minimal Click CLI (
python-template) with a default “tasks” output and an examplehellosubcommand. - Introduces strict tooling defaults (Ruff, Pyright strict, pytest + coverage) plus a Makefile to standardize common workflows.
- Adds GitHub Actions workflows (CI, build smoke test, release artifacts) and supporting repo hygiene files (PR template, pre-commit config, lockfile).
Reviewed changes
Copilot reviewed 14 out of 16 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
uv.lock |
Locks runtime/dev dependencies for uv-based installs. |
pyproject.toml |
Defines packaging (Hatchling), dependencies, scripts, and strict tool configuration (Ruff/Pyright/pytest/coverage). |
src/python_template/__main__.py |
Implements the Click CLI entry point and example command. |
src/python_template/__init__.py |
Exposes the public package surface (__version__). |
src/python_template/__about__.py |
Centralizes version metadata for Hatch dynamic versioning. |
tests/test_cli.py |
Adds regression tests for python -m python_template and version export. |
Makefile |
Provides standard local tasks (setup, format/lint/typecheck/test/build, lock/update). |
README.md |
Documents template goals, quickstart, commands, and layout. |
.github/workflows/ci.yml |
Runs the quality gate across Python 3.11–3.13 with frozen uv installs. |
.github/workflows/build.yml |
Builds artifacts and smoke-tests the wheel installation. |
.github/workflows/release.yml |
Builds and uploads artifacts on version tags. |
.pre-commit-config.yaml |
Adds local Ruff format/lint hooks via uv run. |
.gitignore |
Adds standard Python/tooling ignores plus local automation state. |
.python-version |
Pins a default local Python version for tooling/workflows using python-version-file. |
LICENSE |
Adds MIT license text. |
.github/pull_request_template.md |
Adds a lightweight PR template for consistent submissions. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 95c7666879
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 14 out of 16 changed files in this pull request and generated no new comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
The quickstart now uses uv-managed module execution so the README works from a fresh checkout without requiring manual virtualenv activation. This keeps the documented path aligned with the project's src layout and setup flow. Constraint: Quickstart steps should work without requiring manual venv activation Rejected: Add a separate venv activation step | more shell-specific and easier to skip Confidence: high Scope-risk: narrow Reversibility: clean Directive: Keep README command examples aligned with the uv-managed workflow unless setup semantics change Tested: uv run python -m python_template --help; uv run python -m python_template hello; python -m python_template --help (fails as expected without uv run) Not-tested: Full CI suite (docs-only change)
9909205 to
e6a58b9
Compare
Summary
uv, Click, strict checks, and asrc/layouthellosubcommand as an example CLI patternTesting
make checkmake buildChecklist
Notes