File size: 1,988 Bytes
194469b
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
# 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