forked from bentoml/OpenLLM
-
Notifications
You must be signed in to change notification settings - Fork 0
/
hatch.toml
156 lines (149 loc) · 5.1 KB
/
hatch.toml
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
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
[metadata.hooks.fancy-pypi-readme]
content-type = "text/markdown"
# PyPI doesn't support the <picture> tag.
[[metadata.hooks.fancy-pypi-readme.fragments]]
text = """
<p align="center">
<a href="https://github.com/bentoml/openllm">
<img src="https://raw.githubusercontent.com/bentoml/openllm/main/assets/main-banner.png" alt="Banner for OpenLLM" />
</a>
</p>
"""
[[metadata.hooks.fancy-pypi-readme.fragments]]
end-before = "\n<!-- hatch-fancy-pypi-readme intro stop -->"
path = "README.md"
start-after = "<!-- hatch-fancy-pypi-readme intro start -->\n"
[[metadata.hooks.fancy-pypi-readme.fragments]]
text = """
<p align="center">
<img src="https://raw.githubusercontent.com/bentoml/openllm/main/assets/output.gif" alt="Gif showing OpenLLM Intro" />
</p>
"""
[[metadata.hooks.fancy-pypi-readme.fragments]]
end-before = "\n<!-- hatch-fancy-pypi-readme interim stop -->"
path = "README.md"
start-after = "<!-- hatch-fancy-pypi-readme interim start -->\n"
[[metadata.hooks.fancy-pypi-readme.fragments]]
text = """
<p align="center">
<img src="https://raw.githubusercontent.com/bentoml/openllm/main/assets/agent.gif" alt="Gif showing Agent integration" />
</p>
"""
[[metadata.hooks.fancy-pypi-readme.fragments]]
end-before = "\n<!-- hatch-fancy-pypi-readme meta stop -->"
path = "README.md"
start-after = "<!-- hatch-fancy-pypi-readme meta start -->\n"
[[metadata.hooks.fancy-pypi-readme.fragments]]
text = """
## Release Information
"""
[[tool.hatch.metadata.hooks.fancy-pypi-readme.fragments]]
path = "CHANGELOG.md"
pattern = "\n(###.+?\n)## "
start-after = "<!-- towncrier release notes start -->"
[[metadata.hooks.fancy-pypi-readme.fragments]]
text = """
---
[Click me for full changelog](https://github.com/bentoml/openllm/blob/main/CHANGELOG.md)
"""
[version]
fallback-version = "0.0.0"
source = "vcs"
[build.hooks.vcs]
version-file = "src/openllm/_version.py"
[version.raw-options]
git_describe_command = ["git", "describe", "--dirty", "--tags", "--long", "--first-parent"]
local_scheme = "no-local-version"
[metadata]
allow-direct-references = true
[build.targets.wheel]
packages = ["src/openllm", "src/openllm_client"]
[build.targets.sdist]
exclude = ["/.github", "/typings", "/examples", "/assets", "/changelog.d", "/tools", ".git"]
[envs.default]
dependencies = [
# NOTE: To run all hooks
"pre-commit",
# NOTE: towncrier for changelog
"towncrier",
# NOTE: Using under ./tools/update-optional-dependencies.py
"tomlkit",
# NOTE: Using under ./tools/update-readme.py
"markdown-it-py",
# NOTE: For fancy PyPI readme
"hatch-fancy-pypi-readme",
# The below sync with mypyc deps and pre-commit mypy
"types-psutil",
"types-tabulate",
"types-PyYAML",
"types-protobuf",
]
[envs.default.scripts]
changelog = "towncrier build --version main --draft"
inplace-changelog = "towncrier build --version main --keep"
quality = [
"./tools/dependencies.py",
"./tools/update-readme.py",
"./tools/update-config-stubs.py",
"./tools/update-models-import.py",
"- ./tools/add-license-headers .",
"pre-commit run --all-files",
]
setup = "pre-commit install"
typing = ["- pre-commit run mypy {args:-a}", "- pre-commit run pyright {args:-a}"]
[envs.tests]
dependencies = [
# NOTE: interact with docker for container tests.
"docker",
# NOTE: Tests strategies with Hypothesis and pytest, and snapshot testing with syrupy
"coverage[toml]>=6.5",
"filelock>=3.7.1",
"pytest",
"pytest-cov",
"pytest-mock",
"pytest-randomly",
"pytest-rerunfailures",
"pytest-asyncio>=0.21.0",
"pytest-xdist[psutil]",
"trustme",
"hypothesis",
"syrupy",
]
features = ['flan-t5', 'baichuan']
skip-install = false
template = 'tests'
[envs.tests.scripts]
_run_script = "pytest --cov --cov-report={env:COVERAGE_REPORT:term-missing} --cov-config=pyproject.toml -vv"
distributed = "_run_script --reruns 5 --reruns-delay 3 --ignore tests/models -n 3 -r aR {args:tests}"
models = "_run_script -s {args:tests/models}"
python = "_run_script --reruns 5 --reruns-delay 3 --ignore tests/models -r aR {args:tests}"
snapshot-models = "_run_script -s --snapshot-update {args:tests/models}"
[envs.tests.overrides]
env.GITHUB_ACTIONS.env-vars = "COVERAGE_REPORT="
[envs.coverage]
dependencies = ["coverage[toml]>=6.5", "lxml", "orjson"]
detached = true
[envs.coverage.scripts]
combine = "coverage combine {args}"
generate-summary = "python tools/generate-coverage.py"
report-uncovered-html = "coverage html --skip-covered --skip-empty"
report-xml = "coverage xml"
write-summary-report = "python tools/write-coverage-report.py"
[build.targets.wheel.hooks.mypyc]
dependencies = [
"hatch-mypyc>=0.14.1",
"mypy==1.4.1",
"click==8.1.3", # avoid https://github.com/pallets/click/issues/2558
"peft",
"git+https://github.com/bentoml/BentoML.git@main",
"git+https://github.com/huggingface/transformers.git@main",
"types-psutil",
"types-tabulate",
"types-PyYAML",
"types-protobuf",
]
enable-by-default = false
mypy-args = ["--no-warn-unused-ignores"]
options = { debug_level = "0", strip_asserts = true }
require-runtime-dependencies = true
require-runtime-features = ["agents", "chatglm", "opt"]