-
Notifications
You must be signed in to change notification settings - Fork 87
Expand file tree
/
Copy pathMakefile
More file actions
88 lines (66 loc) · 2.12 KB
/
Makefile
File metadata and controls
88 lines (66 loc) · 2.12 KB
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
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
OS := $(shell uname -s | tr A-Z a-z)
ARCH := $(shell uname -m)
PLATFORM := $(shell uname -m | sed -e 's/aarch64/arm64/' | sed -e 's/x86_64/amd64/')
PROJECT_DIR := $(realpath $(shell dirname $(firstword $(MAKEFILE_LIST))))
BIN_PATH=$(PROJECT_DIR)/bin
PIP_OPTS ?=
.PHONY: install
install: check-python check-gcloud install-gcloud-auth-plugin pip-install
.PHONY: install-dev
install-dev: check-python check-gcloud mkdir-bin pip-install pip-install-dev install-pytest install-lint
.PHONY: pip-install-dev
pip-install-dev:
pip install $(PIP_OPTS) -e ".[dev]"
.PHONY: pip-install
pip-install:
pip install $(PIP_OPTS) -e .
.PHONY: install-pytest
install-pytest:
pip install -U pytest
.PHONY: run-unittests
run-unittests:
XPK_TESTER=false XPK_VERSION_OVERRIDE=v0.0.0 pytest -vv src/xpk/
.PHONY: goldens
goldens:
XPK_TESTER=false XPK_VERSION_OVERRIDE=v0.0.0 TELEMETRY_TRASH_EXECUTION=true python3 tools/recipes.py update recipes/*.md
.PHONY: verify-goldens
verify-goldens:
XPK_TESTER=false XPK_VERSION_OVERRIDE=v0.0.0 TELEMETRY_TRASH_EXECUTION=true UPDATE_GOLDEN_COMMAND="make goldens" python3 tools/recipes.py golden recipes/*.md
.PHONY: mkdir-bin
mkdir-bin:
mkdir -p $(BIN_PATH)
.PHONY: install-gcloud-auth-plugin
install-gcloud-auth-plugin:
chmod +x tools/install-gke-auth-plugin.sh
./tools/install-gke-auth-plugin.sh
.PHONY: check-gcloud
check-gcloud:
gcloud version || (echo "gcloud not installed, use this link to install: https://cloud.google.com/sdk/docs/install" && exit 1)
.PHONY: check-python
check-python:
python3 --version || (echo "python3 not installed. Please install python in version required by xpk" && exit 1)
.PHONY: install-lint
install-lint: install-mypy install-pyink install-pylint pip-install
.PHONY: install-mypy
install-mypy:
pip install mypy~=1.17 types-PyYAML==6.0.2 types-docker~=7.1.0.0
.PHONY: install-pyink
install-pyink:
pip install pyink==24.3.0
.PHONY: install-pylint
install-pylint:
pip install pylint
.PHONY: verify
verify: pylint pyink mypy
.PHONY: pylint
pylint:
pylint $(shell git ls-files '*.py')
.PHONY: pyink
pyink:
pyink --check .
.PHONY: pyink-fix
pyink-fix:
pyink .
.PHONY: mypy
mypy:
mypy