paddlenlp

Форк
0
/
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
8
all : lint test
9
check_dirs := applications examples model_zoo paddlenlp pipelines ppdiffusers scripts tests 
10
# # # # # # # # # # # # # # # Format Block # # # # # # # # # # # # # # # 
11

12
format:
13
	pre-commit run isort
14
	pre-commit run black
15

16
# # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #
17

18
# # # # # # # # # # # # # # # Lint Block # # # # # # # # # # # # # # # 
19

20
.PHONY: lint
21
lint:
22
	$(eval modified_py_files := $(shell python scripts/get_modified_files.py $(check_dirs)))
23
	@if test -n "$(modified_py_files)"; then \
24
		echo ${modified_py_files}; \
25
		pre-commit run --files ${modified_py_files}; \
26
	else \
27
		echo "No library .py files were modified"; \
28
	fi	
29

30
# # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #
31

32
# # # # # # # # # # # # # # # Test Block # # # # # # # # # # # # # # # 
33

34
.PHONY: test
35
test: unit-test
36

37
unit-test:
38
	PYTHONPATH=$(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
47
install:
48
	pip install -r requirements-dev.txt
49
	pip install -r requirements.txt
50
	pip install -r paddlenlp/experimental/autonlp/requirements.txt
51
	pre-commit install
52

53

54
.PHONY: deploy-ppdiffusers
55
deploy-ppdiffusers:
56
	cd ppdiffusers && make install && make
57

58
.PHONY: deploy-paddle-pipelines
59
deploy-paddle-pipelines:
60
	cd pipelines && make install && make
61

62
.PHONY: deploy-paddlenlp
63
deploy-paddlenlp:
64
	# install related package
65
	make install
66
	# build
67
	python3 setup.py sdist bdist_wheel
68
	# upload
69
	twine upload --skip-existing dist/*
70

71
.PHONY: regression-all
72
release: 
73
	bash ./scripts/regression/run_release.sh 0 0,1 all
74

75
.PHONY: regression-key
76
key: 
77
	bash ./scripts/regression/run_release.sh 0 0,1 p0
78

Использование cookies

Мы используем файлы cookie в соответствии с Политикой конфиденциальности и Политикой использования cookies.

Нажимая кнопку «Принимаю», Вы даете АО «СберТех» согласие на обработку Ваших персональных данных в целях совершенствования нашего веб-сайта и Сервиса GitVerse, а также повышения удобства их использования.

Запретить использование cookies Вы можете самостоятельно в настройках Вашего браузера.