-
Notifications
You must be signed in to change notification settings - Fork 1
/
Makefile
57 lines (43 loc) · 1.36 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
# const
.DEFAULT_GOAL := help
# MAIN TASKS ##################################################################
.PHONY: help
help: all
@grep -E '^[a-zA-Z_-]+:.*?## .*$$' $(MAKEFILE_LIST) | awk 'BEGIN {FS = ":.*?## "}; {printf "\033[36m%-30s\033[0m %s\n", $$1, $$2}'
# PROJECT DEPENDENCIES ########################################################
install: .install .cache ## Install project dependencies
.install: poetry.lock
$(MAKE) configure
poetry install --with docs
poetry check
@touch $@
poetry.lock: pyproject.toml
$(MAKE) configure
poetry lock
@touch $@
.cache:
@mkdir -p .cache
.PHONY: configure
configure:
@poetry config virtualenvs.in-project true
@poetry self add poetry-plugin-export
@poetry self add 'poethepoet[poetry_plugin]'
@poetry run python -m pip install --upgrade pip
@poetry run python -m pip install --upgrade setuptools
# git util #####################################################################
.PHONY: next-patch-version
next-patch-version: ## Increment patch version
$(MAKE) configure
git checkout main
git pull
poetry version patch
$(MAKE) install
git add .
git commit -m "Next version"
git push origin main
.PHONY: tag
tag: ## Tags current repository
git diff --name-only --exit-code
@PROJECT_RELEASE=$$(poetry version | awk 'END {print $$NF}') ; \
git tag "v$$PROJECT_RELEASE" ; \
git push origin "v$$PROJECT_RELEASE"