-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathMakefile
More file actions
105 lines (83 loc) · 2.56 KB
/
Makefile
File metadata and controls
105 lines (83 loc) · 2.56 KB
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
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
.PHONY: help install test test-unit test-integration test-e2e coverage lint format clean docker-build docker-up docker-down docker-logs docker-test docker-shell
help:
@echo "Available commands:"
@echo ""
@echo "Development:"
@echo " make install Install all dependencies"
@echo " make test Run all tests"
@echo " make test-unit Run unit tests only"
@echo " make test-integration Run integration tests only"
@echo " make test-e2e Run end-to-end tests only"
@echo " make coverage Run tests with coverage report"
@echo " make lint Run linting checks"
@echo " make format Format code with black and isort"
@echo " make clean Clean up generated files"
@echo " make pre-commit Install pre-commit hooks"
@echo ""
@echo "Docker:"
@echo " make docker-build Build all Docker images"
@echo " make docker-up Start all services"
@echo " make docker-down Stop all services"
@echo " make docker-logs View service logs"
@echo " make docker-test Run tests in Docker"
@echo " make docker-shell Shell into backend container"
install:
pip install -r requirements.txt
pip install -r requirements-test.txt
pip install -e .
test:
python run_tests.py
test-unit:
python run_tests.py unit
test-integration:
python run_tests.py integration
test-e2e:
pytest tests/e2e/ -v
coverage:
pytest --cov=src --cov-report=html --cov-report=term-missing
lint:
flake8 src/ tests/ --max-line-length=100 --extend-ignore=E203,W503
mypy src/ --ignore-missing-imports
black --check src/ tests/
isort --check-only src/ tests/
format:
black src/ tests/ --line-length=100
isort src/ tests/ --profile black --line-length=100
clean:
find . -type f -name "*.pyc" -delete
find . -type d -name "__pycache__" -delete
find . -type d -name ".pytest_cache" -exec rm -rf {} +
find . -type d -name ".mypy_cache" -exec rm -rf {} +
rm -rf htmlcov/
rm -f .coverage
rm -f coverage.xml
rm -rf dist/
rm -rf build/
rm -rf *.egg-info
pre-commit:
pre-commit install
pre-commit run --all-files
# Docker commands
docker-build:
docker compose build
docker-up:
docker compose up -d
docker-down:
docker compose down
docker-logs:
docker compose logs -f
docker-test:
docker compose run --rm test
docker-shell:
docker compose exec backend bash
docker-clean:
docker compose down -v
docker system prune -f
docker-db-init:
docker compose --profile init run --rm db-init
docker-dev:
docker compose --profile dev up
docker-prod:
docker compose --profile prod up -d
docker-e2e:
docker compose run --rm e2e-tests