Skip to content

Commit 7eb1a84

Browse files
committed
chore(ml): configure mise for machine-learning directory
1 parent 6bb47c8 commit 7eb1a84

4 files changed

Lines changed: 97 additions & 36 deletions

File tree

.github/workflows/test.yml

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -607,6 +607,9 @@ jobs:
607607
runs-on: ubuntu-latest
608608
permissions:
609609
contents: read
610+
env:
611+
MISE_CEILING_PATHS: ${{ github.workspace }}
612+
MISE_TRUSTED_CONFIG_PATHS: ${{ github.workspace }}/machine-learning/mise.toml
610613
defaults:
611614
run:
612615
working-directory: ./machine-learning
@@ -621,25 +624,22 @@ jobs:
621624
with:
622625
persist-credentials: false
623626
token: ${{ steps.token.outputs.token }}
624-
- name: Install uv
625-
uses: astral-sh/setup-uv@08807647e7069bb48b6ef5acd8ec9567f424441b # v8.1.0
627+
628+
- name: Setup Mise
629+
uses: immich-app/devtools/actions/use-mise@f16df2948c720c72059633eed723bbf5b3719ae2 # use-mise-action-v1.2.0
626630
with:
627-
python-version: 3.11
631+
working_directory: ./machine-learning
632+
628633
- name: Install dependencies
629-
run: |
630-
uv sync --extra cpu
631-
- name: Lint with ruff
632-
run: |
633-
uv run ruff check --output-format=github immich_ml
634-
- name: Format with ruff
635-
run: |
636-
uv run ruff format --check immich_ml
637-
- name: Run mypy type checking
638-
run: |
639-
uv run mypy --strict immich_ml/
634+
run: mise run install --extra cpu
635+
- name: Lint code
636+
run: mise run lint --output-format=github
637+
- name: Format code
638+
run: mise run format
639+
- name: Run type checking
640+
run: mise run check
640641
- name: Run tests and coverage
641-
run: |
642-
uv run pytest --cov=immich_ml --cov-report term-missing
642+
run: mise run test
643643
github-files-formatting:
644644
name: .github Files Formatting
645645
needs: pre-job

machine-learning/mise.toml

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
[tools]
2+
python = "3.11"
3+
uv = "0.8.15"
4+
5+
[tasks.install]
6+
run = "uv sync --locked"
7+
8+
[tasks.lint]
9+
run = "uv run ruff check immich_ml"
10+
11+
[tasks.test]
12+
run = "uv run pytest --cov=immich_ml --cov-report term-missing"
13+
14+
[tasks.format]
15+
run = "uv run ruff format immich_ml"
16+
17+
[tasks.check]
18+
run = "uv run mypy --strict immich_ml/"

machine-learning/uv.lock

Lines changed: 62 additions & 20 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

mise.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ config_roots = [
1111
"web",
1212
"docs",
1313
".github",
14+
"machine-learning",
1415
]
1516

1617
[tools]

0 commit comments

Comments
 (0)