Imago/Makefile
Bruno Charest cc99fea20a
Some checks failed
CI / Lint & Format (push) Has been cancelled
CI / Tests (push) Has been cancelled
CI / Security Scan (push) Has been cancelled
CI / Docker Build (push) Has been cancelled
Add comprehensive test suite for image processing and related services
- Implement tests for database generator to ensure proper session handling.
- Create tests for EXIF extraction and conversion functions.
- Add tests for image-related endpoints, ensuring proper data retrieval and isolation between clients.
- Develop tests for OCR functionality, including language detection and text extraction.
- Introduce tests for the image processing pipeline, covering success and failure scenarios.
- Validate rate limiting functionality and ensure independent counters for different clients.
- Implement scraper tests to verify HTML content fetching and error handling.
- Add unit tests for various services, including storage and filename generation.
- Establish worker entry point for ARQ to handle background image processing tasks.
2026-02-24 11:22:10 -05:00

58 lines
2.5 KiB
Makefile

.PHONY: help install install-dev lint format test test-cov serve worker docker-up docker-down clean
help: ## Affiche l'aide
@grep -E '^[a-zA-Z_-]+:.*?## .*$$' $(MAKEFILE_LIST) | sort | \
awk 'BEGIN {FS = ":.*?## "}; {printf " \033[36m%-18s\033[0m %s\n", $$1, $$2}'
# ── Installation ──────────────────────────────────────────────
install: ## Installer les dépendances de production
pip install -r requirements.txt
install-dev: ## Installer les dépendances de dev + pre-commit
pip install -r requirements-dev.txt
pre-commit install
# ── Qualité du code ───────────────────────────────────────────
lint: ## Linter le code (ruff check + mypy)
ruff check app/ tests/
mypy app/ --ignore-missing-imports
format: ## Formater le code (ruff format)
ruff format app/ tests/
ruff check --fix app/ tests/
# ── Tests ─────────────────────────────────────────────────────
test: ## Lancer les tests
python -m pytest tests/ -v --tb=short
test-cov: ## Lancer les tests avec couverture
python -m pytest tests/ -v --tb=short --cov=app --cov-report=term-missing --cov-report=html
# ── Serveur ───────────────────────────────────────────────────
serve: ## Démarrer le serveur de développement
uvicorn app.main:app --reload --host 0.0.0.0 --port 8000
worker: ## Démarrer le worker ARQ
python worker.py
# ── Docker ────────────────────────────────────────────────────
docker-up: ## Démarrer tous les services Docker
docker-compose up -d --build
docker-down: ## Arrêter tous les services Docker
docker-compose down -v
# ── Nettoyage ─────────────────────────────────────────────────
clean: ## Nettoyer les fichiers temporaires
find . -type d -name __pycache__ -exec rm -rf {} + 2>/dev/null || true
find . -type d -name .pytest_cache -exec rm -rf {} + 2>/dev/null || true
find . -type d -name .mypy_cache -exec rm -rf {} + 2>/dev/null || true
find . -type d -name htmlcov -exec rm -rf {} + 2>/dev/null || true
find . -name "*.pyc" -delete 2>/dev/null || true