-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
40 lines (32 loc) · 1018 Bytes
/
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
all: build
build: build_proto
@rm -rf dist
@poetry install
@poetry build
# .proto file and generated Python files have to be in the same directory.
# See known issue https://github.com/grpc/grpc/issues/29459.
PROTO_DIR_PATH_INSIDE_PACKAGE=tensorlake/function_executor/proto
PROTO_DIR_PATH=src/${PROTO_DIR_INSIDE_PACKAGE}
build_proto:
@poetry install
@cd src && poetry run python -m grpc_tools.protoc \
--proto_path=. \
--python_out=. \
--pyi_out=. \
--grpc_python_out=. \
${PROTO_DIR_PATH_INSIDE_PACKAGE}/function_executor.proto
@#The generated proto files don't pass linter checks and need to get reformatted.
@poetry run black ${PROTO_DIR_PATH}
@poetry run isort ${PROTO_DIR_PATH} --profile black
fmt:
@poetry run black .
@poetry run isort . --profile black
check:
@poetry run black --check .
@poetry run isort . --check-only --profile black
lint:
@poetry run pylint tensorlake
@poetry run black --check .
test:
cd tests && ./run_tests.sh
.PHONY: all build build_proto fmt lint test