File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 3131 - repo : https://github.com/astral-sh/ruff-pre-commit
3232 rev : v0.12.4
3333 hooks :
34- - id : ruff
34+ - id : ruff-check
3535 types_or : [python, pyi, jupyter]
3636 args : [--fix, --show-fixes, --exit-non-zero-on-fix]
3737 - id : ruff-format
4848 - id : prettier
4949 types_or : [markdown, yaml]
5050 - repo : https://github.com/astral-sh/uv-pre-commit
51- # uv version.
5251 rev : 0.8.0
5352 hooks :
54- # Update the uv lockfile
5553 - id : uv-lock
Original file line number Diff line number Diff line change @@ -6,33 +6,34 @@ DOCKER_IMG_NAME=ghcr.io/komorebi-ai/python-template
66DOCKER_CONTAINER =template
77GH_USER =GITHUB_USERNAME
88GH_TOKEN_FILE =GITHUB_TOKEN_PATH
9+ RUN =uv run
910
1011# Install uv, pre-commit hooks and dependencies
11- # Note that `uv run ` has an implicit `uv sync`, since it will (if necessary):
12+ # Note that `$(RUN) ` has an implicit `uv sync`, since it will (if necessary):
1213# - Download an install Python
1314# - Create a virtual environment
1415# - Update `uv.lock`
1516# - Sync the virtual env, installing and removing dependencies as required
1617install :
17- curl -LsSf https://astral.sh/uv/install.sh | sh
18- uv run pre-commit install
18+ @command -v uv && echo " uv already installed " || curl -LsSf https://astral.sh/uv/install.sh | sh
19+ $( RUN ) pre-commit install
1920
2021hooks :
21- uv run pre-commit run --all-files
22+ $( RUN ) pre-commit run --all-files
2223
2324hooks-update :
24- uv run pre-commit autoupdate
25+ $( RUN ) pre-commit autoupdate
2526
2627# Specific packages can be upgrade with `--upgrade-package PKG`
2728upgrade :
2829 uv lock --upgrade
2930
3031ruff :
31- uv run ruff format .
32- uv run ruff check --fix --show-fixes .
32+ $( RUN ) ruff format .
33+ $( RUN ) ruff check --fix --show-fixes .
3334
3435test :
35- uv run pytest
36+ $( RUN ) pytest
3637
3738test-api :
3839 uvx --from httpie http GET localhost:6000
You can’t perform that action at this time.
0 commit comments