-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathMakefile
38 lines (30 loc) · 927 Bytes
/
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
.PHONY: help
help: ## List all the command helps.
@awk 'BEGIN {FS = ":.*?## "} /^[a-zA-Z_-]+:.*?## / {printf "\033[36m%-30s\033[0m %s\n", $$1, $$2}' $(MAKEFILE_LIST)
.PHONY: init-pre-commit
init-pre-commit: ## Init pre-commit.
@pre-commit install
@pre-commit install --hook-type commit-msg
.PHONY: test
test: ## Run tests.
@pytest -vv
@mypy
.PHONY: tox
tox: ## Run tests on all python versions.
@tox
.PHONY: lint
lint: ## Check linter.
@pre-commit run --all-files
.PHONY: coverage-html
coverage-html: ## Run pytest with html output coverage.
@pytest --cov-report html
.PHONY: ci
ci: lint test ## Run CI.
.PHONY: bump-version
bump-version: check-version ## Bump version, define target version with "VERSION=*.*.*".
@sed -i "s/^\(version = \"\)\(.\)*\"/\1${VERSION}\"/" pyproject.toml
@echo "Version replaced by ${VERSION} in 'pyproject.toml'"
check-version:
ifndef VERSION
$(error VERSION is undefined)
endif