forked from flyteorg/flytekit
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
60 lines (48 loc) · 1.88 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
define PIP_COMPILE
pip-compile $(1) --upgrade --verbose
endef
.SILENT: help
.PHONY: help
help:
echo Available recipes:
cat $(MAKEFILE_LIST) | grep -E '^[a-zA-Z0-9_-]+:.*?## .*$$' | awk 'BEGIN { FS = ":.*?## " } { cnt++; a[cnt] = $$1; b[cnt] = $$2; if (length($$1) > max) max = length($$1) } END { for (i = 1; i <= cnt; i++) printf " $(shell tput setaf 6)%-*s$(shell tput setaf 0) %s\n", max, a[i], b[i] }'
tput sgr0
.PHONY: install-piptools
install-piptools:
pip install -U pip-tools
.PHONY: setup
setup: install-piptools ## Install requirements
pip-sync requirements.txt dev-requirements.txt
.PHONY: setup-spark3
setup-spark3: install-piptools ## Install requirements
pip-sync requirements-spark3.txt dev-requirements.txt
.PHONY: fmt
fmt: ## Format code with black and isort
black .
isort .
.PHONY: lint
lint: ## Run linters
mypy || true
flake8 .
.PHONY: test
test: lint ## Run tests
pytest tests/flytekit/unit
pytest tests/scripts
pytest plugins/tests
shellcheck **/*.sh
requirements-spark3.txt: export CUSTOM_COMPILE_COMMAND := make requirements-spark3.txt
requirements-spark3.txt: requirements-spark3.in install-piptools
$(call PIP_COMPILE,requirements-spark3.in)
requirements.txt: export CUSTOM_COMPILE_COMMAND := make requirements.txt
requirements.txt: requirements.in install-piptools
$(call PIP_COMPILE,requirements.in)
dev-requirements.txt: export CUSTOM_COMPILE_COMMAND := make dev-requirements.txt
dev-requirements.txt: dev-requirements.in requirements.txt install-piptools
$(call PIP_COMPILE,dev-requirements.in)
.PHONY: requirements
requirements: requirements.txt dev-requirements.txt requirements-spark3.txt ## Compile requirements
# TODO: Change this in the future to be all of flytekit
.PHONY: coverage
coverage:
coverage run -m pytest tests/flytekit/unit/annotated flytekit/types plugins/tests
coverage report -m --include="flytekit/annotated/*,flytekit/types/*,plugins/*"