Skip to content

Commit 7120a15

Browse files
temrjanclaude
andauthored
fix: update template CI to use uv and ruff instead of poetry and black (#246)
Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
1 parent 621eb59 commit 7120a15

2 files changed

Lines changed: 16 additions & 17 deletions

File tree

fastapi_template/template/{{cookiecutter.project_name}}/.github/workflows/tests.yml

Lines changed: 9 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -7,37 +7,35 @@ jobs:
77
strategy:
88
matrix:
99
cmd:
10-
- black
10+
- ruff-format
1111
- ruff
1212
- mypy
1313
runs-on: ubuntu-latest
1414
steps:
1515
- uses: actions/checkout@v4
16-
- name: Install poetry
17-
run: pipx install poetry
1816
- name: Set up Python
19-
uses: actions/setup-python@v5
17+
uses: actions/setup-python@v6
2018
with:
21-
python-version: '3.11'
22-
cache: 'poetry'
19+
python-version: '3.12'
20+
- name: Set up UV
21+
uses: astral-sh/setup-uv@v6
2322
- name: Install deps
24-
run: poetry install
23+
run: uv sync
2524
- name: Run lint check
26-
run: poetry run pre-commit run -a {{ '${{' }} matrix.cmd {{ '}}' }}
25+
run: uv run pre-commit run -a {{ '${{' }} matrix.cmd {{ '}}' }}
2726
pytest:
2827
runs-on: ubuntu-latest
2928
steps:
3029
- uses: actions/checkout@v4
3130
- name: Create .env
3231
run: touch .env
3332
- name: Set up Python
34-
uses: actions/setup-python@v5
33+
uses: actions/setup-python@v6
3534
with:
36-
python-version: '3.11'
35+
python-version: '3.12'
3736
- name: Update docker-compose
3837
uses: KengoTODA/actions-setup-docker-compose@v1
3938
with:
4039
version: "2.28.0"
4140
- name: run tests
4241
run: docker-compose run --rm api pytest -vv
43-

fastapi_template/template/{{cookiecutter.project_name}}/alembic.ini

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -7,14 +7,15 @@ output_encoding = utf-8
77

88

99
[post_write_hooks]
10-
hooks = black,ruff
10+
hooks = ruff_format,ruff_check
1111

12-
black.type = console_scripts
13-
black.entrypoint = black
12+
ruff_format.type = exec
13+
ruff_format.executable = ruff
14+
ruff_format.options = format REVISION_SCRIPT_FILENAME
1415

15-
ruff.type = exec
16-
ruff.executable = ruff
17-
ruff.options = check --fix REVISION_SCRIPT_FILENAME --ignore N999
16+
ruff_check.type = exec
17+
ruff_check.executable = ruff
18+
ruff_check.options = check --fix REVISION_SCRIPT_FILENAME --ignore N999
1819

1920
# Logging configuration
2021
[loggers]

0 commit comments

Comments
 (0)