munch-ease-backend/Makefile
jableader 7b6f4e2a3b Squashed commit of the following:
commit 21a17b771743b23ee41d11a90ed8fdc3433468ce
Author: jableader <jacobdunk@gmail.com>
Date:   Mon Oct 20 00:12:02 2025 +1100

    Completed tooling improvements, fixed remaining errors

commit 7db48e222e3aa1065c326197c33ba6439720f65a
Author: jableader <jacobdunk@gmail.com>
Date:   Sun Oct 19 22:05:37 2025 +1100

    autoformat

commit 5705ce24b64c2aa6f0b9426730a479165fa97e2a
Author: jableader <jacobdunk@gmail.com>
Date:   Sun Oct 19 22:05:29 2025 +1100

    tooling changes

commit f0a6b2fd147bb86b484927afd57b9ba0ac07bf47
Author: jableader <jacobdunk@gmail.com>
Date:   Sun Oct 19 21:25:49 2025 +1100

    Plan
2025-10-20 00:12:16 +11:00

63 lines
1.9 KiB
Makefile

.PHONY: help install format lint typecheck test openapi dev all-checks clean
# Use activated environment if available, otherwise use .venv explicitly
PYTHON := $(shell command -v python 2>/dev/null || echo .venv/bin/python)
PIP := $(shell command -v pip 2>/dev/null || echo .venv/bin/pip)
help:
@echo "Available targets:"
@echo " install - Create venv and install dependencies"
@echo " format - Format code with ruff"
@echo " lint - Lint code with ruff"
@echo " typecheck - Type check with mypy"
@echo " test - Run tests with pytest"
@echo " openapi - Export OpenAPI schema"
@echo " dev - Run development server"
@echo " all-checks - Run all quality checks"
@echo " clean - Remove venv and caches"
@echo ""
@echo "Note: Make sure to activate your venv first: source .venv/bin/activate"
install:
@echo "Creating virtual environment..."
python3 -m venv .venv
@echo "Installing dependencies..."
.venv/bin/pip install --upgrade pip
.venv/bin/pip install -r requirements.txt
.venv/bin/pip install -r dev-requirements.txt
@echo "Installing pre-commit hooks..."
.venv/bin/pre-commit install
@echo "Done! Activate with: source .venv/bin/activate"
format:
$(PYTHON) -m ruff format .
lint:
$(PYTHON) -m ruff check .
typecheck:
$(PYTHON) -m mypy .
test:
$(PYTHON) -m pytest -q
openapi:
$(PYTHON) scripts/export_openapi.py
dev:
$(PYTHON) -m uvicorn main:app --reload
all-checks: lint typecheck test
@echo "Running format check..."
$(PYTHON) -m ruff format --check .
@echo "Exporting OpenAPI schema..."
$(PYTHON) scripts/export_openapi.py
@echo ""
@echo "✓ All checks passed!"
clean:
rm -rf .venv
find . -type d -name __pycache__ -exec rm -rf {} +
find . -type d -name .pytest_cache -exec rm -rf {} +
find . -type d -name .mypy_cache -exec rm -rf {} +
find . -type d -name .ruff_cache -exec rm -rf {} +