use Codex 5.3 to review template to spec

This commit is contained in:
Jev
2026-02-14 11:47:18 +01:00
parent 1b66fecb9a
commit 46e0ef9de7
16 changed files with 277 additions and 123 deletions

View File

@@ -1,18 +1,18 @@
# Python App Template
A Cookiecutter template for building CLI-first Python applications with uv, Typer, Pydantic, and strict typing.
A Cookiecutter template for building CLI-first Python applications with `uv`, Typer, Pydantic, and strict typing.
## Features
- **CLI-first** architecture with Typer
- **Local-first config** (XDG paths) with env override
- **uv** for fast dependency management and reproducible installs
- **Ruff** for linting/formatting
- **MyPy** with strict typing
- **Pytest** with coverage support
- **Invoke** tasks for common operations
- **py.typed** marker for typed packages
- **Example command** wired from core `commands/` into CLI
- CLI-first architecture with Typer
- Local-first config (XDG paths) with env override
- `uv_build` backend and lockfile-first reproducibility
- Ruff for linting/formatting
- MyPy strict mode
- Pytest with coverage support
- Invoke tasks for common operations
- `py.typed` marker for typed packages
- Example command wired from core `commands/` into CLI
## Quick Start
@@ -31,11 +31,14 @@ A Cookiecutter template for building CLI-first Python applications with uv, Type
cookiecutter /path/to/python-app-template
```
3. The template will prompt for project details and automatically:
- Initialize git repository
- Set up uv environment
- Run initial linting and formatting
- Execute tests to verify setup
3. Post-generation hook runs `uv lock` to create `uv.lock`.
4. Bootstrap the generated project:
```bash
uv sync --frozen --group dev
uv run invoke lint
uv run invoke test
```
## Template Variables
@@ -48,7 +51,8 @@ A Cookiecutter template for building CLI-first Python applications with uv, Type
| `author_name` | Author's full name | "Your Name" |
| `author_email` | Author's email | "your.email@example.com" |
| `version` | Initial version | "0.1.0" |
| `python_version` | Minimum Python version | "3.12" |
Python is fixed to 3.12+ by template policy.
## Generated Project Structure
@@ -57,6 +61,7 @@ your-project/
├── README.md
├── pyproject.toml
├── tasks.py
├── uv.lock
├── src/
│ └── your_package/
│ ├── __init__.py
@@ -81,8 +86,9 @@ your-project/
│ └── logging.py
├── tests/
│ ├── conftest.py
│ ├── test_public.py
── test_internals.py
│ ├── test_cli.py
── test_internals.py
│ └── test_public.py
└── examples/
└── config_init.sh
```
@@ -91,13 +97,13 @@ your-project/
### Setup
```bash
uv sync --group dev
uv sync --frozen --group dev
```
### Code Quality
```bash
uv run ruff check src tests
uv run ruff format src tests
uv run ruff format --check src tests
uv run mypy src
uv run invoke lint
```
@@ -117,14 +123,15 @@ To modify this template:
3. Modify the post-generation hook in `hooks/post_gen_project.py`
4. Test changes:
```bash
cookiecutter . --output-dir /tmp
./test.sh
```
## Requirements
- Python 3.12+
- uv (automatically installed during generation)
- git (for version control)
- `uv`
- `cruft` or `cookiecutter`
- `git` (optional, for your project workflow)
## License