-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
44 lines (35 loc) · 876 Bytes
/
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
VENV=.venv
PYTHON=$(VENV)/bin/python3
PIP_FREEZE=.requirements.freeze.txt
PY_FILES=*.py kigo/ tests/
.PHONY: ci
ci: $(PY_FILES) py-deps type-check lint test
.PHONY: type-check
type-check: $(VENV) $(PY_FILES)
$(PYTHON) -m mypy \
--install-types \
--non-interactive \
--ignore-missing-imports \
$(PY_FILES)
.PHONY: lint
lint: $(VENV) $(PY_FILES)
$(PYTHON) -m flake8 $(PY_FILES) \
--ignore E402,W503,E731
.PHONY: test
test: $(VENV) $(PY_FILES)
$(PYTHON) -m pytest ./tests/
.PHONY: py-deps
py-deps: $(PIP_FREEZE)
$(PIP_FREEZE): $(VENV) requirements.txt
$(PYTHON) -m pip install --upgrade --require-virtualenv pip
$(PYTHON) -m pip install --upgrade --require-virtualenv -r requirements.txt && \
$(PYTHON) -m pip freeze > $(PIP_FREEZE)
$(VENV):
python3 -m venv $(VENV)
.PHONY: clean
clean:
rm -rf \
$(VENV) \
$(PIP_FREEZE) \
wandb/ \
.mypy_cache/