-
Notifications
You must be signed in to change notification settings - Fork 2
/
Makefile
77 lines (61 loc) · 1.96 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
75
76
77
SHELL=/bin/bash
NAME=coola
SOURCE=src/$(NAME)
TESTS=tests
UNIT_TESTS=tests/unit
INTEGRATION_TESTS=tests/integration
LAST_GIT_TAG := $(shell git tag --sort=taggerdate | grep -o 'v.*' | tail -1)
DOC_TAG := $(shell echo $(LAST_GIT_TAG) | cut -c 2- | awk -F \. {'print $$1"."$$2'})
.PHONY : conda
conda :
conda env create -f environment.yaml --yes
.PHONY : config-poetry
config-poetry :
poetry config experimental.system-git-client true
poetry config --list
.PHONY : install
install :
poetry install --no-interaction
.PHONY : install-all
install-all :
poetry install --no-interaction --all-extras --with docs
.PHONY : update
update :
-poetry self update
poetry update
-pre-commit autoupdate
.PHONY : lint
lint :
ruff check --output-format=github .
.PHONY : format
format :
black --check .
.PHONY : docformat
docformat :
docformatter --config ./pyproject.toml --in-place $(SOURCE)
.PHONY : doctest-src
doctest-src :
python -m pytest --xdoctest $(SOURCE)
find . -type f -name "*.md" | xargs python -m doctest -o NORMALIZE_WHITESPACE -o ELLIPSIS -o REPORT_NDIFF
.PHONY : test
test :
python -m pytest --xdoctest
.PHONY : unit-test
unit-test :
python -m pytest --xdoctest --timeout 10 $(UNIT_TESTS)
.PHONY : unit-test-cov
unit-test-cov :
python -m pytest --xdoctest --timeout 10 --cov-report html --cov-report xml --cov-report term --cov=$(NAME) $(UNIT_TESTS)
.PHONY : publish-pypi
publish-pypi :
poetry config pypi-token.pypi ${PYPI_TOKEN}
poetry publish --build
.PHONY : publish-doc-dev
publish-doc-dev :
-mike delete --config-file docs/mkdocs.yml main # delete previous version if it exists
mike deploy --config-file docs/mkdocs.yml --push --update-aliases main dev
.PHONY : publish-doc-latest
publish-doc-latest :
-mike delete --config-file docs/mkdocs.yml $(DOC_TAG) # delete previous version if it exists
mike deploy --config-file docs/mkdocs.yml --push --update-aliases $(DOC_TAG) latest;
mike set-default --config-file docs/mkdocs.yml --push --allow-empty latest