Files
enduro-trails/pyproject.toml
claude-bot 7d8407a378
All checks were successful
CI / lint (push) Successful in 5s
CI / test (push) Successful in 7s
CI / lint (pull_request) Successful in 4s
CI / test (pull_request) Successful in 7s
CI / build (pull_request) Successful in 2s
CI / build (push) Successful in 18s
fix(ci): hoist imports to satisfy E402 + declare runtime/test deps in pyproject
CI failures на feature/ET-011 были вызваны двумя проблемами:

1. ruff `E402 Module level import not at top of file` × 10 в src/api/main.py:
   - 9 ошибок от ET-008 (GPS_TRACKS_DB_PATH между импортами) +
     1 новая от ET-011 (`from src.api.gps_tracks.endpoint import ...` после
     определения `app`). Перенёс все импорты наверх; константы
     GPS_TRACKS_DB_PATH и GPS_SOURCES_CONFIG_PATH теперь сразу после import-блока,
     а создание router-а остаётся в нижней части файла (зависит от `app`).

2. pyproject.toml не объявлял runtime-deps, которые реально импортируются
   в src/ (defusedxml, pyyaml) и в тестах (lxml). Dockerfile брал их из
   src/api/requirements.txt, но CI jobs `lint`/`test` ставят `.[dev]` —
   поэтому `pytest tests/` падал на ModuleNotFoundError при коллекции
   тестов из ET-008/ET-009/ET-011. Добавил недостающие пины в pyproject
   (defusedxml/pyyaml в основные deps, lxml — только в dev, нужен для
   XSD-валидации в test_gps_tracks_download/_gpx_builder).

Проверено локально в чистом venv после `pip install .[dev]`:
- `ruff check src/` → All checks passed
- `pytest tests/` → 200 passed, 2 deselected

Refs: ET-011

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-06-03 22:48:27 +00:00

45 lines
1007 B
TOML
Raw Permalink Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
[project]
name = "enduro-trails"
version = "0.1.0"
requires-python = ">=3.10"
description = "Карта эндуро-маршрутов с рельефом, навигацией и слоями terrain/TRI/hillshade"
readme = "README.md"
dependencies = [
"fastapi==0.111.0",
"uvicorn==0.29.0",
"shapely==2.0.4",
"mapbox-vector-tile==2.2.0",
"httpx==0.27.0",
"defusedxml==0.7.1",
"pyyaml==6.0.1",
]
[project.optional-dependencies]
dev = [
"ruff>=0.4.0",
"pytest>=8.0",
"httpx>=0.27",
"pytest-asyncio>=0.23",
"lxml==5.2.2",
]
[build-system]
requires = ["setuptools>=68", "wheel"]
build-backend = "setuptools.build_meta"
[tool.setuptools.packages.find]
where = ["."]
include = ["src*"]
[tool.ruff]
target-version = "py310"
line-length = 120
[tool.pytest.ini_options]
asyncio_mode = "auto"
testpaths = ["tests"]
markers = [
"network: contract smoke tests that hit live HTTP endpoints (deselect with '-m \"not network\"')",
]
addopts = "-m 'not network'"