-
Notifications
You must be signed in to change notification settings - Fork 13
/
Makefile
31 lines (25 loc) · 927 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
VENV_NAME?=venv
VENV_ACTIVATE=. $(VENV_NAME)/bin/activate
help:
@echo "Makefile help. Your options are:"
@echo "clean - remove build and Python file artifacts"
@echo "install - install basic dependencies with venv"
@echo "venv_lint - check style with flake8 and mypy with venv"
@echo "venv_test - run tests with venv"
clean:
rm -rf $(VENV_NAME)
rm -rf *.egg-info
find . -name __pycache__ -exec rm -rf {} \;
find . -name .mypy_cache -exec rm -rf {} \;
install:
python3 -m venv $(VENV_NAME);
$(VENV_ACTIVATE)
${VENV_NAME}/bin/python -m pip install -r requirements.txt
${VENV_NAME}/bin/python -m pip install .
@touch $(VENV_NAME)/bin/activate
venv_activate:
$(VENV_ACTIVATE)
venv_lint: venv_activate
$(VENV_ACTIVATE) && flake8 --config=flake8.ini ./src ./tests && mypy --config-file mypy.ini ./src ./tests
venv_test: install venv_activate
$(VENV_ACTIVATE) && ${VENV_NAME}/bin/python -m pytest tests/test.py