-
Notifications
You must be signed in to change notification settings - Fork 10
/
Makefile
91 lines (66 loc) · 1.95 KB
/
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
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
.PHONY: setup
venv:
@python3.8 -m venv venv
-ln -s venv/bin .
-ln -s venv/bin/activate .
dev: venv
@bin/pip3 install wikipedia jupyter docker
test:
@bin/pytest
setup: venv
@bin/pip3 install -U pip build twine
@bin/pip3 install -e .
# Define the package name and version
PKG_NAME := py-llm-core
MOD_NAME := py_llm_core
PKG_VERSION := 3.5.0
# Define the directory where the package source code is located
PKG_DIR := $(shell pwd)
# Define the directory where the built packages will be stored
BUILD_DIR := dist
# Define the directory where the package source code will be checked out
SRC_DIR := $(PKG_DIR)/src
# Define the URL of the Git repository
GIT_REPO_URL := https://github.com/advanced-stack/$(PKG_NAME).git
# Define the command to run Python
PYTHON := venv/bin/python3
# Define the command to run pip
PIP := pip3
# Define the command to run setuptools
SETUPTOOLS := $(PIP) install --upgrade setuptools
# Define the command to run twine
TWINE := venv/bin/twine
# Define the command to run git
GIT := git
# Define the command to run the build script
BUILD := $(PYTHON) -m build
# Define the command to check the built packages
CHECK := $(TWINE) check $(BUILD_DIR)/*
# Define the target to create a new Git tag
tag:
@echo "Creating new Git tag $(PKG_VERSION)"
@$(GIT) tag -a $(PKG_VERSION) -m "Release version $(PKG_VERSION)"
# Define the target to push the Git tag to the remote repository
push:
@echo "Pushing Git tag $(PKG_VERSION) to remote repository"
@$(GIT) push --follow-tags
# Define the target to build the package
build:
@echo "Building package $(PKG_NAME)-$(PKG_VERSION)"
@$(SETUPTOOLS)
@$(BUILD)
# Define the target to check the built packages
check:
@echo "Checking built packages"
@$(CHECK)
# Define the target to upload the built packages to PyPI
upload:
@echo "Uploading built packages to PyPI"
$(TWINE) upload $(BUILD_DIR)/*
display-version:
echo ${PKG_VERSION}
release:
make build
make tag
make upload
git push --follow-tags