optimum-intel
/
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.
14SHELL := /bin/bash15CURRENT_DIR = $(shell pwd)16DEFAULT_CLONE_URL := https://github.com/huggingface/optimum-intel.git17# If CLONE_URL is empty, revert to DEFAULT_CLONE_URL
18REAL_CLONE_URL = $(if $(CLONE_URL),$(CLONE_URL),$(DEFAULT_CLONE_URL))19
20.PHONY: style test21
22# Run code quality checks
23style_check:24black --check .
25ruff .
26
27style:28black .
29ruff . --fix
30
31# Run tests for the library
32test:33python -m pytest tests
34
35# Utilities to release to PyPi
36build_dist_install_tools:37pip install build
38pip install twine
39
40build_dist:41rm -fr build
42rm -fr dist
43python -m build
44
45pypi_upload: build_dist46python -m twine upload dist/*
47
48build_doc_docker_image:49docker build -t doc_maker --build-arg commit_sha=$(COMMIT_SHA_SUBPACKAGE) --build-arg clone_url=$(REAL_CLONE_URL) ./docs50
51doc: build_doc_docker_image52@test -n "$(BUILD_DIR)" || (echo "BUILD_DIR is empty." ; exit 1)53@test -n "$(VERSION)" || (echo "VERSION is empty." ; exit 1)54docker run -v $(CURRENT_DIR):/doc_folder --workdir=/doc_folder doc_maker \55doc-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