-
Notifications
You must be signed in to change notification settings - Fork 8
/
Makefile
66 lines (49 loc) · 1.4 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
TEST_PATH = ./tests/
FLAKE8_EXCLUDE = venv,.venv,.eggs,.tox,.git,__pycache__,*.pyc
PROJECT = pypam
AUTHOR = Clea Parcerisas
.PHONY: build docs clean install docker-build tests
clean:
@find . -name '*.pyc' -exec rm --force {} +
@find . -name '*.pyo' -exec rm --force {} +
@find . -name '*~' -exec rm --force {} +
@rm -rf build
@rm -rf dist
@rm -rf *.egg-info
@rm -f *.sqlite
@rm -rf .cache
startup:
pip install --upgrade pip
which poetry >/dev/null || pip install poetry
init: startup
poetry install
init-dev: startup
poetry install --with test, docs, dev
init-test: startup
poetry install --with test
init-docs: startup
poetry install --with docs
docs:
if ! [ -d "./docs" ]; then poetry run sphinx-quickstart -q --ext-autodoc --sep --project $(PROJECT) --author $(AUTHOR) docs; fi
poetry run sphinx-apidoc -f -o ./docs/source ./$(PROJECT)
poetry run sphinx-build -E -a -b html ./docs/source ./docs/build/html
test:
poetry run pytest ${TEST_PATH} -rxXs
test-coverage:
poetry run pytest --cov=$(PROJECT) ${TEST_PATH} --cov-report term-missing
check:
poetry run black --check --diff .
poetry run isort --check --diff .
poetry run flake8 . --exclude ${FLAKE8_EXCLUDE}
lint-fix:
poetry run black .
poetry run isort .
docker-build:
docker build . -t $(PROJECT)
update:
poetry update
poetry run pre-commit autoupdate
build: update check test docs
poetry build
release: build
poetry release