generated from microsoft/python-package-template
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
40 lines (30 loc) · 838 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
32
33
34
35
36
37
38
39
40
# Adapted from https://raw.githubusercontent.com/huggingface/optimum/refs/heads/main/Makefile
SHELL := /bin/bash
CURRENT_DIR = $(shell pwd)
# DEFAULT_CLONE_URL := https://github.com/huggingface/optimum.git
# # If CLONE_URL is empty, revert to DEFAULT_CLONE_URL
# REAL_CLONE_URL = $(if $(CLONE_URL),$(CLONE_URL),$(DEFAULT_CLONE_URL))
.PHONY: style test
# Run code quality checks
style_check:
black --check .
ruff check .
style:
black .
ruff check . --fix
# Run tests for the library
test:
python -m pytest tests
# Utilities to release to PyPi
build_dist_install_tools:
pip install build
pip install twine
prepare: style test
echo "All checks passed. Ready to push."
push: prepare
git push origin main:main
build_dist:
rm -fr build
rm -fr dist
python -m build
.PHONY : build_dist_install_tools prepare push build_dist