Upload answers 202 after staging, a queued job in PostgreSQL and a broker confirm; a separate worker publishes the original and a thumbnail with bounded retries. Adds the job and variant tables, the broker service, the worker S3 user, cleanup and reconcile support for staging and variants, the failure stand with broker and worker, bench and driver updates. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
100 lines
3.9 KiB
TOML
100 lines
3.9 KiB
TOML
[project]
|
|
name = "mtusi-messenger"
|
|
version = "0.1.0"
|
|
description = "Lab 2: PostgreSQL storage, sessions and Redis/Valkey"
|
|
requires-python = "==3.12.*"
|
|
|
|
dependencies = [
|
|
"pydantic>=2.6.3,<3.0.0",
|
|
"pydantic-settings>=2.15.0,<3.0.0",
|
|
# 0.137.2+: iter_route_contexts для полного шаблона пути в логах
|
|
"fastapi[all]>=0.137.2,<1.0.0",
|
|
"uvicorn>=0.29.0,<1.0.0",
|
|
"structlog>=24.1.0,<25.0.0",
|
|
# asyncio-extra ставит greenlet: без него асинхронный engine 2.1 не работает
|
|
"sqlalchemy[asyncio]>=2.1.1,<2.2",
|
|
"asyncpg>=0.31.0,<0.32",
|
|
# в основной группе: сервис миграций работает в runtime-образе (--no-dev)
|
|
"alembic>=1.20.0,<2",
|
|
# Argon2id для паролей: bcrypt режет пароль на 72 байтах, lab7 — Argon2id
|
|
"argon2-cffi>=25.1.0,<26",
|
|
# клиент Valkey: протокол тот же, redis.asyncio зрелее valkey-py
|
|
"redis>=8.1,<9",
|
|
# клиент S3 (SeaweedFS), решение 6 design change s3-storage;
|
|
# botocore закреплён узко, обновлять вместе через uv lock
|
|
"aiobotocore>=3.9.2,<4",
|
|
# клиент RabbitMQ (design change async-attachments, решение 5)
|
|
"aio-pika>=10.2.1,<11",
|
|
# thumbnail в процессе worker; импортирует только src/utils/thumbnail.py
|
|
"pillow>=13,<14",
|
|
]
|
|
|
|
[project.optional-dependencies]
|
|
dev = [
|
|
"ruff>=0.11.13,<1.0.0",
|
|
]
|
|
|
|
|
|
[tool.ruff]
|
|
line-length = 79
|
|
target-version = "py312"
|
|
# student-tests: хелперы набора импортируются как модули первого уровня
|
|
src = [".", "student-tests"]
|
|
# публичные проверки skeleton не форматируем и не правим
|
|
extend-exclude = ["tests", "scripts"]
|
|
|
|
[tool.ruff.lint]
|
|
select = ["E", "F", "I", "W505", "COM812", "F401", "B", "C4", "ARG", "UP", "SIM", "Q"]
|
|
ignore = ["E501"]
|
|
|
|
[tool.ruff.format]
|
|
quote-style = "preserve"
|
|
skip-magic-trailing-comma = false
|
|
indent-style = "space"
|
|
|
|
[tool.uv]
|
|
concurrent-downloads = 12 # одновременных HTTP-запросов (по умолчанию 50)
|
|
#concurrent-installs = 6 # распаковка/копирование колёс (по умолчанию зависит от количества ядер процессора)
|
|
#concurrent-builds = 4 # сборка sdist-пакетов из исходников (по умолчанию зависит от количества ядер процессора)
|
|
|
|
[build-system]
|
|
requires = ["hatchling>=1.19.0"]
|
|
build-backend = "hatchling.build"
|
|
|
|
[dependency-groups]
|
|
dev = [
|
|
"openapi-spec-validator==0.7.2",
|
|
"black>=25.12.0",
|
|
"pre-commit>=4.5.0",
|
|
# student-tests: black-box тесты по HTTP (make student_test)
|
|
"pytest>=9.1.1,<10",
|
|
"httpx>=0.28.1,<1",
|
|
"jsonschema>=4.26.0,<5",
|
|
]
|
|
|
|
[tool.pytest.ini_options]
|
|
testpaths = ["student-tests"]
|
|
# каталог с дефисом не пакет: хелперы импортируются как модули
|
|
pythonpath = ["student-tests"]
|
|
# проверки отказов (маркер fault) — только make failure_checks: там
|
|
# pytest -m fault перекрывает этот -m. -rsP: вывод прошедших тестов и
|
|
# причины пропуска (тесты реплик против одного процесса)
|
|
addopts = "-v -rsP --strict-markers -m 'not fault'"
|
|
markers = [
|
|
"spec(capability, scenario): сценарий основного спека, который проверяет тест",
|
|
"fault: проверка отказа хранилища; нужен стенд make failure_checks и его hook",
|
|
]
|
|
|
|
[tool.hatch.build.targets.wheel]
|
|
packages = ["src"]
|
|
|
|
[tool.hatch.metadata]
|
|
allow-direct-references = true
|
|
|
|
|
|
[tool.black]
|
|
line-length = 79
|
|
target-version = ["py312"]
|
|
skip-string-normalization = false
|
|
skip-magic-trailing-comma = false
|