-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathPoetry.mk
63 lines (51 loc) · 2.25 KB
/
Poetry.mk
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
POETRY_HOME ?= ${HOME}/.local/share/pypoetry
POETRY_BINARY ?= ${POETRY_HOME}/venv/bin/poetry
POETRY_VERSION ?= 1.2.0
.PHONY: build
build: ## Build galaxy-mk2 package
echo "[build] Build galaxy-mk2 package."
${POETRY_BINARY} build
.PHONY: install
install: ## Install galaxy-mk2 with poetry
@build/install.sh
.PHONY: image
image: ## Build galaxy-mk2 image
@build/image.sh
.PHONY: metrics
metrics: install ## Run galaxy-mk2 metrics checks
echo "[metrics] Run galaxy-mk2 PEP 8 checks."
${POETRY_BINARY} run flake8 --select=E,W,I --max-line-length 80 --import-order-style pep8 --statistics --count galaxy_mk2
echo "[metrics] Run galaxy-mk2 PEP 257 checks."
${POETRY_BINARY} run flake8 --select=D --ignore D301 --statistics --count galaxy_mk2
echo "[metrics] Run galaxy-mk2 pyflakes checks."
${POETRY_BINARY} run flake8 --select=F --statistics --count galaxy_mk2
echo "[metrics] Run galaxy-mk2 code complexity checks."
${POETRY_BINARY} run flake8 --select=C901 --statistics --count galaxy_mk2
echo "[metrics] Run galaxy-mk2 open TODO checks."
${POETRY_BINARY} run flake8 --select=T --statistics --count galaxy_mk2 tests
echo "[metrics] Run galaxy-mk2 black checks."
${POETRY_BINARY} run black -l 80 --check galaxy_mk2
.PHONY: unit-test
unit-test: install ## Run galaxy-mk2 unit tests
echo "[unit-test] Run galaxy-mk2 unit tests."
${POETRY_BINARY} run pytest tests/unit
.PHONY: integration-test
integration-test: install ## Run galaxy-mk2 integration tests
echo "[unit-test] Run galaxy-mk2 integration tests."
${POETRY_BINARY} run pytest tests/integration
.PHONY: coverage
coverage: install ## Run galaxy-mk2 tests coverage
echo "[coverage] Run galaxy-mk2 tests coverage."
${POETRY_BINARY} run pytest --cov-config=.coveragerc --cov=galaxy_mk2 --cov-fail-under=90 --cov-report=xml --cov-report=term-missing tests
.PHONY: test
test: unit-test integration-test ## Run galaxy-mk2 tests
.PHONY: docs
docs: install ## Build galaxy-mk2 documentation
echo "[docs] Build galaxy-mk2 documentation."
${POETRY_BINARY} run sphinx-build docs site
.PHONY: dev-env
dev-env: image ## Start a local Kubernetes cluster using minikube and deploy application
@build/dev-env.sh
.PHONY: clean
clean: ## Remove .cache directory and cached minikube
minikube delete && rm -rf ~/.cache ~/.minikube