-
Notifications
You must be signed in to change notification settings - Fork 3
/
Makefile
100 lines (81 loc) · 2.35 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
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
# Dependency Management
.PHONY: pydep
pydep:
pip install -r requirements/base.txt -r requirements/dev.txt
.PHONY: pylib
pylib:
pip install -e .
.PHONY: pydep-upgrade
pydep-upgrade:
pip install -U pip-tools
CUSTOM_COMPILE_COMMAND="make pydep-upgrade" pip-compile --output-file=serdio/requirements.txt serdio/pyproject.toml
CUSTOM_COMPILE_COMMAND="make pydep-upgrade" pip-compile --output-file=requirements/base.txt requirements/base.in
CUSTOM_COMPILE_COMMAND="make pydep-upgrade" pip-compile --output-file=requirements/dev.txt requirements/dev.in
pip install -r requirements/base.txt -r requirements/dev.txt
.PHONY: install
install: pydep pylib
.PHONY: install-release
install-release:
pip install -r requirements/base.txt
pip install .
# CI
.PHONY: fmt
fmt:
isort .
black .
.PHONY: lint
lint:
flake8 .
.PHONY: test
test:
pytest pycape
pytest serdio
pytest cape_encrypt
.PHONY: ci-ready
ci-ready: fmt lint test
# Releasing
.PHONY: bump-prep
bump-prep:
pip install -U bumpver
.PHONY: bump-patch
bump-patch: bump-prep
bumpver update --tag=final
bumpver update --patch --tag=rc --no-tag-commit
.PHONY: bump-minor
bump-minor: bump-prep
bumpver update --minor --tag=final
bumpver update --patch --tag=rc --no-tag-commit
.PHONY: bump-major
bump-major: bump-prep
bumpver update --major --tag=final
bumpver update --patch --tag=rc --no-tag-commit
# Docs
.PHONY: install-docs
install-docs:
pip install -U sphinx myst-parser sphinx-book-theme sphinx-copybutton sphinx-autodoc-typehints
pip install -U sphinx-book-theme~=0.3
pip install -U sphinx~=5.0
pip install ./cape_encrypt/
.PHONY: docs-clean
docs-clean:
find docs/source -name "*.rst" ! -name "index.rst" -exec rm {} \+
find docs/source -name "*.md" ! -name "walkthrough.md" -exec rm {} \+
cd docs && \
make clean && \
cd ..
.PHONY: docs-prep
docs-prep: install-docs install-release docs-clean
cp README.md docs/source/pycape-readme.md && \
cp serdio/README.md docs/source/serdio-readme.md && \
cp cape_encrypt/README.md docs/source/cape-encrypt-readme.md && \
cd docs && \
sphinx-apidoc -f -o source ../pycape "../pycape/*_test*" --separate && \
sphinx-apidoc -f -o source ../serdio "../serdio/*_test*" --separate && \
sphinx-apidoc -f -o source ../cape_encrypt "../cape_encrypt/*_test*" --separate && \
rm source/modules.rst && \
cd ..
.PHONY: docs
docs: docs-prep
cd docs && \
make html && \
cd ..