refactor README.md for clarity and conciseness
This commit is contained in:
83
README.md
83
README.md
@@ -1,39 +1,31 @@
|
||||
# Python App Template
|
||||
# Python CLI Template
|
||||
|
||||
A Cookiecutter template for building CLI-first Python applications with `uv`, Typer, Pydantic, and strict typing.
|
||||
A minimal Cookiecutter template for building personal CLI tools with `uv`, Typer, and strict typing.
|
||||
|
||||
## Features
|
||||
|
||||
- CLI-first architecture with Typer
|
||||
- Local-first config (XDG paths) with env override
|
||||
- CLI with Typer
|
||||
- `uv_build` backend and lockfile-first reproducibility
|
||||
- Ruff for linting/formatting
|
||||
- MyPy strict mode
|
||||
- Pytest with coverage support
|
||||
- Pytest with coverage
|
||||
- Invoke tasks for common operations
|
||||
- `py.typed` marker for typed packages
|
||||
- Example command wired from core `commands/` into CLI
|
||||
|
||||
## Quick Start
|
||||
|
||||
1. Install cookiecutter:
|
||||
1. Generate a new project:
|
||||
```bash
|
||||
pipx install cookiecutter
|
||||
```
|
||||
|
||||
2. Generate a new project:
|
||||
```bash
|
||||
cruft create https://gitlab.com/roxautomation/templates/python-app-template
|
||||
cruft create git@git.roxautomation.com:sjev/python-cli-template.git
|
||||
```
|
||||
|
||||
Or locally:
|
||||
```bash
|
||||
cookiecutter /path/to/python-app-template
|
||||
cookiecutter /path/to/python-cli-template
|
||||
```
|
||||
|
||||
3. Post-generation hook runs `uv lock` to create `uv.lock`.
|
||||
2. Post-generation hook runs `uv lock` to create `uv.lock`.
|
||||
|
||||
4. Bootstrap the generated project:
|
||||
3. Bootstrap the generated project:
|
||||
```bash
|
||||
uv sync --frozen --group dev
|
||||
uv run invoke lint
|
||||
@@ -66,52 +58,9 @@ your-project/
|
||||
│ └── your_package/
|
||||
│ ├── __init__.py
|
||||
│ ├── py.typed
|
||||
│ ├── cli/
|
||||
│ │ ├── __init__.py
|
||||
│ │ ├── app.py
|
||||
│ │ ├── common.py
|
||||
│ │ ├── config.py
|
||||
│ │ └── hello.py
|
||||
│ ├── config/
|
||||
│ │ ├── __init__.py
|
||||
│ │ ├── paths.py
|
||||
│ │ └── settings.py
|
||||
│ ├── commands/
|
||||
│ │ ├── __init__.py
|
||||
│ │ └── hello.py
|
||||
│ ├── models/
|
||||
│ │ └── __init__.py
|
||||
│ └── utils/
|
||||
│ ├── __init__.py
|
||||
│ └── logging.py
|
||||
├── tests/
|
||||
│ ├── conftest.py
|
||||
│ ├── test_cli.py
|
||||
│ ├── test_internals.py
|
||||
│ └── test_public.py
|
||||
└── examples/
|
||||
└── config_init.sh
|
||||
```
|
||||
|
||||
## Development Workflow
|
||||
|
||||
### Setup
|
||||
```bash
|
||||
uv sync --frozen --group dev
|
||||
```
|
||||
|
||||
### Code Quality
|
||||
```bash
|
||||
uv run ruff check src tests
|
||||
uv run ruff format --check src tests
|
||||
uv run mypy src
|
||||
uv run invoke lint
|
||||
```
|
||||
|
||||
### Testing
|
||||
```bash
|
||||
uv run pytest
|
||||
uv run invoke test
|
||||
│ └── cli.py
|
||||
└── tests/
|
||||
└── test_cli.py
|
||||
```
|
||||
|
||||
## Template Development
|
||||
@@ -120,8 +69,7 @@ To modify this template:
|
||||
|
||||
1. Edit files in `{{cookiecutter.project_slug}}/`
|
||||
2. Update variables in `cookiecutter.json`
|
||||
3. Modify the post-generation hook in `hooks/post_gen_project.py`
|
||||
4. Test changes:
|
||||
3. Test changes:
|
||||
```bash
|
||||
./test.sh
|
||||
```
|
||||
@@ -131,8 +79,3 @@ To modify this template:
|
||||
- Python 3.12+
|
||||
- `uv`
|
||||
- `cruft` or `cookiecutter`
|
||||
- `git` (optional, for your project workflow)
|
||||
|
||||
## License
|
||||
|
||||
MIT License - see LICENSE file for details.
|
||||
|
||||
Reference in New Issue
Block a user