forked from stanfordnlp/dspy
-
Notifications
You must be signed in to change notification settings - Fork 0
/
pyproject.toml
310 lines (289 loc) · 7.4 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
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
[build-system]
requires = ["setuptools>=40.8.0", "wheel"]
build-backend = "setuptools.build_meta"
[project]
name = "dspy-ai"
version = "2.4.9"
description = "DSPy"
readme = "README.md"
authors = [{ name = "Omar Khattab", email = "okhattab@stanford.edu" }]
license = { text = "MIT License" }
requires-python = ">=3.9, <3.13"
classifiers = [
"Development Status :: 3 - Alpha",
"Intended Audience :: Science/Research",
"License :: OSI Approved :: MIT License",
"Operating System :: POSIX :: Linux",
"Programming Language :: Python :: 3", # removed 3.8
"Programming Language :: Python :: 3.9",
]
# We have both project and tool.poetry.dependencies. Should we remove one?
# tool.poetry.dependencies is a convenience thing for poetry users.
# project dependencies function similarly to requirements.txt,
# `pip install .` will pull from pyproject.toml dependencies
dependencies = [
"backoff~=2.2.1",
"joblib~=1.3.2",
"openai>=0.28.1,<2.0.0",
"pandas",
"regex",
"ujson",
"tqdm",
"datasets>=2.14.6,<3.0.0",
"requests",
"optuna",
"pydantic~=2.0",
"structlog",
"jinja2"
]
[project.optional-dependencies]
anthropic = ["anthropic~=0.18.0"]
chromadb = ["chromadb~=0.4.14"]
qdrant = ["qdrant-client>=1.6.2", "fastembed>=0.2.0"]
marqo = ["marqo"]
pinecone = ["pinecone-client~=2.2.4"]
weaviate = ["weaviate-client~=4.5.4"]
milvus = ["pymilvus~=2.3.7"]
aws = ["boto3~=1.34.78"]
docs = [
"sphinx>=4.3.0",
"furo>=2023.3.27",
"docutils<0.17",
"m2r2",
"myst-parser",
"myst-nb",
"sphinx-autobuild",
"sphinx_rtd_theme",
"autodoc_pydantic",
"sphinx-reredirects>=0.1.2",
"sphinx-automodapi==0.16.0",
]
dev = ["pytest>=6.2.5"]
fastembed = ["fastembed>=0.2.0"]
[project.urls]
homepage = "https://github.com/stanfordnlp/dspy"
[tool.poetry]
name = "dspy"
version = "2.0.8"
description = "DSPy"
authors = ["Omar Khattab <okhattab@stanford.edu>"]
license = "MIT"
readme = "README.md"
homepage = "https://github.com/stanfordnlp/dspy"
repository = "https://github.com/stanfordnlp/dspy"
# documentation = "https://dspy-ai.readthedocs.io"
keywords = ["dspy", "ai", "language models", "llm", "openai"]
# may be a bit much
[tool.poetry.dependencies]
python = ">=3.9,<3.13"
pydantic = "^2.0"
backoff = "^2.2.1"
joblib = "^1.3.2"
openai = ">=0.28.1,<2.0.0"
pandas = "^2.1.1"
regex = "^2023.10.3"
ujson = "^5.8.0"
tqdm = "^4.66.1"
datasets = "^2.14.6"
requests = "^2.31.0"
optuna = "^3.4.0"
anthropic = { version = "^0.18.0", optional = true }
chromadb = { version = "^0.4.14", optional = true }
fastembed = { version = ">=0.2.0", optional = true }
marqo = { version = "*", optional = true }
qdrant-client = { version = "^1.6.2", optional = true }
pinecone-client = { version = "^2.2.4", optional = true }
weaviate-client = { version = "^4.5.4", optional = true }
pymilvus = { version = "^2.3.6", optional = true }
boto3 = { version = "^1.34.78", optional = true }
sphinx = { version = ">=4.3.0", optional = true }
furo = { version = ">=2023.3.27", optional = true }
docutils = { version = "<0.17", optional = true }
m2r2 = { version = "*", optional = true }
myst-parser = { version = "*", optional = true }
myst-nb = { version = "*", optional = true }
sphinx-autobuild = { version = "*", optional = true }
sphinx_rtd_theme = { version = "*", optional = true }
autodoc_pydantic = { version = "*", optional = true }
sphinx-reredirects = { version = "^0.1.2", optional = true }
sphinx-automodapi = { version = "0.16.0", optional = true }
groq = { version = "^0.4.2", optional = true }
rich = "^13.7.1"
psycopg2 = { version = "^2.9.9", optional = true }
pgvector = { version = "^0.2.5", optional = true }
structlog = "^24.1.0"
llama-index = {version = "^0.10.30", optional = true}
snowflake-snowpark-python = { version = "*",optional=true, python = ">=3.9,<3.12" }
jinja2 = "^3.1.3"
[tool.poetry.group.dev.dependencies]
pytest = "^6.2.5"
transformers = "^4.38.2"
torch = "^2.2.1"
pytest-mock = "^3.12.0"
ruff = "^0.3.0"
black = "^24.2.0"
pre-commit = "^3.7.0"
ipykernel = "^6.29.4"
[tool.poetry.extras]
chromadb = ["chromadb"]
qdrant = ["qdrant-client", "fastembed"]
marqo = ["marqo"]
pinecone = ["pinecone-client"]
weaviate = ["weaviate-client"]
milvus = ["pymilvus"]
aws = ["boto3"]
postgres = ["psycopg2", "pgvector"]
docs = [
"sphinx",
"furo",
"docutils",
"m2r2",
"myst-parser",
"myst-nb",
"sphinx-autobuild",
"sphinx_rtd_theme",
"autodoc_pydantic",
"sphinx-reredirects",
"sphinx-automodapi",
]
fastembed = ["fastembed"]
[tool.poetry.group.doc.dependencies]
mkdocs = ">=1.5.3"
mkdocs-material = ">=9.0.6"
mkdocs-material-extensions = ">=1.3.1"
mkdocs-gen-files = "^0.5.0"
mkdocstrings-python = "^1.7.5"
mkdocstrings = { extras = ["python"], version = ">=0.20.0" }
mike = ">=2.0.0"
[tool.coverage.run]
branch = true
omit = [
"*/__init__.py",
"*/test_*.py",
"*/tests/*.py",
"*/conftest.py",
"*/venv/*",
"*/virtualenv/*",
"*/.venv/*",
"*/.virtualenv/*",
"*/env/*",
"*/.env/*",
"*/setup.py",
]
[tool.coverage.report]
exclude_lines = [
"pragma: no cover",
"def __repr__",
"if self.debug:",
"raise AssertionError",
"raise NotImplementedError",
"if __name__ == '__main__':",
"logger",
"try",
"except",
"^\\s*self\\.\\w+(:\\s*[^=]+)?\\s*=.*$",
"continue",
]
[tool.ruff]
line-length = 120
indent-width = 4
target-version = "py39"
extend-unsafe-fixes = ["D"]
[tool.ruff.lint]
# List of rules: https://docs.astral.sh/ruff/rules
select = [
# flake8-builtins
"A",
# flake8-commas
"COM812",
# flake8-comprehensions
"C4",
# pydocstyle
"D",
# pycodestyle
"E",
# Pyflakes
"F",
# pyupgrade
"UP",
# flake8-bugbear
"B",
# flake8-simplify
"SIM",
# flake8-implicit-str-concat
"ISC",
# pep8-naming
"N",
# flake8-annotations
"ANN",
# flake8-async
"ASYNC",
# flake8-bandid selected
"S",
# flake8-print
"T20",
# flake8-return
"RET",
# flake8-simplify
"SIM",
# flake8-unused-arguments
"ARG",
# flake8-use-pathlib
"PTH",
# eradicate
"ERA",
# pandas-vet
"PD",
# Import sort
"I",
# avoid shadowing
"PLW",
]
ignore = [
"D100",
"D101",
"D104",
"D106",
# missing-type-self
"ANN101",
# missing-type-cls
"ANN102",
# missing-type-kwargs
"ANN003",
# utf-8 encoding skip
"UP009",
# Missing return type annotation for special method `__init__`
"ANN204",
# Star-arg unpacking after a keyword argument is strongly discouraged
"B026",
# Missing type annotation for function argument `self`
"ANN001",
# Dynamically typed expressions (typing.Any) are disallowed in `wrapper`
"ANN401",
# We don't need docstrings for every method
"ANN202",
"D107",
"D102",
"D103",
# Inline lambdas
"E731",
# Sometimes we need List and Tuple
"UP006",
]
# Allow fix for all enabled rules (when `--fix`) is provided.
fixable = ["ALL"]
unfixable = []
[tool.ruff.format]
docstring-code-format = true
quote-style = "double"
# Like Black, indent with spaces, rather than tabs.
indent-style = "space"
# Like Black, respect magic trailing commas.
skip-magic-trailing-comma = false
# Like Black, automatically detect the appropriate line ending.
line-ending = "auto"
[tool.ruff.lint.pydocstyle]
convention = "google"
[tool.ruff.lint.per-file-ignores]
"**/{tests,docs}/*" = ["ALL"]
"**__init__.py" = ["F401"]