.PHONY: test test-fast test-slow docs docs-build landing clean \
       migrate migrate-make migrate-down migrate-status migrate-history

# Run all tests
test:
	uv run pytest tests/ bluefox_core/demo/tests/ -v --tb=short

# Skip slow (container) tests
test-fast:
	uv run pytest tests/ bluefox_core/demo/tests/ -v --tb=short -m "not slow"

# Only slow (container) tests
test-slow:
	uv run pytest tests/ bluefox_core/demo/tests/ -v --tb=short -m "slow"

# Serve docs locally (MkDocs)
docs:
	uv run mkdocs serve

# Build docs to site/
docs-build:
	uv run mkdocs build

# Serve landing page locally
landing:
	python -m http.server 8090 --directory landing

# --- Migrations ---

# Run all pending migrations
migrate:
	uv run alembic upgrade head

# Create a new migration (usage: make migrate-make m="add users table")
migrate-make:
	uv run alembic revision --autogenerate -m "$(m)"

# Roll back one migration
migrate-down:
	uv run alembic downgrade -1

# Show current migration status
migrate-status:
	uv run alembic current

# Show migration history
migrate-history:
	uv run alembic history

# --- Cleanup ---

# Remove build artifacts
clean:
	rm -rf site/ dist/ *.egg-info
