-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
66 lines (45 loc) · 1.2 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
REPO = rcg
VENV_NAME = venv
VENV_PATH = $(VENV_NAME)/bin/activate
PYTHON := $(VENV_NAME)/bin/python
.PHONY: venv
venv:
ifeq ($(OS),Windows_NT)
python -m venv $(VENV_NAME)
. $(VENV_PATH) && pip install -r requirements.txt
else
python3 -m venv $(VENV_NAME)
. $(VENV_PATH); pip install -r requirements.txt
endif
activate:
. source $(VENV_PATH)
.PHONY: test
test:
python -m pytest tests/ -vv
.PHONY: install
install: venv
. $(VENV_PATH); pip install --upgrade -r requirements.txt
.PHONY: install-dev
install-dev: venv
. $(VENV_PATH); pip install --upgrade -r requirements-dev.txt
.PHONY: update
update: venv
. $(VENV_PATH); pip install --upgrade -r requirements.txt
.PHONY: clean
clean:
rm -rf $(VENV_NAME)
.PHONY: dev-reqs
dev-reqs:
. $(VENV_PATH); pip install autopep8 isort mypy flake8 pytest
check-autopep:
${PYTHON} -m autopep-8 -i $(REPO)/*.py tests/*.py
check-isort:
${PYTHON} -m isort --check-only $(REPO) tests
check-flake:
${PYTHON} -m flake8 $(REPO) tests
check-mypy:
${PYTHON} -m mypy --strict --implicit-reexport $(REPO)
lint: check-flake check-mypy check-autopep check-isort
format:
${PYTHON} -m autopep8 -i $(REPO)/*.py tests/*.py $(REPO)/src/*.py
${PYTHON} -m isort $(REPO) tests