-
Notifications
You must be signed in to change notification settings - Fork 8
/
Copy pathMakefile
58 lines (46 loc) · 1.46 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
GREEN := $(shell tput -Txterm setaf 2)
YELLOW := $(shell tput -Txterm setaf 3)
BOLD := $(shell tput -Txterm bold)
ULINE := $(shell tput -Txterm smul)
RESET := $(shell tput -Txterm sgr0)
.DEFAULT_GOAL:=help
.PHONY: help
help:
@echo ''
@echo '${ULINE}Usage:${RESET}'
@echo ' ${YELLOW}make${RESET} ${GREEN}<TARGET>${RESET}'
@echo ''
@echo ''
@echo '${ULINE}Targets:${RESET}'
@awk 'BEGIN {FS = ":.*?## "} { \
if (/^[a-zA-Z_-]+:.*?##.*$$/) {printf " ${BOLD}${GREEN}%-20s${RESET}%s\n", $$1, $$2} \
else if (/^## .*$$/) {printf "\n ${CYAN}[%s]${RESET}\n", substr($$1,4)} \
}' $(MAKEFILE_LIST)
## Lifecycle
.PHONY: dev
dev: ## Create dev venv, (re-)install project in it
@python tools/initialize.py
.PHONY: clean
clean: ## Remove: project/nox venvs, built docs
@rm -rf .nox .venv docs/_build
## Docs
.PHONY: docs
changelog: dev ## Render changelog. Requires VERSION parameter.
@if [ -z "$(VERSION)" ]; then \
echo "Missing VERSION parameter. Example: make changelog VERSION=1.0.0" >&2; exit 1; \
fi; \
source .venv/bin/activate; \
towncrier build --yes --version='$(VERSION)'
.PHONY: docs
docs: dev ## Build docs
@source .venv/bin/activate; \
nox -e docs --extra-pythons=3.10 --python=3.10
.PHONY: docs-dev
docs-dev: dev ## Build docs, serve them and refresh on changes
@source .venv/bin/activate; \
nox -e docs-dev --extra-pythons=3.10 --python=3.10
## Tests
.PHONY: tests
tests: dev ## Run tests
@source .venv/bin/activate; \
nox -e tests-3.10