-
Notifications
You must be signed in to change notification settings - Fork 12
Expand file tree
/
Copy pathpyproject.toml
More file actions
356 lines (331 loc) · 9.93 KB
/
Copy pathpyproject.toml
File metadata and controls
356 lines (331 loc) · 9.93 KB
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
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
[project]
name = "autointent"
version = "0.3.2"
description = "A tool for automatically configuring a text classification pipeline for intent prediction."
license = { text = "Apache 2.0" }
authors = [
{ name = "Alexeev Ilya", email = "ilya_alekseev_2016@list.ru" },
{ name = "Kuznetsov Denis", email = "kuznetsov.den.p@gmail.com" },
]
maintainers = [
{ name = "Alexeev Ilya", email = "ilya_alekseev_2016@list.ru" },
{ name = "Solomatin Roman", email = "risolomatin@gmail.com" },
]
readme = "README.md"
keywords = ["nlp", "dialog-systems", "transformers", "auto-ml"]
classifiers=[
'Development Status :: 4 - Beta',
'Intended Audience :: Developers',
'Intended Audience :: Science/Research',
'Natural Language :: English',
'Natural Language :: Russian',
'Operating System :: POSIX :: Linux',
'Operating System :: Microsoft :: Windows',
'Topic :: Scientific/Engineering :: Artificial Intelligence',
'Topic :: Software Development :: Libraries :: Python Modules',
'Topic :: Text Processing :: Linguistic',
'Topic :: Utilities',
'Framework :: Pytest',
'Framework :: Sphinx',
'Typing :: Typed',
]
requires-python = ">=3.10,<3.15"
dependencies = [
"torch (>=2.0.0,<3.0.0)",
"scikit-learn (>=1.5,<2.0)",
"scikit-multilearn (==0.2.0)",
"appdirs (>=1.4,<2.0)",
"optuna (>=4.0.0,<5.0.0)",
"pathlib (>=1.0.1,<2.0.0)",
"pydantic (>=2.10.5,<3.0.0)",
"faiss-cpu (>=1.9.0,<2.0.0)",
"datasets (>=3.2.0,<5.0.0)",
"xxhash (>=3.5.0,<4.0.0)",
"python-dotenv (>=1.0.1,<2.0.0)",
"aiometer (>=1.0.0,<2.0.0)",
"aiofiles (>=24.1.0,<25.0.0)",
"threadpoolctl (>=3.0.0,<4.0.0)",
"packaging (>=23.2)",
]
[project.optional-dependencies]
catboost = ["catboost (>=1.2.8,<2.0.0)"]
peft = ["peft (>= 0.10.0, !=0.15.0, !=0.15.1, <1.0.0)"]
transformers = ["transformers[torch] (>=4.49.0,<5.0.0)"]
sentence-transformers = ["sentence-transformers (>=3,<4)"]
dspy = [
"dspy (>=2.6.5,<3.0.0)",
]
wandb = [
"wandb (>=0.19.10,<1.0.0)",
]
codecarbon = [
"codecarbon (==3.0.0)",
"pynvml (>=8.0.4, <12.0.0)", # to avoid "attribute nvmlDeviceGetTotalEnergyConsumption not found" error
]
fastapi = [
"fastapi (>=0.115, <1.0)",
"uvicorn (>=0.24, <1.0)",
"pydantic-settings (>=2.0, <3.0)"
]
fastmcp = [
"pydantic-settings (>=2.0, <3.0)",
"fastmcp (>=2.11.3, <3.0)"
]
opensearch = [
"opensearch-py (>=3.0.0, <4.0.0)",
]
openai = [
"openai (>=2,<3)",
"tiktoken (>=0.7,<1)",
]
vllm = [
"vllm>=0.20.0",
]
[tool.uv]
conflicts = [
[
{ extra = "codecarbon" },
{ extra = "fastmcp" },
]
]
[dependency-groups]
nb = [
"ipykernel (>=6.29.5,<7.0.0)",
"ipywidgets (>=8.1.5,<9.0.0)",
]
lint = [
"ruff (==0.15.0)",
]
sentencepiece = [
"sentencepiece (>=0.2.0,<0.3.0)",
]
test = [
"pytest (>=8.3.2,<9.0.0)",
"pytest-cov (>=5.0.0,<6.0.0)",
"coverage (>=7.6.1,<8.0.0)",
"pytest-asyncio (>=0.24.0,<1.0.0)",
"pytest-rerunfailures (>=15.0,<16.0)",
"pytest-xdist (>=3.6.1,<4.0.0)",
"respx (>=0.21.0,<1.0.0)",
"testcontainers[opensearch] (>=4.5.0,<5.0.0)",
"tensorboardx (>=2.6.2.2,<3.0.0)", # backend for the TensorBoardCallback test
]
typing = [
"mypy (>=1,<2)",
"types-pyyaml (>=6.0.12.20240917,<7.0.0)",
"types-pygments (>=2.18.0.20240506,<3.0.0)",
"types-setuptools (>=75.2.0.20241019,<76.0.0)",
"joblib-stubs (>=1.4.2.5.20240918,<2.0.0)",
"pandas-stubs (>= 2.2.3.250527, <3.0.0)",
"types-aiofiles (>=24.1.0.20250606)",
]
docs = [
"sphinx (>=8.1.3,<9.0.0)",
"pydata-sphinx-theme (>=0.16.0,<1.0.0)",
"jupytext (>=1.16.4,<2.0.0)",
"nbsphinx (>=0.9.5,<1.0.0)",
"sphinx-autodoc-typehints (>=2.5.0,<3.0.0)",
"sphinx-copybutton (>=0.5.2,<1.0.0)",
"sphinx-autoapi (>=3.3.3,<4.0.0)",
"ipykernel (>=6.29.5,<7.0.0)",
"tensorboardx (>=2.6.2.2,<3.0.0)",
"sphinx-multiversion (>=0.2.4,<1.0.0)",
"sphinx-toolbox (>=4.0.0,<5.0.0)",
"sphinx-llms-txt (>=0.3.0,<0.4.0)"
]
[project.urls]
Homepage = "https://deeppavlov.github.io/AutoIntent/"
Repository = "https://github.com/deeppavlov/AutoIntent"
Documentation = "https://deeppavlov.github.io/AutoIntent/"
[project.scripts]
"basic-aug" = "autointent.generation.utterances._basic.cli:main"
"evolution-aug" = "autointent.generation.utterances._evolution.cli:main"
[build-system]
requires = ["uv_build>=0.8.7,<0.9.0"]
build-backend = "uv_build"
[tool.ruff]
line-length = 120
indent-width = 4
exclude = ["experiments", "scripts"]
target-version = "py310"
[tool.ruff.lint]
select = ["ALL"]
ignore = [
"TD", # todos
"FIX", # fixmes
"S311", # random usage
"COM812", # trailing commas
"ISC001", # implicit string concatenation
"ERA001", # commented code
"FBT", # boolean trap
"RUF001", # ambiguous unicode character
"PLC0415", # import outside top-level
]
future-annotations = true # For TC rules
[tool.ruff.lint.per-file-ignores]
"__init__.py" = ["F401", "D104"]
"src/autointent/__init__.py" = ["I001"]
"src/autointent/_wrappers/__init__.py" = ["I001"]
"tests/*.py" = ["S", "PLR2004", "ERA", "D", "ANN", "SLF"]
"tests/**/*.py" = ["S", "PLR2004", "ERA", "D", "ANN", "SLF", "ARG001"]
"tests/context/datahandler/test_data_handler.py" = ["PT011"]
"src/autointent/modules/*" = ["ARG002", "ARG003"] # unused argument
"docs/*" = ["INP001", "A001", "D"]
"*/utils.py" = ["D104", "D100"]
"*user_guides/*" = ["B018", "E501", "INP001", "T", "D", "E402", "I001", "W292", "ANN202", "ANN001", "ANN201", "PLR2004"]
[tool.ruff.lint.pylint]
max-args = 10
[tool.ruff.lint.pydocstyle]
convention = "google"
[tool.ruff.lint.flake8-type-checking]
strict = true
runtime-evaluated-base-classes = ["pydantic.BaseModel"]
exempt-modules = [
"typing",
"typing_extensions",
# reqired for config validation
"autointent.Context",
"autointent.custom_types",
"autointent.configs",
"pydantic",
]
[tool.ruff.lint.flake8-unused-arguments]
ignore-variadic-names = true
[tool.pytest.ini_options]
minversion = "8.0"
testpaths = [
"tests",
]
pythonpath = "src/autointent"
# `--cov` option breaks pycharm's test debugger
addopts = """
-m "not transformers"
-ra
--reruns 3
--only-rerun requests.exceptions.ReadTimeout
--only-rerun huggingface_hub.errors.HfHubHTTPError
--only-rerun huggingface_hub.errors.LocalEntryNotFoundError
--only-rerun FileNotFoundError
--only-rerun OSError
--durations 5
--reruns-delay 10
"""
markers = [
"transformers: qwen and deberta are too memory-consuming"
]
# --reruns 3 -> # Retry failed tests 3 times
# requests.exceptions.ReadTimeout -> # HF Read timed out
# huggingface_hub.errors.HfHubHTTPError -> # HF is unavailable
# huggingface_hub.errors.LocalEntryNotFoundError -> # Gateway Time-out from HF
# FileNotFoundError -> HF Cache is broken
# --reruns-delay 10 -> Delay between reruns in seconds to avoid running into the same issue again
# Measure only the package. Without `source` the bare `--cov` records every
# imported module (e.g. torch's temp `_remote_module_non_scriptable.py`),
# which makes `coverage report` crash with "No source for code".
# `relative_files` stores paths relative to the repo root so per-job data
# files produced by the coverage CI workflow can be `coverage combine`d.
[tool.coverage.run]
branch = true
source = ["autointent"]
relative_files = true
omit = [
"*/__init__.py",
"*/tests/*",
# Optional integrations whose extras are outside the coverage matrix, so
# they are imported but never exercised; measuring them reports 0% and
# understates real coverage. `server/*` needs fastapi/fastmcp;
# `dspy_evolver.py` is the only dspy-dependent module; `vllm.py` needs a
# CUDA GPU that CI runners don't have.
"*/server/*",
"*/dspy_evolver.py",
"*/vllm.py",
]
# Map the locations the package can be imported from (editable src checkout vs
# an installed copy) onto one canonical path, so combining data collected on
# different runners/installs resolves to the same files.
[tool.coverage.paths]
source = [
"src/autointent",
"*/src/autointent",
"*/site-packages/autointent",
]
[tool.coverage.report]
skip_empty = true
show_missing = true
[tool.mypy]
python_version = "3.10"
strict = true
warn_redundant_casts = true
# align with mypy 2.0 release
warn_unreachable = true
local_partial_types = true
plugins = [
"pydantic.mypy",
]
mypy_path = "src/autointent"
disable_error_code = ["override"]
[tool.pydantic-mypy]
init_forbid_extra = true
init_typed = true
[[tool.mypy.overrides]]
module = [
"scipy",
"sklearn",
"sklearn.*",
"xeger",
"appdirs",
"sre_yield",
"skmultilearn.model_selection",
"hydra",
"hydra.*",
"transformers",
"faiss",
"datasets",
"joblib",
"torch.utils.tensorboard",
"tensorboardX",
"testcontainers.opensearch",
"wandb",
"warm_hf_cache",
"compute_matrix",
"dspy",
"dspy.evaluate.auto_evaluation",
"codecarbon",
"catboost",
"jupytext",
"docs_utils.*",
]
ignore_missing_imports = true
[[tool.mypy.overrides]]
module = [
"autointent._callbacks.*",
"autointent.modules.abc.*",
]
warn_unreachable = false
[[tool.mypy.overrides]]
module = [
"autointent.server.http",
"autointent.server.mcp",
]
ignore_errors = true
[[tool.mypy.overrides]]
module = ["tests.server.*"]
ignore_errors = true
# Documentation code (user_guides narrative scripts and docs/ tooling) is checked
# with a relaxed "soft" profile: real type errors (arg-type, assignment, ...) still
# surface, but the strict-only annotation/generics noise inappropriate for teaching
# code is disabled. Invoked with --namespace-packages --explicit-package-bases (see
# the `typing` Makefile target) because the guide scripts are not importable packages.
[[tool.mypy.overrides]]
module = [
"user_guides.*",
"docs.*",
]
disallow_untyped_defs = false
disallow_incomplete_defs = false
disallow_untyped_calls = false
disallow_untyped_decorators = false
disallow_any_generics = false
warn_return_any = false
warn_unreachable = false
strict_equality = false