-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathMakefile
57 lines (37 loc) · 1.18 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
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
.PHONY: default all clean build install \
poetry-install \
test test-unit \
format isort autoflake black \
check check-isort check-autoflake check-black check-flake8 check-mypy
default: check test-unit
clean:
rm -rf dist .mypy_cache
find -type d -name __pycache__ -prune -exec rm -rf {} \;
build:
poetry build
poetry-install:
poetry install
POETRY_RUN := poetry run
# Tests
test: test-unit
test-unit: poetry-install
$(POETRY_RUN) python -m unittest discover tests --failfast --verbose
# Checks and formatting
format: autoflake isort black
check: check-flake8 check-mypy check-autoflake check-isort check-black
check-flake8: poetry-install
$(POETRY_RUN) flake8 src
check-mypy: poetry-install
$(POETRY_RUN) mypy src
autoflake: poetry-install
$(POETRY_RUN) autoflake --quiet --in-place src
check-autoflake: poetry-install
$(POETRY_RUN) autoflake --quiet --check src
isort: poetry-install
$(POETRY_RUN) isort src
check-isort: poetry-install
$(POETRY_RUN) isort --check src
black: poetry-install
$(POETRY_RUN) black src
check-black: poetry-install
$(POETRY_RUN) black --check src