forked from ScamStop/scamstop
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
52 lines (44 loc) · 1.13 KB
/
Copy pathMakefile
File metadata and controls
52 lines (44 loc) · 1.13 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
# Variables
PYTHON = python3
PIP = pip3
VENV = venv
VENV_BIN = $(VENV)/bin
# Default target
.DEFAULT_GOAL := help
# Create virtual environment
$(VENV)/bin/activate: requirements.txt
$(PYTHON) -m venv $(VENV)
$(VENV_BIN)/pip install -r requirements.txt
# Install dependencies
.PHONY: install
install: $(VENV)/bin/activate
# Run tests
.PHONY: test
test: install
$(VENV_BIN)/pytest tests/
# Clean up generated files and virtual environment
.PHONY: clean
clean:
rm -rf $(VENV)
find . -type d -name "__pycache__" -exec rm -rf {} +
find . -type f -name "*.pyc" -delete
# Format code
.PHONY: format
format: install
$(VENV_BIN)/black .
$(VENV_BIN)/isort .
# Run linting
.PHONY: lint
lint: install
$(VENV_BIN)/flake8 .
$(VENV_BIN)/mypy .
# Help command
.PHONY: help
help:
@echo "Available commands:"
@echo " make install - Create virtual environment and install dependencies"
@echo " make test - Run tests"
@echo " make clean - Remove virtual environment and cache files"
@echo " make format - Format code using black and isort"
@echo " make lint - Run linting checks"
@echo " make help - Show this help message"