-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
34 lines (26 loc) · 1.03 KB
/
Makefile
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
.PHONY: format check-format test clean help all
all: format check-format test clean
format:
poetry run autoflake --remove-all-unused-imports --remove-unused-variables --in-place --recursive .
poetry run isort .
poetry run black .
check-format:
poetry run isort --check-only .
poetry run black --check .
test:
poetry run pytest tests/
test-all:
poetry run pytest tests/ --runslow
clean:
find . -type f -name '*.pyc' -delete
find . -type d -name '__pycache__' -exec rm -r {} +
count:
find . -path './.venv' -prune -o -name '*.py' -print | xargs wc -l
help:
@echo "format - Auto-format Python code with autoflake, isort, and black"
@echo "check-format - Check if Python code is formatted with isort, and black"
@echo "test - Run tests (excluding slow tests)"
@echo "test-all - Run all tests (including slow tests)"
@echo "clean - Remove all .pyc files and __pycache__ directories"
@echo "count - Count the number of lines of code"
@echo "all - Run format, check-format, test all and then clean"