optimum-intel

Форк
0
/
Makefile 
61 строка · 1.8 Кб
1
#  Copyright 2021 The HuggingFace Team. All rights reserved.
2
#
3
#  Licensed under the Apache License, Version 2.0 (the "License");
4
#  you may not use this file except in compliance with the License.
5
#  You may obtain a copy of the License at
6
#
7
#      http://www.apache.org/licenses/LICENSE-2.0
8
#
9
#  Unless required by applicable law or agreed to in writing, software
10
#  distributed under the License is distributed on an "AS IS" BASIS,
11
#  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12
#  See the License for the specific language governing permissions and
13
#  limitations under the License.
14
SHELL := /bin/bash
15
CURRENT_DIR = $(shell pwd)
16
DEFAULT_CLONE_URL := https://github.com/huggingface/optimum-intel.git
17
# If CLONE_URL is empty, revert to DEFAULT_CLONE_URL
18
REAL_CLONE_URL = $(if $(CLONE_URL),$(CLONE_URL),$(DEFAULT_CLONE_URL))
19

20
.PHONY:	style test
21

22
# Run code quality checks
23
style_check:
24
	black --check .
25
	ruff .
26

27
style:
28
	black .
29
	ruff . --fix
30

31
# Run tests for the library
32
test:
33
	python -m pytest tests
34

35
# Utilities to release to PyPi
36
build_dist_install_tools:
37
	pip install build
38
	pip install twine
39

40
build_dist:
41
	rm -fr build
42
	rm -fr dist
43
	python -m build
44

45
pypi_upload: build_dist
46
	python -m twine upload dist/*
47

48
build_doc_docker_image:
49
	docker build -t doc_maker --build-arg commit_sha=$(COMMIT_SHA_SUBPACKAGE) --build-arg clone_url=$(REAL_CLONE_URL) ./docs
50

51
doc: build_doc_docker_image
52
	@test -n "$(BUILD_DIR)" || (echo "BUILD_DIR is empty." ; exit 1)
53
	@test -n "$(VERSION)" || (echo "VERSION is empty." ; exit 1)
54
	docker run -v $(CURRENT_DIR):/doc_folder --workdir=/doc_folder doc_maker \
55
	doc-builder build optimum.intel /optimum-intel/docs/source/ \
56
		--repo_name optimum-intel \
57
		--build_dir $(BUILD_DIR) \
58
		--version $(VERSION) \
59
		--version_tag_suffix "" \
60
		--html \
61
		--clean
62

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

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

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

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