-
Notifications
You must be signed in to change notification settings - Fork 12
/
Makefile
74 lines (54 loc) · 1.54 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
.PHONY: lint test dist upload docs
ENV=.venv
BIN=$(ENV)/bin/
DIRS=src/ tests/ scripts/ docs/
BROWSER=firefox
PYTEST=pytest --doctest-modules --doctest-glob="*.rst" --doctest-ignore-import-errors
all: lint test
black:
-$(BIN)black $(DIRS)
blackdoc:
-$(BIN)blackdoc $(DIRS)
pylint:
-$(BIN)pylint src/
mypy:
-$(BIN)mypy $(DIRS)
doc8:
-$(BIN)doc8 README.rst
pydocstyle:
-$(BIN)pydocstyle src/
lint: black blackdoc pylint mypy pydocstyle
test:
$(BIN)python -m $(PYTEST) src/ tests/ docs/ README.rst
test-performance:
$(BIN)python -m $(PYTEST) --performance tests/performance/
coverage:
$(BIN)coverage erase
$(BIN)coverage run --branch --source=src -m $(PYTEST) tests/
$(BIN)coverage run --append --branch --source=src -m $(PYTEST) --debug-mode tests/
$(BIN)coverage html
$(BROWSER) htmlcov/index.html
$(BIN)coverage json -o - | $(BIN)python tests/make_coverage_badge.py > docs/_images/badge-coverage.svg
profile:
$(BIN)python -O -m scripts.profile
docs:
cd docs; make SPHINXBUILD='../$(BIN)python -msphinx' html
tox:
$(BIN)tox
dist: clean tox coverage docs
$(BIN)python -m build
$(BIN)twine check dist/*
upload: dist
$(BIN)twine check dist/*
$(BIN)twine upload dist/*
install:
python -m venv --clear $(ENV)
$(BIN)pip install -r requirements-dev.txt
$(BIN)pip install --force-reinstall -e .
uninstall:
$(BIN)pip uninstall suffix_tree
clean:
-rm -rf build dist docs/_build htmlcov .mypy_cache .pytest_cache .tox *.egg-info
-rm docs/_images/badge*.svg
-rm *~ .*~ pylintgraph.dot
-find . -name __pycache__ -type d -exec rm -r "{}" \;