-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
72 lines (56 loc) · 1.64 KB
/
Makefile
File metadata and controls
72 lines (56 loc) · 1.64 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
# QE Makefile
# Installation
install:
poetry install
poetry run pre-commit install --allow-missing-config -f
poetry run detect-secrets scan > .secrets.baseline
# Testing
test:
poetry run pytest
@rm -f .coverage.* || true
@echo "===== Finished running unit tests ====="
integration_test:
poetry run pytest tests/integration
@echo "===== Finished running integration tests ====="
# Linting and formatting
lint:
poetry run ruff check .
lint-fix:
poetry run ruff check --fix .
format:
poetry run ruff format .
format-check:
poetry run ruff format --check .
# Type checking
typecheck:
poetry run mypy qe
# Security
security:
poetry run bandit -c pyproject.toml -r qe
# Pre-commit
pre-commit:
poetry run pre-commit run --all-files
# All checks (for CI)
check: lint-fix format typecheck security test
# Qdrant database
qdrant-dump:
docker run --rm \
-v qdrant_data:/qdrant/storage:ro \
-v $(PWD):/backup \
busybox \
tar czf /backup/qdrant_storage_dump.tar.gz -C /qdrant/storage .
@echo "===== Qdrant database dumped to qdrant_storage_dump.tar.gz ====="
# PostgreSQL database
pg-dump:
docker exec qe-postgres pg_dump -U qe qe > qe_postgres_dump.sql
@echo "===== PostgreSQL database dumped to qe_postgres_dump.sql ====="
# Clean
clean:
rm -rf .coverage .coverage.* coverage.json lcov.info htmlcov
rm -rf .pytest_cache .mypy_cache .ruff_cache
rm -rf dist build *.egg-info
find . -type d -name __pycache__ -exec rm -rf {} + 2>/dev/null || true
# Development server
dev:
poetry run uvicorn api.main:app --reload
.PHONY: install test integration_test lint lint-fix format format-check typecheck security pre-commit check clean qdrant-dump dev