-
Notifications
You must be signed in to change notification settings - Fork 9
/
pyproject.toml
261 lines (236 loc) · 7.99 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
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
[tool.poetry]
name = "docq"
version = "0.13.11"
description = "Docq.AI - Your private ChatGPT alternative. Securely unlock knowledge from confidential documents."
authors = ["Docq.AI Team <[email protected]>"]
maintainers = ["Docq.AI Team <[email protected]>"]
license = "AGPL-3.0-or-later"
homepage = "https://docq.ai"
repository = "https://github.com/docqai/docq"
documentation = "https://docqai.github.io/docq"
readme = "README.md"
packages = [{ include = "docq", from = "source" }]
[tool.poetry.dependencies]
python = ">=3.10,<3.12"
streamlit = "^1.38.0"
st-pages = "^1.0.0"
pypdf = "^4.1.0"
docx2txt = "^0.8"
argon2-cffi = "^21.3.0"
azure-core = "^1.27.1"
opendal = "^0.41.0"
transformers = "^4.38.2"
optimum = {extras = ["exporters"], version = "^1.17.1"}
torch = "2.2.0"
cryptography = "^42.0.4"
span-marker = "^1.3.0"
honeycomb-opentelemetry = "^0.2.3b0"
opentelemetry-api = "^1.20.0"
opentelemetry-instrumentation-sqlite3 = "0.41b0"
opentelemetry-instrumentation-aws-lambda = "0.41b0"
opentelemetry-instrumentation-dbapi = "0.41b0"
opentelemetry-instrumentation-logging = "0.41b0"
opentelemetry-instrumentation-urllib = "0.41b0"
opentelemetry-instrumentation-wsgi = "0.41b0"
opentelemetry-instrumentation-aiohttp-client = "0.41b0"
opentelemetry-instrumentation-grpc = "0.41b0"
opentelemetry-instrumentation-jinja2 = "0.41b0"
opentelemetry-instrumentation-requests = "0.41b0"
opentelemetry-instrumentation-sqlalchemy = "0.41b0"
opentelemetry-instrumentation-tornado = "0.41b0"
opentelemetry-instrumentation-tortoiseorm = "0.41b0"
opentelemetry-instrumentation-urllib3 = "0.41b0"
opentelemetry-instrumentation-httpx = "0.41b0"
opentelemetry-instrumentation-system-metrics = "0.41b0"
google-auth-oauthlib = "^1.1.0"
google-api-python-client = "^2.104.0"
google-auth-httplib2 = "^0.1.1"
microsoftgraph-python = "^1.1.6"
pydantic = "2.8.2"
mkdocs-material = "^9.5.13"
pyautogen = "^0.2.2"
termcolor = "^2.4.0"
google-cloud-aiplatform = "^1.38.0"
litellm = "^1.35.16"
semantic-kernel = "0.4.3.dev0"
imap-tools = "^1.5.0"
llama-index-llms-litellm = "^0.1.3"
llama-index-embeddings-azure-openai = "^0.1.6"
llama-index-embeddings-huggingface-optimum = "^0.1.5"
llama-index-readers-file = "^0.1.12"
slack-bolt = "^1.18.1"
llama-index-retrievers-bm25 = "^0.1.3"
sentence-transformers = "^2.6.1"
llama-index-postprocessor-colbert-rerank = "^0.1.2"
jwt = "^1.3.1"
llama-index-core = "0.10.39"
[tool.poetry.group.dev.dependencies]
pre-commit = "^2.18.1"
black = { version = "^22.3.0", allow-prereleases = true }
xdoctest = "^1.0.0"
poethepoet = "^0.16.4"
pytest-html = "^3.1.1"
pytest-sugar = "^0.9.6"
pytest-reverse = "^1.5.0"
pytest-cov = "^3.0.0"
mkdocs-material = "^9.5.17"
mkdocs-gen-files = "^0.5.0"
mkdocs-awesome-pages-plugin = "^2.9.2"
mkapi = "^1.0.14"
pillow = "^10.2.0"
cairosvg = "^2.7.0"
python-dotenv = "^1.0.0"
ruff = "^0.6.4"
mkdocs = "^1.5.3"
debugpy = "^1.8.2"
pytest = "^8.3.3"
[tool.poetry.scripts]
-c = "poethepoet:main"
[build-system]
requires = ["poetry-core>=1.0.0"]
build-backend = "poetry.core.masonry.api"
[tool.black]
line-length = 120
target-version = ['py310']
include = '\.pyi?$'
check = true
[tool.ruff]
ignore = ["E501", "ANN401"]
line-length = 120
select = [
"C9",
"E",
"F",
"W",
"D",
"G",
"A",
"PT",
"S",
"B",
"ANN",
"SIM",
"I",
"N",
]
[tool.ruff.mccabe]
max-complexity = 10
[tool.ruff.pydocstyle]
convention = "google"
[tool.ruff.per-file-ignores]
"tests/*" = ["S101"]
[tool.pytest.ini_options]
minversion = "6.0"
addopts = """
--verbose \
--maxfail=1 \
--reverse \
--color=yes \
--cov=docq \
--html=docs/pytest_report.html \
--self-contained-html \
--cov-fail-under=9 \
--cov-report term-missing \
--cov-report html:docs/cov-report \
--doctest-modules \
--cov-config=pyproject.toml"""
testpaths = ["tests"]
python_files = ["*_test.py"]
python_functions = ["test_*"]
render_collapsed = true
bdd_features_base_dir = "features"
[tool.coverage.report]
exclude_lines = [
"pragma: no cover",
"def __repr__",
"if self.debug:",
"if settings.DEBUG",
"raise AssertionError",
"raise NotImplementedError",
"if 0:",
"if __name__ == .__main__.:",
]
[tool.poe.tasks]
install = "poetry install --only main"
install-dev = "poetry install"
test = "pytest tests/unit"
pre-commit = "pre-commit run --all-files"
lint-ruff = "ruff check **/*.py --fix"
lint-black = "black **/*.py"
lint = ["lint-black", "lint-ruff"]
doc = "mkdocs serve --use-directory-urls --livereload --watch-theme --watch mkdocs.yaml"
doc-html = "mkdocs build --site-dir ./_site"
[tool.poe.tasks.test-integration]
shell ="[ $log = True ] && pytest tests/integration --capture=tee-sys || pytest tests/integration"
help = "Run integration tests"
[[tool.poe.tasks.test-integration.args]]
name = "log"
default = false
type = "boolean"
options = ["--log", "-l"]
help = "Show all logs including stdout and stderr"
[tool.poe.tasks.run]
cmd = "poetry run streamlit run web/index.py --server.port $port --browser.gatherUsageStats false --server.runOnSave true --server.fileWatcherType auto"
args = [{ name = "port", default = 8501, type = "integer" }]
env = { WATCHDOG_LOG_LEVEL = "ERROR", PYTHONPATH = "${PWD}/web/:${PWD}/source/:${PWD}/../docq-extensions/source/" }
[tool.poe.tasks.run-otel]
cmd = "poetry run opentelemetry-instrument --logs_exporter none streamlit run web/index.py --server.port $port --browser.gatherUsageStats false --server.runOnSave true --server.fileWatcherType auto"
args = [{ name = "port", default = 8501, type = "integer" }]
env = { WATCHDOG_LOG_LEVEL = "ERROR", PYTHONPATH = "${PWD}/web/:${PWD}/source/:${PWD}/../docq-extensions/source/" }
[tool.poe.tasks.run-otel-infisical]
cmd = "infisical run --env=dev -- poetry run opentelemetry-instrument --logs_exporter none streamlit run web/index.py --server.port $port --browser.gatherUsageStats false --server.runOnSave true --server.fileWatcherType auto"
args = [{ name = "port", default = 8501, type = "integer" }]
env = { WATCHDOG_LOG_LEVEL = "ERROR", PYTHONPATH = "${PWD}/web/:${PWD}/source/:${PWD}/../docq-extensions/source/" }
[tool.poe.tasks.run-otel-infisical-debugpy]
cmd = "infisical run --env=dev -- poetry run opentelemetry-instrument --logs_exporter none python -Xfrozen_modules=off -m debugpy --listen 5678 --wait-for-client streamlit run web/index.py --server.port $port --browser.gatherUsageStats false --server.runOnSave true --server.fileWatcherType auto"
args = [{ name = "port", default = 8501, type = "integer" }]
env = { WATCHDOG_LOG_LEVEL = "ERROR", PYTHONPATH = "${PWD}/web/:${PWD}/source/:${PWD}/../docq-extensions/source/" }
[tool.poe.tasks.run-simple]
cmd = "infisical run --env=dev -- poetry run streamlit run web/index.py --server.port $port --browser.gatherUsageStats false --server.runOnSave true --server.fileWatcherType auto"
args = [{ name = "port", default = 8501, type = "integer" }]
[tool.poe.tasks.docker-build]
cmd = """
docker build
--build-arg TESTBUILD=$test \
--build-arg BUILDTAG=$build_tag \
--build-arg BUILDPLATFORM=$build_platform \
--target $target \
-t docqai/docq:$target-$build_tag ."""
help = "Build a docker image to test the project in an isolated environment"
args = [
{ name = "test", default = false, type = "boolean" },
{ name = "build-tag", default = "3.11-slim-buster" },
{ name = "build-platform", default = "linux/amd64" },
{ name = "target", default = "prod" },
]
[tool.poe.tasks.docker-run]
cmd = """
docker run \
-it
--rm \
--name docq \
--env-file docker.env \
-p $port:$port \
docq:$target-$build_tag """
help = "Run the docker image"
args = [
{ name = "build-tag", default = "3.11-slim-buster" },
{ name = "target", default = "prod" },
{ name = "port", default = 8501, type = "integer" },
]
[tool.poe.tasks.docker-run-infisical]
cmd = """
docker run \
-it
--rm \
--name docq \
--env INFISICAL_TOKEN=$INFISICAL_TOKEN \
--env INFISICAL_ENV_NAME=stage
-p $port:$port \
docq:$target-$build_tag """
help = "Run the docker image"
args = [
{ name = "build-tag", default = "3.11-slim-buster" },
{ name = "target", default = "prod" },
{ name = "port", default = 8501, type = "integer" },
]