-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathpyproject.toml
113 lines (100 loc) · 3.21 KB
/
pyproject.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
[project]
name = "gerd"
version = "0.6.1"
description = "Add your description here"
readme = "README.md"
requires-python = ">=3.10, <3.13"
dependencies = [
"fastapi>=0.115.5",
"faiss-cpu>=1.9.0.post1",
"jinja2>=3.1.4",
"langchain>=0.3.7",
"langchain-community>=0.3.7",
"langchain-huggingface>=0.1.2",
"orjson>=3.10.11",
"pydantic>=2.10.1",
"pydantic-settings>=2.6.1",
"pypdf>=5.1.0",
"requests>=2.32.3",
"sentence-transformers>=3.3.1",
"torch>=2.5",
"transformers>=4.46.2",
"uvicorn>=0.32.1",
"peft>=0.14.0",
"datasets>=3.2.0",
"gradio>=5.12",
]
[project.optional-dependencies]
llama-cpp = ["llama-cpp-python>=0.3.2"]
full = ["gerd[llama-cpp]"]
[dependency-groups]
dev = [
"gerd[full]",
"mypy>=1.13.0",
"pre-commit>=4.0.1",
"poethepoet>=0.30.0",
"pytest>=8.3.3",
"pytest-mock>=3.14.0",
"types-pyyaml>=6.0.12.20240917",
"types-requests>=2.32.0.20241016",
"ipykernel>=6.29.5",
"ipywidgets>=8.1.5",
"gitpython>=3.1.44",
]
[[tool.uv.index]]
name = "llama-cpp-prebuilt"
url = "https://abetlen.github.io/llama-cpp-python/whl/metal"
explicit = true
[tool.uv.sources]
llama-cpp-python = [
{ index = "llama-cpp-prebuilt", marker = "sys_platform == 'darwin'" },
]
[tool.poe.tasks]
test = "pytest -x"
lint = "mypy gerd"
qa_dev = "gradio gerd/frontends/qa_frontend.py"
gen_dev = "gradio gerd/frontends/gen_frontend.py"
router_dev = "gradio gerd/frontends/router.py"
training_dev = "gradio gerd/frontends/training.py"
router = "python -m gerd.frontends.router"
server = "python -m gerd.backends.rest_server"
release = "python release.py"
# for better isolation run manual tests separately
test_manual_transformers = "python -m pytest tests/test_no_auto.py -k 'generation_transformers' --no-skip"
test_manual_llama = "python -m pytest tests/test_no_auto.py -k 'generation_llama_cpp' --no-skip"
test_manual = ["test_manual_transformers", "test_manual_llama"]
[tool.ruff.lint]
# 1. Enable flake8-bugbear (`B`) rules, in addition to the defaults.
select = [
"E", # pycodestyle errors
"W", # pycodestyle warnings
"I", # isort (imports) styling
"N", # pep8 naming checks
"B", # bugbear checks
"ANN", # type annotations
"S", # bandid code security
"C", # improve code comprehension
"EM", # use recommended error message composition
"G", # use recommended logging format
"T20", # no print allowed
"PT", # pytest styling recommendations
"SLF", # prevent access to private members
"SIM", # code simplification recommendations
"TCH", # checks for type checking imports
"ARG", # no unused arguments
"PERF", # performance anti pattern
# "FURB", # enforces modern python
# "D", # enforce documented functions [will be enabled soon]
]
# 2. Fix everything except flake8-bugbear (`B`) violations.
fixable = ["ALL"]
unfixable = ["B"]
# 3. Things to ignore
[tool.ruff.lint.per-file-ignores]
"tests/*" = ["S101"] # assert is fine in pytest
# Without build system declaration the package cannot be imported
# https://github.com/astral-sh/uv/issues/9291
# https://github.com/astral-sh/uv/issues/1626
[build-system]
requires = ["hatchling"]
build-backend = "hatchling.build"