-
Notifications
You must be signed in to change notification settings - Fork 61
/
pyproject.toml
159 lines (136 loc) · 4.23 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
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
157
158
159
[tool.poetry]
name = "genoss"
version = "0.0.2a3"
description = "Replace OpenAI GPT with any LLMs in your app with one line. Common Inference API for all LLMs either Private or Public (Anthropic, Llama, GPT, Vertex, ...)"
authors = [
"mattzcarey <[email protected]>",
"MaximeThoonsen <[email protected]>",
"StanGirard <[email protected]>",
"Wirg <[email protected]>",
]
readme = "README.md"
homepage = "https://genoss.ai/"
repository = "https://github.com/OpenGenerativeAI/GenossGPT"
keywords = [
"server", "llm"
]
classifiers = [
"Framework :: FastAPI",
"Topic :: Scientific/Engineering :: Artificial Intelligence",
]
packages = [
{ include = "genoss" },
]
[tool.poetry.scripts]
genoss-server = "genoss.commands.start_genoss_server:main"
[tool.poetry.dependencies]
python = "^3.11"
fastapi = {extras = ["all"], version = "^0.95.1"}
loguru = "^0.7.0"
uvicorn = "^0.23.1"
pydantic = {version = "1.10.12", extras = ["dotenv"]}
click = "^8.1.7"
[tool.poetry.group.llms.dependencies]
langchain = "^0.0.240"
tiktoken = "^0.4.0"
transformers = "^4.31.0"
sentence-transformers = "^2.2.2"
gpt4all = { version = "^1.0.6", optional = true }
huggingface-hub = "^0.16.4"
openai = "^0.27.8"
[tool.poetry.group.streamlit-demo.dependencies]
openai = "^0.27.8"
python-dotenv = "^1.0.0"
streamlit = "^1.25.0"
watchdog = "^3.0.0"
[tool.poetry.group.dev.dependencies]
black = "^22"
mypy = "^1.2"
pre-commit = "^2"
pytest = "^7"
pytest-cov = "^3"
ruff = "^0"
isort = "^5.12.0"
[build-system]
requires = ["poetry-core>=1.0.0"]
build-backend = "poetry.core.masonry.api"
# Packages configs
[tool.pytest.ini_options]
pythonpath = ["."]
## coverage
[tool.coverage.run]
branch = true
[tool.coverage.report]
skip_empty = true
fail_under = 50.00
precision = 1
## prettier
[tool.isort]
profile = "black"
[tool.black]
target-version = ['py311']
## ruff
# Recommended ruff config for now, to be updated as we go along.
[tool.ruff]
target-version = 'py311'
# See all rules at https://beta.ruff.rs/docs/rules/
select = [
"E", # pycodestyle
"W", # pycodestyle
"F", # Pyflakes
"B", # flake8-bugbear
"C4", # flake8-comprehensions
"D", # flake8-docstrings
"I", # isort
"SIM", # flake8-simplify
"TCH", # flake8-type-checking
"TID", # flake8-tidy-imports
"Q", # flake8-quotes
"UP", # pyupgrade
"PT", # flake8-pytest-style
"RUF", # Ruff-specific rules
]
ignore = [
"E501", # "Line too long"
# -> line length already regulated by black
"PT011", # "pytest.raises() should specify expected exception"
# -> would imply to update tests every time you update exception message
"SIM102", # "Use a single `if` statement instead of nested `if` statements"
# -> too restrictive
# TODO: temporary remove missing docstring rules
"D100",
"D101",
"D102",
"D103",
"D104",
"D106",
"D107",
]
[tool.ruff.pydocstyle]
# Automatically disable rules that are incompatible with Google docstring convention
convention = "google"
[tool.ruff.pycodestyle]
max-doc-length = 88
[tool.ruff.flake8-tidy-imports]
ban-relative-imports = "all"
[tool.ruff.flake8-type-checking]
strict = true
runtime-evaluated-base-classes = ["pydantic.BaseModel"]
# Pydantic needs to be able to evaluate types at runtime
# see https://pypi.org/project/flake8-type-checking/ for flake8-type-checking documentation
# see https://beta.ruff.rs/docs/settings/#flake8-type-checking-runtime-evaluated-base-classes for ruff documentation
[tool.ruff.per-file-ignores]
# Allow missing docstrings for tests
"tests/**/*.py" = ["D100", "D103"]
## mypy
[tool.mypy]
python_version = "3.11"
plugins = [
"pydantic.mypy"
]
# Enable all optional error checking flags, providing stricter type checking; see https://mypy.readthedocs.io/en/stable/getting_started.html#strict-mode-and-configuration
strict = true
# Type-check the interiors of functions without type annotations; if missing, mypy won't check function bodies without type hints, for instance those coming from third-party libraries
check_untyped_defs = true
# Make __init__.py file optional for package definitions; if missing, mypy requires __init__.py at packages roots, see https://mypy.readthedocs.io/en/stable/running_mypy.html#mapping-file-paths-to-modules
explicit_package_bases = true