-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathMakefile
More file actions
57 lines (42 loc) · 1.08 KB
/
Makefile
File metadata and controls
57 lines (42 loc) · 1.08 KB
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
ifneq ("$(wildcard .env)","")
include .env
endif
COMMIT_MSG_TEMPLATE = ":bookmark: Release \`v{version}\`"
SOURCES_DIR = "./electro"
# region Style
.PHONY: style
style:
poetry run black $(SOURCES_DIR)
poetry run isort $(SOURCES_DIR)
poetry run pylint $(SOURCES_DIR)
.PHONY: docs
docs:
set -a && source .env && set +a && \
sphinx-apidoc --force --append-syspath --output-dir ./docs/source electro && \
cd docs && $(MAKE) html
# endregion
# region Versioning
.PHONY: commit_version
commit_version:
@{ \
git add pyproject.toml; \
VERSION=$$(poetry version | cut -d' ' -f2); \
COMMIT_MSG=$$(echo $(COMMIT_MSG_TEMPLATE) | sed "s/{version}/$${VERSION}/g"); \
echo "Bumped version: $${VERSION}"; \
echo "Generated Commit Message: $${COMMIT_MSG}"; \
git commit -m "$${COMMIT_MSG}" -- pyproject.toml; \
git tag "v$${VERSION}"; \
}
.PHONY: bump-major
bump-major:
poetry version major
$(MAKE) commit_version
.PHONY: bump-minor
bump-minor:
poetry version minor
$(MAKE) commit_version
.PHONY: bump-patch
bump-patch:
poetry version patch
$(MAKE) commit_version
# endregion