forked from seanchatmangpt/dspygen
-
Notifications
You must be signed in to change notification settings - Fork 0
/
pyproject.toml
255 lines (221 loc) · 6.6 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
[build-system] # https://python-poetry.org/docs/pyproject/#poetry-and-pep-517
requires = ["poetry-core>=1.0.0"]
build-backend = "poetry.core.masonry.api"
[tool.poetry] # https://python-poetry.org/docs/pyproject/
name = "dspygen"
version = "2024.4.30"
description = "A Ruby on Rails style framework for the DSPy (Demonstrate, Search, Predict) project for Language Models like GPT, BERT, and LLama."
authors = ["Sean Chatman <[email protected]>"]
readme = "README.md"
repository = "https://github.com/seanchatmangpt/dspygen"
[tool.poetry.scripts] # https://python-poetry.org/docs/pyproject/#scripts
dspygen = "dspygen.cli:app"
[tool.poetry.dependencies] # https://python-poetry.org/docs/dependency-specification/
coloredlogs = ">=15.0.1"
fastapi = { extras = ["all"], version = ">=0.92.0" }
gunicorn = ">=20.1.0"
poethepoet = ">=0.20.0"
pydantic = ">=1.10.7"
python = ">=3.10,<4.0"
streamlit = ">=1.19.0"
typer = { extras = ["all"], version = ">=0.9.0" }
uvicorn = { extras = ["standard"], version = ">=0.20.0" }
faker = "^23.2.1"
jinja2 = "^3.1.3"
inflection = "^0.5.1"
jinja2-time = "^0.2.0"
jinja2-ext = "^0.1"
dspy-ai = "^2.4.5"
openai = "^1.12.0"
pyperclip = "^1.8.2"
asyncer = "^0.0.5"
loguru = "^0.7.2"
groq = "^0.4.1"
tiktoken = "^0.6.0"
reactivex = "^4.0.4"
pytest-asyncio = "^0.23.5"
playwright = "^1.41.2"
python-dotenv = "^1.0.1"
paho-mqtt = "^2.0.0"
psutil = "^5.9.8"
st-pages = "^0.4.5"
pykka = "^4.0.2"
ijson = "^3.2.3"
munch = "^4.0.0"
pandasql = "^0.7.3"
sentify = "^0.7.4"
ebooklib = "^0.18"
python-docx = "^1.1.0"
pypdf = "^4.1.0"
sqlmodel = "^0.0.16"
icontract = "^2.6.6"
tzlocal = "^5.2"
aiofiles = "^23.2.1"
pydantic-settings = "^2.2.1"
chromadb = "^0.4.24"
anyio = "^4.3.0"
docutils = "0.21"
transitions = "^0.9.0"
pygame = "^2.5.2"
py-trees = "^2.2.3"
[tool.poetry.group.test.dependencies] # https://python-poetry.org/docs/master/managing-dependencies/
coverage = { extras = ["toml"], version = ">=7.2.5" }
mypy = ">=1.2.0"
pre-commit = ">=3.3.1"
pytest = ">=7.3.1"
pytest-clarity = ">=1.0.1"
pytest-mock = ">=3.10.0"
pytest-xdist = ">=3.2.1"
ruff = ">=0.2.1"
[tool.poetry.group.dev.dependencies] # https://python-poetry.org/docs/master/managing-dependencies/
cruft = ">=2.14.0"
jupyterlab = ">=3.6.3"
pdoc = ">=13.1.1"
[tool.coverage.report] # https://coverage.readthedocs.io/en/latest/config.html#report
precision = 1
show_missing = true
skip_covered = true
[tool.coverage.run] # https://coverage.readthedocs.io/en/latest/config.html#run
branch = true
command_line = "--module pytest"
data_file = "reports/.coverage"
source = ["src"]
[tool.coverage.xml] # https://coverage.readthedocs.io/en/latest/config.html#xml
output = "reports/coverage.xml"
[tool.mypy] # https://mypy.readthedocs.io/en/latest/config_file.html
junit_xml = "reports/mypy.xml"
plugins = "pydantic.mypy"
ignore_missing_imports = true
pretty = true
show_column_numbers = true
show_error_codes = true
show_error_context = true
warn_unreachable = true
[tool.pytest.ini_options] # https://docs.pytest.org/en/latest/reference/reference.html#ini-options-ref
addopts = "--color=yes --doctest-modules --exitfirst --failed-first --verbosity=2 --junitxml=reports/pytest.xml"
testpaths = ["src", "tests"]
xfail_strict = true
[tool.ruff] # https://github.com/charliermarsh/ruff
fix = true
line-length = 100
src = ["src", "tests"]
target-version = "py310"
[tool.ruff.lint]
ignore-init-module-imports = true
select = ["A", "ASYNC", "B", "C4", "C90", "D", "DTZ", "E", "F", "FLY", "FURB", "I", "ISC", "LOG", "N", "NPY", "PERF", "PGH", "PIE", "PLC", "PLE", "PLR", "PLW", "PT", "RET", "RUF", "RSE", "SIM", "TID", "UP", "W", "YTT"]
ignore = ["E501", "PGH001", "PGH002", "PGH003", "RET504", "S101"]
unfixable = ["F401", "F841"]
[tool.ruff.lint.flake8-tidy-imports]
ban-relative-imports = "all"
[tool.ruff.lint.pydocstyle]
convention = "google"
[tool.poe.tasks] # https://github.com/nat-n/poethepoet
lock = "poetry lock"
inst = "poetry install"
pub = "poetry publish --build"
[tool.poe.tasks.api]
help = "Serve a REST API"
shell = """
if [ $dev ]
then {
uvicorn \
--host $host \
--port $port \
--graceful-timeout 30 \
--keep-alive 30
--timeout 30 \
--reload \
dspygen.api:app
} else {
gunicorn \
--access-logfile - \
--bind $host:$port \
--graceful-timeout 30 \
--keep-alive 30 \
--log-file - \
--timeout 30 \
--worker-class uvicorn.workers.UvicornWorker \
--workers 1 \
dspygen.api:app
} fi
"""
[[tool.poe.tasks.api.args]]
help = "Bind socket to this host (default: 0.0.0.0)"
name = "host"
options = ["--host"]
default = "0.0.0.0"
[[tool.poe.tasks.api.args]]
help = "Bind socket to this port (default: 8000)"
name = "port"
options = ["--port"]
default = "8000"
[[tool.poe.tasks.api.args]]
help = "Enable development mode"
type = "boolean"
name = "dev"
options = ["--dev"]
[tool.poe.tasks.app]
help = "Serve a Streamlit app"
cmd = """
streamlit run
--browser.gatherUsageStats false
--server.address $host
--server.port $port
--theme.base light
src/dspygen/app.py
"""
use_exec = true
[[tool.poe.tasks.app.args]]
help = "Bind socket to this host (default: 0.0.0.0)"
name = "host"
options = ["--host"]
default = "0.0.0.0"
[[tool.poe.tasks.app.args]]
help = "Bind socket to this port (default: 80)"
name = "port"
options = ["--port"]
default = "80"
[tool.poe.tasks.docs]
help = "Generate this package's docs"
cmd = """
pdoc
--docformat $docformat
--output-directory $outputdirectory
dspygen
"""
[[tool.poe.tasks.docs.args]]
help = "The docstring style (default: google)"
name = "docformat"
options = ["--docformat"]
default = "google"
[[tool.poe.tasks.docs.args]]
help = "The output directory (default: docs)"
name = "outputdirectory"
options = ["--output-directory"]
default = "docs"
[tool.poe.tasks.lab]
help = "Run Jupyter Lab"
[[tool.poe.tasks.lab.sequence]]
cmd = "mkdir -p notebooks"
[[tool.poe.tasks.lab.sequence]]
cmd = """
jupyter lab
--allow-root
--notebook-dir notebooks
"""
[tool.poe.tasks.lint]
help = "Lint this package"
[[tool.poe.tasks.lint.sequence]]
cmd = """
pre-commit run
--all-files
--color always
"""
[tool.poe.tasks.test]
help = "Test this package"
[[tool.poe.tasks.test.sequence]]
cmd = "coverage run"
[[tool.poe.tasks.test.sequence]]
cmd = "coverage report"
[[tool.poe.tasks.test.sequence]]
cmd = "coverage xml"