-
Notifications
You must be signed in to change notification settings - Fork 50
Expand file tree
/
Copy pathMakefile
More file actions
59 lines (47 loc) · 1.77 KB
/
Makefile
File metadata and controls
59 lines (47 loc) · 1.77 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
.PHONY: install run test lint format clean help
VENV_PATH=/home/vscode/venv
PYTHON=${VENV_PATH}/bin/python
PIP=${VENV_PATH}/bin/pip
help: ## Show this help message
@echo 'Usage: make [target]'
@echo ''
@echo 'Targets:'
@grep -E '^[a-zA-Z_-]+:.*?## .*$$' $(MAKEFILE_LIST) | sort | awk 'BEGIN {FS = ":.*?## "}; {printf "\033[36m%-30s\033[0m %s\n", $$1, $$2}'
install: ## Install project dependencies
@echo "Installing dependencies..."
python -m venv ${VENV_PATH}
${PIP} install --upgrade pip
${PIP} install -r requirements.txt
run: ## Run the application
@echo "Starting the application..."
${PYTHON} app.py
test: ## Run tests
@echo "Running tests..."
${PYTHON} -m pytest
lint: ## Run code linting with flake8
@echo "Linting code..."
${PYTHON} -m flake8 app/
format: ## Format code using black
@echo "Formatting code..."
${PYTHON} -m black app/
clean: ## Remove temporary files and caches
@echo "Cleaning temporary files..."
find . -type d -name "__pycache__" -exec rm -rf {} +
find . -type f -name "*.pyc" -delete
find . -type f -name "*.pyo" -delete
find . -type f -name "*.pyd" -delete
find . -type f -name ".coverage" -delete
find . -type d -name "*.egg-info" -exec rm -rf {} +
find . -type d -name "*.egg" -exec rm -rf {} +
find . -type d -name ".pytest_cache" -exec rm -rf {} +
find . -type d -name ".mypy_cache" -exec rm -rf {} +
dev-install: ## Install development dependencies
@echo "Installing development dependencies..."
${PIP} install -r requirements.txt
${PIP} install black flake8 pytest pytest-cov mypy
build: ## Build Docker image
@echo "Building Docker image..."
docker build -t lab-study-app -f .devcontainer/Dockerfile .
docker-run: ## Run the application in Docker
@echo "Running application in Docker..."
docker run -p 8000:8000 lab-study-app