facerecog / Makefile
atomio
Initial commit
194469b
Raw History Blame Contribute Delete
1.99 kB
# Face Recognition API Makefile
.PHONY: help install install-dev setup clean test test-cov lint format type-check run dev docker-build docker-run
# Default target
help:
@echo "Available commands:"
@echo " install - Install production dependencies"
@echo " install-dev - Install development dependencies"
@echo " setup - Set up development environment"
@echo " clean - Clean up temporary files"
@echo " test - Run tests"
@echo " test-cov - Run tests with coverage"
@echo " lint - Run linting"
@echo " format - Format code"
@echo " type-check - Run type checking"
@echo " run - Run the application"
@echo " dev - Run in development mode"
@echo " docker-build - Build Docker image"
@echo " docker-run - Run Docker container"
# Installation
install:
pip install -e .
install-dev:
pip install -e ".[dev,test]"
setup: install-dev
cp .env.example .env
@echo "Please edit .env file with your configuration"
pre-commit install
# Cleaning
clean:
find . -type f -name "*.pyc" -delete
find . -type d -name "__pycache__" -delete
find . -type d -name "*.egg-info" -exec rm -rf {} +
rm -rf build/
rm -rf dist/
rm -rf .coverage
rm -rf htmlcov/
rm -rf .pytest_cache/
rm -rf .mypy_cache/
# Testing
test:
pytest
test-cov:
pytest --cov=. --cov-report=html --cov-report=term --cov-config=pyproject.toml
# Code quality
lint:
ruff check . --exclude=venv,build,dist
format:
ruff format . --exclude=venv,build,dist
ruff check --fix . --exclude=venv,build,dist
type-check:
mypy . --exclude=venv
# Development
run:
python app.py
dev:
uvicorn app:app --reload --host 0.0.0.0 --port 8000
# Docker
docker-build:
docker build -t facerecog-api .
docker-run:
docker run -p 8000:8000 --env-file .env facerecog-api
# Database
db-upgrade:
@echo "Run the SQL files in the sql/ directory in your Supabase SQL Editor"
# All checks
check: lint type-check test
# CI/CD
ci: install-dev check