-
Notifications
You must be signed in to change notification settings - Fork 19
/
Makefile
31 lines (25 loc) · 925 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
PYTHON ?= python3
ADDITIONAL_DEPS ?=
current_dir := $(shell pwd | sed 's:/*$$::')
.PHONY: build
build: $(LIB)
$(PYTHON) setup.py bdist_wheel --universal
@printf "\033[0;32mPIP package built\033[0m: "
@ls dist/*.whl
.PHONY: test
test: $(LIB)
cd tests; bash run_tests.sh
.PHONY: lint
lint:
git config --global --add safe.directory $(current_dir)
@$(PYTHON) -m pip install pylint==2.16.1 -i http://mirrors.aliyun.com/pypi/simple/ --trusted-host mirrors.aliyun.com
@$(PYTHON) -m pylint \
--rcfile=.pylintrc --output-format=parseable --jobs=8 \
$(shell git ls-tree --full-tree --name-only -r HEAD chatlearn | grep \.py$) \
$(shell git diff --cached --name-only chatlearn | grep \.py$) \
$(shell git ls-tree --full-tree --name-only -r HEAD examples/megatron/ | grep \.py$) \
$(shell git diff --cached --name-only examples/megatron/ | grep \.py$) \
.PHONY: doc
doc:
cd docs; make html
.DEFAULT_GOAL := lint