-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
45 lines (34 loc) · 1.07 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
SRC_DIR := ./generic_k8s_webhook
TEST_DIR := ./tests
SRC_FILES := $(shell find $(SRC_DIR) -type f -name '*.py')
TEST_FILES := $(shell find $(TEST_DIR) -type f -name '*.py')
out/install-deps.stamp: pyproject.toml poetry.lock
poetry install
mkdir -p out
touch out/install-deps.stamp
install-deps: out/install-deps.stamp
out/build.stamp: install-deps $(SRC_FILES) $(TEST_FILES)
poetry build
touch out/build.stamp
build: out/build.stamp
.PHONY: lint
lint: build
poetry run isort $(SRC_DIR) $(TEST_DIR) -c
poetry run black $(SRC_DIR) $(TEST_DIR) --check
poetry run pylint $(SRC_DIR) -v
.PHONY: format
format: build
poetry run isort $(SRC_DIR) $(TEST_DIR)
poetry run black $(SRC_DIR) $(TEST_DIR)
.PHONY: unittests
unittests: build
poetry run pytest tests --timeout 15
.PHONY: check-pyproject
check-pyproject:
echo "Check the pyproject.toml has 'version = \"0.0.0\"'"
grep 'version = "0.0.0"' pyproject.toml
.PHONY: docker
docker:
docker build -t generic-k8s-webhook:latest .
all-tests: check-pyproject lint unittests docker
all-tests-seq: | check-pyproject lint unittests docker