arm-core/Makefile
Andrey Epifancev 56ea8dce0c fix: make venv идемпотентен — uv venv --allow-existing
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
2026-10-03 18:08:37 +04:00

41 lines
1.3 KiB
Makefile
Raw 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.

# Команды разработки arm-core. Backend — api/.venv; запуск из корня репозитория.
VENV := api/.venv
BIN := $(CURDIR)/$(VENV)/bin
COMPOSE_FILE ?= ../docs/dev/docker-compose.yml
.PHONY: venv lint test test-integration check check-full up migrate seed seed-dev
# Python 3.11 (версия платформы); внутренние пакеты raisa_* вне банка недоступны — пропускаем их
venv:
cd api && uv venv --python 3.11 --allow-existing .venv
cd api && grep -v '^raisa_' requirements.txt | uv pip install --python .venv/bin/python -r -
cd api && grep -v '^-r' requirements-dev.txt | uv pip install --python .venv/bin/python -r -
lint:
cd api && $(BIN)/ruff check .
cd api && $(BIN)/ruff format --check .
cd api && $(BIN)/mypy src
test:
cd api && $(BIN)/pytest -m "not integration"
test-integration:
cd api && $(BIN)/pytest -m integration
check: lint test
# TODO (задача 25): добавить фронт (lint/test/build web/), проверку миграций с нуля и откат, актуальность OpenAPI
check-full: check test-integration
up:
docker compose -f $(COMPOSE_FILE) up -d
migrate:
cd api && $(BIN)/alembic upgrade head
seed:
cd api && $(BIN)/python -m scripts.seed
seed-dev:
cd api && $(BIN)/python -m scripts.seed --dev