1.6 KiB
Прочитай CLAUDE.md. Твоя задача — bootstrap проекта для CI:
-
Создай pyproject.toml в корне с секциями:
- [project] name="enduro-trails", version="0.1.0", requires-python=">=3.12"
- [project.optional-dependencies] dev = ["ruff>=0.4.0", "pytest>=8.0", "httpx>=0.27", "pytest-asyncio>=0.23"]
- [tool.ruff] target-version="py312", line-length=120
- [tool.pytest.ini_options] asyncio_mode="auto", testpaths=["tests"]
-
Создай tests/unit/test_health.py: import pytest from httpx import AsyncClient, ASGITransport from src.api.main import app
@pytest.mark.asyncio async def test_health_endpoint(): transport = ASGITransport(app=app) async with AsyncClient(transport=transport, base_url="http://test") as client: resp = await client.get("/api/health") assert resp.status_code == 200 data = resp.json() assert data["status"] == "ok"
-
Создай tests/init.py и tests/unit/init.py (пустые файлы)
-
Обнови .gitea/workflows/ci.yml:
- Используй образ python:3.12 для всех job
- Установка зависимостей: pip install -e ".[dev]"
- lint: ruff check src/
- test: pytest tests/
- build: docker build .
-
Создай ветку feature/bootstrap, закоммить всё, запуш в origin.
Коммит message: "feat: add pyproject.toml, dev dependencies, first unit test" Push в ветку feature/bootstrap (НЕ в main). Git remote использует http://localhost:3000/admin/enduro-trails.git