Adopt mise for development workflows
- Lock Python and uv versions with mise - Add unified sync, app, test, lint, format, and typecheck tasks - Update development documentation and strengthen type handling
This commit is contained in:
parent
d04ab6feaf
commit
780d9c12fe
19 changed files with 216 additions and 901 deletions
|
|
@ -9,17 +9,18 @@ bugs or coordinate consequential changes.
|
|||
|
||||
## Development setup
|
||||
|
||||
The project requires Python 3.13 or newer and
|
||||
[uv](https://docs.astral.sh/uv/):
|
||||
The project uses [mise](https://mise.jdx.dev/) to install its locked Python and
|
||||
uv versions and to provide its development tasks:
|
||||
|
||||
```bash
|
||||
git clone https://git.s1q.dev/phg/hosts.git
|
||||
cd hosts
|
||||
uv sync
|
||||
uv run hosts
|
||||
mise install
|
||||
mise run sync
|
||||
mise run app
|
||||
```
|
||||
|
||||
`uv run hosts` starts the real application and reads `/etc/hosts`. Stay in
|
||||
`mise run app` starts the real application and reads `/etc/hosts`. Stay in
|
||||
Read-only Mode unless you deliberately intend to exercise privileged behavior
|
||||
on your machine. Automated tests must use mocks and temporary files instead.
|
||||
|
||||
|
|
@ -80,23 +81,21 @@ Treat any test capable of touching the real system file as a defect.
|
|||
Run the narrowest relevant test while developing. Examples:
|
||||
|
||||
```bash
|
||||
uv run pytest tests/test_parser.py
|
||||
uv run pytest tests/test_manager.py
|
||||
uv run pytest tests/test_main.py
|
||||
mise run test -- tests/test_parser.py
|
||||
mise run test -- tests/test_manager.py
|
||||
mise run test -- tests/test_main.py
|
||||
```
|
||||
|
||||
Before handing off any change, run the complete validation suite:
|
||||
|
||||
```bash
|
||||
uv run pytest
|
||||
uv run ruff check .
|
||||
uv run ruff format --check .
|
||||
mise run check
|
||||
```
|
||||
|
||||
Apply formatting with:
|
||||
|
||||
```bash
|
||||
uv run ruff format .
|
||||
mise run format
|
||||
```
|
||||
|
||||
Add or update tests for changed behavior. Test user-reachable workflows at the
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue