-
Notifications
You must be signed in to change notification settings - Fork 3
/
pyproject.toml
241 lines (228 loc) · 6.32 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
[build-system]
requires = ["poetry-core>=1.0.0"]
build-backend = "poetry.core.masonry.api"
[tool.poetry]
name = "penai"
packages = [{ include = "penai", from = "src" }]
version = "0.1.0"
description = ""
authors = ["appliedAI <[email protected]>"]
readme = "README.md"
homepage = "https://github.com/penpot/penai"
classifiers = ["Programming Language :: Python :: 3.11"]
exclude = ["test/*", "examples/*", "docs/*"]
[tool.poetry.dependencies]
python = "^3.11, <3.12"
accsr = "^0.4.7"
bs4 = "^0.0.2"
cryptography = "^42.0.7"
cssutils = "^2.11.1"
docstring-parser = "^0.16"
fastapi = "^0.111.0"
jsonargparse = "^4.29.0"
langchain = "^0.2.2"
langchain-anthropic = "^0.1.15"
langchain-community = "^0.2.5"
langchain-google-genai = "^1.0.6"
langchain-openai = "^0.1.8"
lxml = "^5.2.2"
markdown = "^3.6"
matplotlib = "^3.9.0"
openai = "^1.30.1"
pandas = "^2.2.1"
pillow = "^10.3.0"
plotly = "^5.19.0"
pptree = "^3.1"
pydantic = "^2.9.2"
randomname = "^0.2.1"
requests = "^2.32.2"
requests-cache = "^1.2.1"
resvg-py = "^0.1.5"
selenium = "^4.24.0"
sensai = "^1.2.0"
shortuuid = "^1.0.13"
sphinx = "7.4.7"
termcolor = "^2.4.0"
tqdm = "^4.66.4"
transit-python2 = "^0.8.321"
types-markdown = "^3.6.0.20240316"
webdriver-manager = "^4.0.2"
[tool.poetry.group.dev]
optional = true
[tool.poetry.group.dev.dependencies]
black = { version = "^23.7.0", extras = ["jupyter"] }
cryptography = "^42.0.7"
docutils = "0.20.1"
jinja2 = "*"
jupyter = "^1.0.0"
jupyter-book = "^1.0.0"
jupyterlab-lsp = "^5.1.0" # autocomplete for jupyterlab
mypy = "^1.4.1"
nbqa = "^1.7.1"
nbstripout = "^0.6.1"
poethepoet = "^0.20.0"
pre-commit = "^3.3.3"
pytest = "^8.0.2"
pytest-cov = "*"
pytest-lazy-fixtures = "^1.0.5"
pytest-xdist = "^3.6.1"
ruff = "^0.4.5"
sphinx = "^7"
sphinx-book-theme = "^1.0.1"
sphinx-comments = "^0.0.3"
sphinx-copybutton = "^0.5.2"
sphinx-jupyterbook-latex = "^1.0.0"
sphinx-togglebutton = "^0.3.2"
sphinx-toolbox = "^3.5.0"
sphinxcontrib-bibtex = "*"
types-requests = "^2.32.0.20240523"
[tool.mypy]
allow_redefinition = true
check_untyped_defs = true
disallow_incomplete_defs = true
disallow_untyped_defs = true
ignore_missing_imports = true
no_implicit_optional = true
pretty = true
show_error_codes = true
show_error_context = true
show_traceback = true
strict_equality = true
strict_optional = true
warn_no_return = true
warn_redundant_casts = true
warn_unreachable = true
warn_unused_configs = true
warn_unused_ignores = true
exclude = "^build/|^docs/"
[tool.doc8]
max-line-length = 1000
[tool.black]
line-length = 100
target-version = ["py311"]
[tool.nbqa.exclude]
ruff = "\\.jupyter_cache|jupyter_execute"
mypy = "\\.jupyter_cache|jupyter_execute"
[tool.ruff]
src = ["src"]
unsafe-fixes = true
target-version = "py311"
[tool.ruff.lint]
select = [
"ASYNC",
"B",
"C4",
"C90",
"COM",
"D",
"DTZ",
"E",
"F",
"FLY",
"G",
"I",
"ISC",
"PIE",
"PLC",
"PLE",
"PLW",
"RET",
"RUF",
"RSE",
"SIM",
"TID",
"UP",
"W",
"YTT",
]
ignore = [
"COM812", # requires trailing commas and can cause undesirable reformats when calling `poe format` multiple times
"E501", # line too long. black does a good enough job
"E741", # variable names like "l". this isn't a huge problem
"B008", # do not perform function calls in argument defaults. we do this sometimes
"B011", # assert false. we don't use python -O
"B028", # we don't need explicit stacklevel for warnings
"B019", # using @cache is fine
"D100",
"D101",
"D102",
"D104",
"D105",
"D107",
"D203",
"D213",
"D401",
"D402", # docstring stuff
"DTZ005", # we don't need that
# remaining rules from https://github.com/psf/black/blob/main/.flake8 (except W503)
# this is a simplified version of config, making vscode plugin happy
"E402",
"E501",
"E701",
"E731",
"C408",
"E203",
# Logging statement uses f-string warning
"G004",
# Unnecessary `elif` after `return` statement
"RET505",
"D106", # undocumented public nested class
"D205", # blank line after summary (prevents summary-only docstrings, which makes no sense)
"PLW0603", # using global statement
"B018", # strip useless expressions in notebooks. These "useless expressions" often serve as a way to display output
"RUF012", # forbids mutable types for class attributes
"SIM102", "RET507", # forbids freedom in specification if/elif and return
"ISC002", # forbids implicitly concatenated string literals
"ISC003", # forbids explicitly concatenated strings
"RET504", # removes "superfluous" assignment before return
]
unfixable = []
extend-fixable = [
"F401", # unused import
"B905", # bugbear
]
[tool.ruff.lint.mccabe]
max-complexity = 20
[tool.ruff.lint.per-file-ignores]
"test/**" = ["D103"]
"docs/**" = ["D103"]
"scripts/**" = ["D103"]
"examples/**" = ["D103"]
[tool.poetry_bumpversion.file."penai/__init__.py"]
[tool.poetry-sort]
move-optionals-to-bottom = true
[tool.poe.env]
PYDEVD_DISABLE_FILE_VALIDATION = "1"
# keep relevant parts in sync with pre-commit
[tool.poe.tasks] # https://github.com/nat-n/poethepoet
test = "pytest test --cov=penai --cov-report=xml --cov-report=term-missing --durations=0 -v --color=yes -n auto"
# Adjust to a smaller set of tests if appropriate
test-subset = "pytest test --color=yes -n auto"
_black_check = "black --check src docs"
_ruff_check = "ruff check src docs"
_ruff_check_nb = "nbqa ruff docs"
_black_format = "black src docs"
_ruff_format = "ruff check --fix src docs"
_ruff_format_nb = "nbqa ruff --fix docs"
lint = ["_black_check", "_ruff_check", "_ruff_check_nb"]
_poetry_install_sort_plugin = "poetry self add poetry-plugin-sort"
_poetry_sort = "poetry sort"
clean-nbs = "python docs/nbstripout.py"
format = [
"_ruff_format",
"_black_format",
"_ruff_format_nb",
"_poetry_install_sort_plugin",
"_poetry_sort",
]
_autogen_rst = "python docs/autogen_rst.py"
_sphinx_build = "sphinx-build -W -b html docs docs/_build"
_jb_generate_toc = "python docs/create_toc.py"
_jb_generate_config = "jupyter-book config sphinx docs/"
doc-clean = "rm -rf docs/_build"
doc-generate-files = ["_autogen_rst", "_jb_generate_toc", "_jb_generate_config"]
doc-build = ["doc-generate-files", "_sphinx_build"]
full-ci = ["lint", "type-check", "test", "doc-build"]
_mypy = "mypy src test scripts"
_mypy_nb = "nbqa mypy docs"
type-check = ["_mypy", "_mypy_nb"]