-
Notifications
You must be signed in to change notification settings - Fork 5
/
Makefile
77 lines (58 loc) · 1.56 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
PROJECT_NAME := pams
RUN := poetry run
.PHONY: check
check: test lint mypy
.PHONY: install
install:
@poetry install
.PHONY: test
test: pytest doctest
.PHONY: pytest
pytest:
$(RUN) pytest
.PHONY: doctest
doctest:
$(RUN) pytest --doctest-modules $(PROJECT_NAME)
.PHONY: test-cov
test-cov:
$(RUN) pytest --cov=$(PROJECT_NAME) --cov-report=xml
.PHONY: lint
lint: lint-black lint-isort lint-flake8
.PHONY: lint-black
lint-black:
$(RUN) black --check --diff --quiet .
.PHONY: lint-isort
lint-isort:
$(RUN) isort --check --quiet .
.PHONY: lint-flake8
lint-flake8:
$(RUN) pflake8 .
.PHONY: mypy
mypy:
$(RUN) mypy $(PROJECT_NAME)
.PHONY: format
format: format-black format-isort
.PHONY: format-black
format-black:
$(RUN) black --quiet .
.PHONY: format-isort
format-isort:
$(RUN) isort --quiet .
.PHONY: publish
publish:
@poetry publish --build
.PHONY: test-publish
test-publish:
@poetry publish --build -r testpypi
.PHONY: doc-intl
doc-intl:
@cd docs && make gettext && sphinx-intl update -p build/gettext -l ja && \
echo "please check and modify docs/source/locale/ja/LC_MESSAGES/index.po"
.PHONY: doc
doc:
@cd docs && rm -rf build/html/ build/html-ja/ build/html-en/ && \
rm -r source/reference/generated && git checkout source/reference/generated/.gitignore && \
make -e SPHINXOPTS="-a" html && mv build/html/ build/html-en/ && \
make -e SPHINXOPTS="-D language='ja' -a" html && mv build/html/ build/html-ja && \
mkdir -p build/html/ && mv build/html-en/ build/html/en/ && mv build/html-ja/ build/html/ja/ && \
cp source/_index.html build/html/index.html