Skip to content

Commit 01e2c36

Browse files
committed
✨ feat!: replace duties.py with mise and add settings/config support
- use Mise instead of duty - add support for Pydantic Settings and Doppler
1 parent f9a1fde commit 01e2c36

20 files changed

Lines changed: 930 additions & 1774 deletions

.gitignore

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -174,3 +174,7 @@ cython_debug/
174174

175175
# PyPI configuration file
176176
.pypirc
177+
178+
# Claude
179+
CLAUDE.local.md
180+
.claude

README.md

Lines changed: 41 additions & 46 deletions
Original file line numberDiff line numberDiff line change
@@ -21,66 +21,61 @@ A modern, batteries‑included [Copier](https://github.com/copier-org/copier) te
2121
Effortlessly generate or update projects with one command.
2222

2323
- **Task runner integration**:
24-
Project tasks are organized using [duty](https://github.com/pawamoy/duty) and exposed via a [Makefile](https://github.com/bassemkaroui/python-template-uv/blob/main/template/Makefile.jinja) for easy command-line usage.
25-
Simply run tasks with `make <task>` (e.g. `make check`, `make docs`).
24+
Project tasks are defined in a [mise.toml](https://mise.jdx.dev/) file.
25+
The [Makefile](https://github.com/bassemkaroui/python-template-uv/blob/main/template/Makefile.jinja) is a simple wrapper that proxies commands to `mise run` for convenience.
26+
Run tasks with `make <task>` (e.g. `make check-all`, `make docs-serve`) or directly with `mise run <task>`.
2627

2728
- **Quality & standards**
28-
29-
- **Formatting** and **Linting**: [Ruff](https://github.com/astral-sh/ruff)`make format` & `make check-quality`
30-
- **Type checking**: [Mypy](https://github.com/python/mypy)`make check-types`
31-
- **Pre-commit hooks**: [pre-commit](https://pre-commit.com/)
29+
- **Formatting** and **Linting**: [Ruff](https://github.com/astral-sh/ruff)`make format` & `make check-quality`
30+
- **Type checking**: [Mypy](https://github.com/python/mypy)`make check-types`
31+
- **Pre-commit hooks**: [pre-commit](https://pre-commit.com/)
3232

3333
- **Testing & coverage**
34-
35-
- [**pytest**](https://github.com/pytest-dev/pytest)`make test`
36-
- [**Coverage**](https://github.com/nedbat/coveragepy) (text, HTML, XML) ➜ `make coverage`
37-
- Compatibility testing for multiple versions of Python with [**Tox**](https://github.com/tox-dev/tox) and its plugin [tox-uv](https://github.com/tox-dev/tox-uv)`make tox`
34+
- [**pytest**](https://github.com/pytest-dev/pytest)`make test`
35+
- [**Coverage**](https://github.com/nedbat/coveragepy) (text, HTML, XML) ➜ `make coverage`
36+
- Compatibility testing for multiple versions of Python with [**Tox**](https://github.com/tox-dev/tox) and its plugin [tox-uv](https://github.com/tox-dev/tox-uv)`make tox`
3837

3938
- **Documentation**
40-
41-
- [**MkDocs**](https://github.com/mkdocs/mkdocs) with [mkdocs-material](https://github.com/squidfunk/mkdocs-material) theme
42-
- Live server: `make docs` (serves on localhost:8080)
43-
- Deploy to GitHub Pages: `make docs-deploy`
39+
- [**MkDocs**](https://github.com/mkdocs/mkdocs) with [mkdocs-material](https://github.com/squidfunk/mkdocs-material) theme
40+
- Live server: `make docs-serve` (serves on localhost:8080)
41+
- Deploy to GitHub Pages: `make docs-deploy`
4442

4543
- **Release & changelog**
46-
47-
- [Conventional Commits](https://www.conventionalcommits.org/) + [Commitizen](https://github.com/commitizen-tools/commitizen) + [gitmoji](https://github.com/ljnsn/cz-conventional-gitmoji)
48-
- Automated `CHANGELOG.md` updates
49-
- Release new versions ➜ `make release`
44+
- [Conventional Commits](https://www.conventionalcommits.org/) + [Commitizen](https://github.com/commitizen-tools/commitizen) + [gitmoji](https://github.com/ljnsn/cz-conventional-gitmoji)
45+
- Automated `CHANGELOG.md` updates
46+
- Release new versions ➜ `make release`
5047

5148
- **Docker & Docker Compose**
49+
- Generate `Dockerfile` + `compose.yml` for local development and deployment (GPU support)
50+
- Docker targets: `make docker-build`, `make docker-start`, `make docker-stop`
5251

53-
- Generate `Dockerfile` + `compose.yml` for local development and deployment (GPU support)
54-
- Docker targets: `make docker-build`, `make docker-start`, `make docker-stop`
55-
56-
- **Optional tooling**
57-
58-
- Typer CLI scaffold
59-
- Strict typing
60-
- Run tests with parallel execution via pytest-xdist
61-
- Preconfigured dependency categories (ML, data, web, etc.)
52+
- **Optional features**
53+
- Typer CLI scaffold
54+
- Strict typing (py.typed marker for type checking)
55+
- Run tests with parallel execution via pytest-xdist
56+
- Settings & configuration with [Pydantic Settings](https://docs.pydantic.dev/latest/concepts/pydantic_settings/) + [Doppler](https://www.doppler.com/) integration for secure secret management
6257

6358
- **CI/CD Workflows**
6459

65-
This template includes GitHub Actions workflows for continuous integration, testing, and release automation:
66-
67-
- **PR Commenting** (`pr-thank-you.yaml`): Posts a fun GIPHY comment on new pull requests using [`docker-action-pr-giphy-comment`](https://github.com/bassemkaroui/docker-action-pr-giphy-comment)
60+
This template includes GitHub Actions workflows for continuous integration, testing, and release automation:
61+
- **PR Commenting** (`pr-thank-you.yaml`): Posts a fun GIPHY comment on new pull requests using [`docker-action-pr-giphy-comment`](https://github.com/bassemkaroui/docker-action-pr-giphy-comment)
6862

69-
- **CI/CD Pipeline** (`main.yaml.jinja`):
70-
- **Checks**: Linting (Ruff), type checking (Mypy), documentation build.
71-
- **Tests**: Runs `pytest` across supported Python versions using a matrix strategy.
72-
- **Releases**: Automatically publishes releases when a Git tag is pushed.
73-
- **Docs Deployment**: Deploys MkDocs documentation to GitHub Pages.
74-
- **Package Publishing** (optional): Publishes the package to PyPI if `publish_to_pypi` is enabled and `PYPI_TOKEN` is set.
63+
- **CI/CD Pipeline** (`main.yaml.jinja`):
64+
- **Checks**: Linting (Ruff), type checking (Mypy), documentation build.
65+
- **Tests**: Runs `pytest` across supported Python versions using a matrix strategy.
66+
- **Releases**: Automatically publishes releases when a Git tag is pushed.
67+
- **Docs Deployment**: Deploys MkDocs documentation to GitHub Pages.
68+
- **Package Publishing** (optional): Publishes the package to PyPI if `publish_to_pypi` is enabled and `PYPI_TOKEN` is set.
7569

76-
These workflows are generated into `.github/workflows/` in the scaffolded project. You can customize them further as needed.
70+
These workflows are generated into `.github/workflows/` in the scaffolded project. You can customize them further as needed.
7771

7872
## 🛠 Prerequisites
7973

8074
- **Python** ≥ 3.10
8175
- **Copier** ≥ 9.10.2
8276
- **copier-templates-extensions** ≥ 0.3.2
8377
- **uv** (if not installed check [uv installation guide](https://docs.astral.sh/uv/getting-started/installation/))
78+
- **mise** (if not installed check [mise installation guide](https://mise.jdx.dev/getting-started.html))
8479

8580
## 🎉 Quickstart
8681

@@ -111,7 +106,7 @@ make setup-dev
111106
make setup-cli
112107

113108
# 5. Run quality & tests
114-
make check # runs all checks: lint, types, docs build, API, etc.
109+
make check-all # runs all checks: lint, types, docs build, API, etc.
115110
```
116111

117112
**Stay up to date**
@@ -125,25 +120,23 @@ uvx copier update --trust --exclude src/ --exclude tests/ .
125120
> [!WARNING]
126121
> To be able to [update your project](https://copier.readthedocs.io/en/stable/updating/), do not delete or manually modify the generated `.copier-answers.yml` file.
127122
128-
## 📋 Available Duties
123+
## 📋 Available Tasks
129124

130-
All tasks are defined in `duties.py` and exposed through `make`. Common duties include:
125+
All tasks are defined in `mise.toml` and exposed through `make`. Common tasks include:
131126

132127
```
133128
build Build source and wheel distributions.
134129
check Check it all!
135-
check-api Check for API breaking changes.
136-
check-docs Check if the documentation builds correctly.
130+
docs-check Check if the documentation builds correctly.
137131
check-quality Run linters and format checks.
138132
check-types Run static type checks.
139133
clean Delete build artifacts.
140134
clean-cache Remove cache files.
141135
coverage Generate coverage reports (text, HTML, XML).
142136
docker-build Build Docker images.
143-
docker-exec-* Dockerized executions of checks, tests, docs, coverage.
144137
docker-start Start Docker Compose services.
145138
docker-stop Stop and remove Docker Compose services.
146-
docs Serve the documentation (localhost:8080).
139+
docs-serve Serve the documentation (localhost:8080).
147140
docs-deploy Publish docs to GitHub Pages.
148141
format Auto-format code (Ruff).
149142
publish Upload distributions to PyPI.
@@ -155,7 +148,7 @@ test Run tests with pytest.
155148
tox Run tests across multiple Python versions.
156149
```
157150

158-
For the full list and details, see [duties.py](https://github.com/bassemkaroui/python-template-uv/blob/main/template/duties.py.jinja).
151+
For the full list and details, see [mise.toml](https://github.com/bassemkaroui/python-template-uv/blob/main/template/mise.toml.jinja).
159152

160153
## 🔧 Template Variables
161154

@@ -172,7 +165,9 @@ When running `copier`, you’ll be prompted for:
172165
| `python_version` | Default Python interpreter for development | `3.12` |
173166
| `min_python_version` | Minimum supported Python version | `3.10` |
174167
| `with_typer_cli` | Include a Typer CLI scaffold? | `false` |
175-
| `with_strict_typing` | Enable strict typing enforcement? | `false` |
168+
| `with_strict_typing` | Enable strict typing (py.typed marker)? | `false` |
169+
| `with_settings` | Include Pydantic Settings for configuration? | `true` |
170+
| `with_doppler` | Add Doppler integration for secrets management? | `false` |
176171
| `tox` | Include Tox configuration? | `true` |
177172
| `coverage_threshold` | Minimum test coverage % | `100` |
178173
| `with_conventional_commits` | Enforce Conventional Commits? | `true` |

0 commit comments

Comments
 (0)