Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
30 changes: 19 additions & 11 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -1,31 +1,39 @@
version: 2
updates:
# Экосистема uv покрывает и pyproject.toml, и uv.lock. Отдельный блок pip на
# том же каталоге давал бы вторую пачку PR на те же зависимости.
- package-ecosystem: "uv"
directory: "/"
schedule:
interval: "monthly"
open-pull-requests-limit: 1
labels: ["dependencies", "automated"]
commit-message:
prefix: "chore"
groups:
all-uv-dependencies:
patterns:
- "*"
uv-all:
patterns: ["*"]

- package-ecosystem: "docker"
- package-ecosystem: "github-actions"
directory: "/"
schedule:
interval: "monthly"
open-pull-requests-limit: 1
labels: ["dependencies", "automated"]
commit-message:
prefix: "chore"
groups:
all-docker-dependencies:
patterns:
- "*"
github-actions-all:
patterns: ["*"]

- package-ecosystem: "github-actions"
- package-ecosystem: "docker"
directory: "/"
schedule:
interval: "monthly"
open-pull-requests-limit: 1
labels: ["dependencies", "automated"]
commit-message:
prefix: "chore"
groups:
all-github-actions-dependencies:
patterns:
- "*"
docker-all:
patterns: ["*"]
24 changes: 24 additions & 0 deletions .github/workflows/pr-title.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
name: PR Title

# Заголовок PR обязан быть conventional commit: при squash-мерже он становится
# сообщением коммита, а по нему release-please определяет, какой разряд версии
# поднять. Проверка отдельных коммитов ветки намеренно не делается, чтобы не
# мешать работе внутри PR.
on:
pull_request_target:
types:
- opened
- edited
- synchronize
- reopened

permissions:
pull-requests: read

jobs:
lint:
runs-on: ubuntu-latest
steps:
- uses: amannn/action-semantic-pull-request@v6
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
23 changes: 11 additions & 12 deletions .github/workflows/python-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,20 +15,19 @@ jobs:
steps:
- uses: actions/checkout@v7

- name: Set up Python
uses: actions/setup-python@v7
with:
python-version: "3.13"

- name: Install uv
uses: astral-sh/setup-uv@v7

- name: Install dependencies
run: uv sync

- name: Lint
# setup-python не нужен: версию питона держит .python-version, и uv сам
# ставит её при первом `uv sync`. Единый источник версии, поэтому раннер
# и образ кита не могут разойтись.
- uses: astral-sh/setup-uv@v10.0.0

- name: Install
run: make install
- name: Run linter
run: make lint

# Тестов у примера нет: каждый шаг курса это отдельная ветка-снимок
# приложения, а не покрытый тестами проект. Поэтому в CI только линтер.

deploy:
needs: build
runs-on: ubuntu-latest
Expand Down
1 change: 1 addition & 0 deletions .python-version
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
3.14
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ ENV UV_COMPILE_BYTECODE=1 \

WORKDIR /app

COPY pyproject.toml uv.lock ./
COPY pyproject.toml uv.lock .python-version ./

RUN uv sync --frozen --no-dev --no-install-project

Expand Down
5 changes: 1 addition & 4 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,7 @@ lint:
uv run ruff check .
uv run ruff format --check .

test:
uv run pytest -vv tests

check: test lint
check: install lint

run:
uv run flask --app example --debug run --host 0.0.0.0 --port $(PORT)
Expand Down
5 changes: 1 addition & 4 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ version = "0.1.0"
description = "A simple Flask app"
readme = "README.md"
license = { text = "ISC" }
requires-python = ">=3.10"
requires-python = ">=3.14"
dependencies = [
"flask>=3.1.1",
"gunicorn>=23.0.0",
Expand All @@ -31,8 +31,5 @@ exclude = [
[tool.ruff.lint]
select = ["E", "F", "I"]

[tool.ruff.lint.per-file-ignores]
"tests/*.py" = ["S101"]

[tool.ruff.format]
quote-style = "double"
179 changes: 1 addition & 178 deletions uv.lock

Large diffs are not rendered by default.