forked from bentoml/OpenLLM
-
Notifications
You must be signed in to change notification settings - Fork 0
/
hatch.toml
83 lines (83 loc) · 2.96 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
[envs.default]
dependencies = [
"openllm-core @ {root:uri}/openllm-core",
"openllm-client @ {root:uri}/openllm-client",
"openllm[chatglm,fine-tune] @ {root:uri}/openllm-python",
# NOTE: To run all hooks
"pre-commit",
# NOTE: towncrier for changelog
"towncrier",
# NOTE: Using under ./tools/update-optional-dependencies.py
"tomlkit",
# NOTE: For fancy PyPI readme
"hatch-fancy-pypi-readme",
# NOTE: For working with shell pipe
"plumbum",
# 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"
setup = [
"pre-commit install",
"- ln -s .python-version-default .python-version",
]
quality = ["bash ./all.sh", "- pre-commit run --all-files", "- pnpm format"]
tool = ["quality", "bash ./clean.sh", 'python ./cz.py']
[envs.tests]
dependencies = [
"openllm-core @ {root:uri}/openllm-core",
"openllm-client @ {root:uri}/openllm-client",
"openllm[chatglm,fine-tune] @ {root:uri}/openllm-python",
# 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",
]
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 openllm-python/tests/models -n 3 -r aR {args:openllm-python/tests}"
models = "_run_script -s {args:openllm-python/tests/models}"
python = "_run_script --reruns 5 --reruns-delay 3 --ignore openllm-python/tests/models -r aR {args:openllm-python/tests}"
snapshot-models = "_run_script -s --snapshot-update {args:openllm-python/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 {args}"
report-xml = "coverage xml {args}"
write-summary-report = "python tools/write-coverage-report.py"
[envs.ui]
detached = true
[envs.ui.scripts]
server = "openllm start {args:facebook/opt-250m} --working-dir {root:uri} --cors --debug"
docs = "cd docs && pnpm dev"
[envs.ci]
detached = true
[envs.ci.scripts]
client-stubs = "bash openllm-client/generate-grpc-stubs"
compile = "bash ./tools/compile.sh {args}"
recompile = ["bash ./clean.sh", "compile"]
edi = "bash local.sh"
lock = ["bash tools/lock-actions.sh"]