paddlenlp
/
Makefile
77 строк · 1.9 Кб
1# Makefile for PaddleNLP
2#
3# GitHb: https://github.com/PaddlePaddle/PaddleNLP
4# Author: Paddle Team https://github.com/PaddlePaddle
5#
6
7.PHONY: all
8all : lint test
9check_dirs := applications examples model_zoo paddlenlp pipelines ppdiffusers scripts tests
10# # # # # # # # # # # # # # # Format Block # # # # # # # # # # # # # # #
11
12format:
13pre-commit run isort
14pre-commit run black
15
16# # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #
17
18# # # # # # # # # # # # # # # Lint Block # # # # # # # # # # # # # # #
19
20.PHONY: lint
21lint:
22$(eval modified_py_files := $(shell python scripts/get_modified_files.py $(check_dirs)))
23@if test -n "$(modified_py_files)"; then \
24echo ${modified_py_files}; \
25pre-commit run --files ${modified_py_files}; \
26else \
27echo "No library .py files were modified"; \
28fi
29
30# # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #
31
32# # # # # # # # # # # # # # # Test Block # # # # # # # # # # # # # # #
33
34.PHONY: test
35test: unit-test
36
37unit-test:
38PYTHONPATH=$(shell pwd) pytest -v \
39-n auto \
40--durations 20 \
41--cov paddlenlp \
42--cov-report xml:coverage.xml
43
44# # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #
45
46.PHONY: install
47install:
48pip install -r requirements-dev.txt
49pip install -r requirements.txt
50pip install -r paddlenlp/experimental/autonlp/requirements.txt
51pre-commit install
52
53
54.PHONY: deploy-ppdiffusers
55deploy-ppdiffusers:
56cd ppdiffusers && make install && make
57
58.PHONY: deploy-paddle-pipelines
59deploy-paddle-pipelines:
60cd pipelines && make install && make
61
62.PHONY: deploy-paddlenlp
63deploy-paddlenlp:
64# install related package
65make install
66# build
67python3 setup.py sdist bdist_wheel
68# upload
69twine upload --skip-existing dist/*
70
71.PHONY: regression-all
72release:
73bash ./scripts/regression/run_release.sh 0 0,1 all
74
75.PHONY: regression-key
76key:
77bash ./scripts/regression/run_release.sh 0 0,1 p0
78