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
38 changes: 2 additions & 36 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
---
version: 2
updates:
# === GitHub Actions ===
- package-ecosystem: github-actions
directory: /
schedule:
Expand All @@ -14,46 +13,13 @@ updates:
actions-major:
patterns: ["*"]
update-types: [major]
# === Python dev (pip) ===
- package-ecosystem: pip
directory: /
schedule:
interval: weekly
labels: [dependencies, automated, dev]
groups:
pip-dev-minor-patch:
patterns:
- pytest*
- flake8*
- black
- isort
- mypy*
- coverage*
- tox*
- ruff
- pylint*
- bandit
- pre-commit
- sphinx*
- mkdocs*
update-types: [minor, patch]
# === Python runtime (pip) ===
- package-ecosystem: pip
directory: /
schedule:
interval: weekly
labels: [dependencies, automated, runtime]
groups:
pip-runtime-minor-patch:
patterns: ["*"]
update-types: [minor, patch]
# === Python (uv) ===

- package-ecosystem: uv
directory: /
schedule:
interval: weekly
labels: [dependencies, automated, uv]
# === Docker ===

- package-ecosystem: docker
directory: /
schedule:
Expand Down
14 changes: 10 additions & 4 deletions .github/workflows/python-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,17 @@ jobs:

- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: "3.12"

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

- name: Install dependencies
run: uv sync

- name: Setup project
run: |
pip install poetry
make install
- name: Lint
run: make lint

deploy:
needs: build
Expand Down
9 changes: 5 additions & 4 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -6,15 +6,16 @@ RUN apt-get update && apt-get install -yqq \
sudo \
curl

RUN pip install poetry
COPY --from=ghcr.io/astral-sh/uv:latest /uv /uvx /usr/local/bin/

ENV POETRY_VIRTUALENVS_IN_PROJECT=true
ENV UV_COMPILE_BYTECODE=1 \
UV_LINK_MODE=copy

WORKDIR /app

COPY pyproject.toml .
COPY pyproject.toml uv.lock ./

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

COPY . .

Expand Down
11 changes: 6 additions & 5 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,21 +1,22 @@
PORT ?= 8000

install:
poetry install
uv sync

lint:
poetry run flake8
uv run ruff check .
uv run ruff format --check .

test:
poetry run pytest -vv tests
uv run pytest -vv tests

check: test lint

run:
poetry run flask --app example --debug run --host 0.0.0.0 --port $(PORT)
uv run flask --app example --debug run --host 0.0.0.0 --port $(PORT)

prod:
poetry run gunicorn --workers=4 --bind 0.0.0.0:$(PORT) example:app --log-file -
uv run gunicorn --workers=4 --bind 0.0.0.0:$(PORT) example:app --log-file -

compose-production-run:
docker compose -p python_page_analyzer_ru-production down
Expand Down
337 changes: 0 additions & 337 deletions poetry.lock

This file was deleted.

45 changes: 31 additions & 14 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,21 +1,38 @@
[tool.poetry]
[project]
name = "python-flask-example"
version = "0.1.0"
description = "A simple Flask app"
authors = ["Hexlet Team <info@hexlet.io>"]
license = "ISC"
readme = "README.md"
package-mode = false
license = { text = "ISC" }
requires-python = ">=3.10"
dependencies = [
"flask>=3.1.1",
"gunicorn>=23.0.0",
"psycopg2-binary>=2.9.10",
]

[tool.poetry.dependencies]
python = "^3.10"
Flask = "^3.0.3"
gunicorn = "^23.0.0"
psycopg2-binary = "^2.9.9"
[dependency-groups]
dev = [
"pytest>=8.3.5",
"ruff>=0.11.0",
]

[tool.poetry.group.dev.dependencies]
flake8 = "^7.1.1"
[tool.ruff]
line-length = 80
exclude = [
".git",
"__pycache__",
".venv",
".eggs",
"*.egg",
".vscode",
]

[build-system]
requires = ["poetry-core"]
build-backend = "poetry.core.masonry.api"
[tool.ruff.lint]
select = ["E", "F", "I"]

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

[tool.ruff.format]
quote-style = "double"
68 changes: 0 additions & 68 deletions setup.cfg

This file was deleted.

Loading
Loading