-
Notifications
You must be signed in to change notification settings - Fork 5
/
setup.py
57 lines (48 loc) · 1.75 KB
/
setup.py
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
# Copyright 2024 Garena Online Private Limited
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
"""Build the package."""
import os
import re
from io import open
from setuptools import find_packages, setup
here = os.path.abspath(os.path.dirname(__file__))
PACKAGE_NAME = "oat"
with open(os.path.join(here, "README.md"), encoding="utf-8") as f:
readme = f.read()
def _read_version():
VERSION_FILE = f"{PACKAGE_NAME}/__about__.py"
ver_str_line = open(VERSION_FILE, "rt").read()
version_re = r"^__version__ = ['\"]([^'\"]*)['\"]"
mo = re.search(version_re, ver_str_line, re.M)
if mo:
version = mo.group(1)
else:
raise RuntimeError(f"Unable to find version string in {VERSION_FILE}.")
return version
setup(
name=PACKAGE_NAME,
version=_read_version(),
author="Zichen Liu",
author_email="[email protected]",
description="Online AlignmenT (OAT) for LLMs.",
long_description=readme,
long_description_content_type="text/markdown",
url="https://github.com/sail-sg/oat",
license="Apache-2.0",
packages=find_packages(exclude=["examples*", "k8s*", "benchmark*", "test*"]),
include_package_data=True,
python_requires=">=3.8, <3.11",
setup_requires=["setuptools_scm>=7.0"],
zip_safe=False,
)