1+ SHELL := /bin/bash
12.DEFAULT_GOAL := help
23
34GIT_ROOT ?= $(shell git rev-parse --show-toplevel)
@@ -17,25 +18,10 @@ endif
1718CMD := docker run $(CNTR_ARGS )
1819TTY := docker run -t $(CNTR_ARGS )
1920
20- check_defined = \
21- $(strip $(foreach 1,$1, \
22- $(call __check_defined,$1,$(strip $(value 2) ) ) ) )
23- __check_defined = \
24- $(if $(value $1) ,, \
25- $(error Undefined $1$(if $2, ($2) )$(if $(value @) , \
26- required by target `$@ `) ) )
27-
2821__style_src := $(wildcard $(GIT_ROOT ) /scripts/ci/style/* .sh)
2922__style_name := ${__style_src:_check.sh=}
3023tools := $(foreach t, $(__style_name ) , ci-$(shell basename $(t ) ) )
3124
32- check-defined-% : __check_defined_FORCE
33- $(eval $@ _target := $(subst check-defined-, ,$@ ) )
34- @:$(call check_defined, $* , $@ _target)
35-
36- .PHONY : __check_defined_FORCE
37- __check_defined_FORCE :
38-
3925help : # # Show all Makefile targets
4026 @grep -E ' ^[a-zA-Z_-]+:.*?## .*$$' $(MAKEFILE_LIST ) | awk ' BEGIN {FS = ":.*?## "}; {printf "\033[33m%-30s\033[0m %s\n", $$1, $$2}'
4127
@@ -57,14 +43,13 @@ format: pull-checker-img ## Running code formatter: black and isort
5743 $(CMD ) ./scripts/tools/formatter.sh
5844lint : pull-checker-img # # Running lint checker: flake8 and pylint
5945 $(CMD ) ./scripts/tools/linter.sh
60- type : pull-checker-img # # Running type checker: mypy and pyright
46+ type : pull-checker-img # # Running type checker: pyright
6147 $(CMD ) ./scripts/tools/type_checker.sh
6248
63- ci-all : $(tools ) # # Running codestyle in CI: black, isort, flake8, pylint, mypy, pyright
49+ ci-all : $(tools ) # # Running codestyle in CI: black, isort, flake8, pylint, pyright
6450
6551ci-% : chore
6652 $(eval style := $(subst ci-, ,$@ ) )
67- $(eval SHELL :=/bin/bash)
6853 $(CMD ) ./scripts/ci/style/$(style ) _check.sh
6954
7055.PHONY : ci-format
@@ -74,21 +59,19 @@ ci-format: ci-black ci-isort ## Running format check in CI: black, isort
7459ci-lint : ci-flake8 ci-pylint # # Running lint check in CI: flake8, pylint
7560
7661.PHONY : ci-type
77- ci-type : ci-mypy ci- pyright # # Running type check in CI: mypy, pyright
62+ ci-type : ci-pyright # # Running type check in CI: pyright
7863
7964tests-% :
8065 $(eval type :=$(subst tests-, , $@ ) )
8166 $(eval RUN_ARGS:=$(wordlist 2,$(words $(MAKECMDGOALS ) ) ,$(MAKECMDGOALS ) ) )
8267 $(eval __positional:=$(foreach t, $(RUN_ARGS ) , --$(t ) ) )
83- $(eval SHELL :=/bin/bash)
8468ifeq ($(USE_POETRY ) ,true)
8569 ./scripts/ci/run_tests.sh -v --use-poetry $(type) $(__positional)
8670else
8771 ./scripts/ci/run_tests.sh -v $(type) $(__positional)
8872endif
8973
9074
91-
9275ifeq ($(USE_POETRY ) ,true)
9376install-local : # # Install BentoML with poetry
9477 @./scripts/init.sh
@@ -139,3 +122,17 @@ endif
139122
140123hooks : # # Install pre-defined hooks
141124 @./scripts/install_hooks.sh
125+
126+ check_defined = \
127+ $(strip $(foreach 1,$1, \
128+ $(call __check_defined,$1,$(strip $(value 2) ) ) ) )
129+ __check_defined = \
130+ $(if $(value $1) ,, \
131+ $(error Undefined $1$(if $2, ($2) )$(if $(value @) , \
132+ required by target `$@ `) ) )
133+ check-defined-% : __check_defined_FORCE
134+ $(eval $@ _target := $(subst check-defined-, ,$@ ) )
135+ @:$(call check_defined, $* , $@ _target)
136+
137+ .PHONY : __check_defined_FORCE
138+ __check_defined_FORCE :
0 commit comments