This repository has been archived by the owner on Aug 19, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
73 lines (49 loc) · 1.65 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
SHELL := /bin/sh -e
TEST_GROUP ?= unit
K8S_NAMESPACE ?= test
.DEFAULT_GOAL := help
# Helper
.PHONY: help
help: ## Display this auto-generated help message
@grep -E '^[0-9a-zA-Z_-]+:.*?## .*$$' $(MAKEFILE_LIST) | awk 'BEGIN {FS = ":.*?## "}; {printf "\033[36m%-30s\033[0m %s\n", $$1, $$2}'
# Installation
.PHONY: update install
update: ## Lock and install build dependencies
poetry update
install: ## Install build dependencies from lock file
poetry install -E runner -E deployment
# Development
.PHONY: clean format circleci setup-py k8s-apply
clean: ## Clean project from temp files / dirs
rm -rf build dist
find src -type d -name __pycache__ | xargs rm -rf
format: ## Run pydocstyle docstring linter
poetry run black src
poetry run isort src
circleci: ## Run circleci deployment workflow
poetry run black --check src
poetry run isort --check-only src
poetry run pydocstyle src
poetry run flake8 src
poetry run mypy src
poetry run pytest src/tests/test_${TEST_GROUP}
setup-py: ## Create project setup.py for editable installs
poetry run dephell deps convert
k8s-apply: ## Update kubernetes resources
kubectl -n ${K8S_NAMESPACE} apply -f kubernetes/
# Testing
.PHONY: lint test
lint: ## Run python linters
poetry run black --check src
poetry run isort --check-only src
poetry run pydocstyle src
poetry run flake8 src
poetry run mypy src
test: ## Run pytest with grouped tests
poetry run pytest src/tests/test_${TEST_GROUP}
# Deployment
.PHONY: package release
package: ## Build project wheel distribution
poetry build
release: ## Publish wheel distribution to PyPi
poetry publish --build -u ${PYPI_USERNAME} -p ${PYPI_PASSWORD}