-
Notifications
You must be signed in to change notification settings - Fork 1
/
Makefile
93 lines (75 loc) · 2.1 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
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
LICENSE=LICENSE
LICENSE_HEADER=LICENSE_HEADER
VENV=.venv
$(VENV):
$(MAKE) install
.PHONY: install
install: poetry-ensure-installed
poetry config --local virtualenvs.in-project true
poetry env use python3.8
poetry install
.PHONY: deps-show
deps-show:
poetry show
.PHONY: deps-show
deps-show-outdated:
poetry show --outdated
.PHONY: deps-update
deps-update:
poetry update
.PHONY clean:
clean:
rm -rf .venv htmlcov .coverage
.PHONY: docker-build
docker-build:
cd mentor_classifier && $(MAKE) docker-build
cd mentor_classifier_api && $(MAKE) docker-build
.PHONY: black
black: $(VENV)
poetry run black .
.PHONY: format
format:
$(MAKE) license
$(MAKE) black
LICENSE:
@echo "you must have a LICENSE file" 1>&2
exit 1
LICENSE_HEADER:
@echo "you must have a LICENSE_HEADER file" 1>&2
exit 1
.PHONY: license
license: LICENSE LICENSE_HEADER $(VENV)
poetry run python -m licenseheaders -t LICENSE_HEADER -d mentor_classifier/mentor_classifier $(args)
poetry run python -m licenseheaders -t LICENSE_HEADER -d mentor_classifier/mentor_classifier_tasks $(args)
poetry run python -m licenseheaders -t LICENSE_HEADER -d mentor_classifier/tests $(args)
poetry run python -m licenseheaders -t LICENSE_HEADER -d mentor_classifier_api/src $(args)
poetry run python -m licenseheaders -t LICENSE_HEADER -d mentor_classifier_api/tests $(args)
poetry run python -m licenseheaders -t LICENSE_HEADER -d tools $(args)
poetry run python -m licenseheaders -t LICENSE_HEADER -d shared $(args)
.PHONY: poetry-ensure-installed
poetry-ensure-installed:
sh ./tools/poetry_ensure_installed.sh
.PHONY: test
test:
cd mentor_classifier && $(MAKE) test
cd mentor_classifier_api && $(MAKE) test
.PHONY: test-all
test-all:
$(MAKE) test-format
$(MAKE) test-lint
$(MAKE) test-license
$(MAKE) test-types
$(MAKE) test
.PHONY: test-format
test-format: $(VENV)
poetry run black --check .
.PHONY: test-lint
test-lint: $(VENV)
poetry run flake8 .
.PHONY: test-license
test-license: LICENSE LICENSE_HEADER
args="--check" $(MAKE) license
.PHONY: test-types
test-types: $(VENV)
poetry run mypy mentor_classifier
poetry run mypy mentor_classifier_api