-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
46 lines (37 loc) · 1.05 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
# virtualenv path
VENV_DIR = .venv
VENV_PYTHON = $(VENV_DIR)/bin/python3
# sphinx
SPHINXOPTS ?=
SPHINXBUILD ?= sphinx-build
SOURCEDIR = src
BUILDDIR = docs/_build
$(VENV_PYTHON):
ifneq ("$(wildcard $(VENV_PYTHON))","")
else
python3 -m venv $(VENV_DIR)
endif
.PHONY: install
install: $(VENV_PYTHON) requirements.txt
$(VENV_PYTHON) -m pip install -r requirements.txt
$(VENV_PYTHON) -m pip install -e .
$(VENV_DIR)/bin/tox: $(VENV_PYTHON)
$(VENV_PYTHON) -m pip install tox
$(VENV_DIR)/bin/$(SPHINXBUILD): $(VENV_PYTHON)
$(VENV_PYTHON) -m pip install -r docs-requirements.txt
.PHONY: lint
lint: $(VENV_DIR)/bin/tox
$(VENV_DIR)/bin/tox -e flake8,pylint,bandit
.PHONY: test
test: $(VENV_DIR)/bin/tox
$(VENV_DIR)/bin/tox -e pytest,report
.PHONY: docs
docs: $(VENV_DIR)/bin/$(SPHINXBUILD)
cd docs && make html
.PHONY: clean
clean:
@find . -name "__pycache__" -type d | xargs rm -rf
@find . -name "*.egg-info" -type d | xargs rm -rf
@rm -rf build dist .pytest_cache .tox .coverage *.egg-info htmlcov
@rm -rf $(VENV_DIR)
cd docs && make clean