-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathpyproject.toml
More file actions
103 lines (88 loc) · 3.06 KB
/
Copy pathpyproject.toml
File metadata and controls
103 lines (88 loc) · 3.06 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
[project]
name = "vgi-nlp"
version = "0.1.0"
description = "Classical NLP (spaCy + fastText + VADER) as a VGI worker for DuckDB/SQL"
readme = "README.md"
requires-python = ">=3.13"
license = { file = "LICENSE" }
authors = [{ name = "Query Farm", email = "hello@query.farm" }]
keywords = ["vgi", "duckdb", "nlp", "spacy", "fasttext", "sentiment", "ner"]
dependencies = [
"vgi-python>=0.14.0",
"spacy>=3.7",
"fasttext-wheel",
"vaderSentiment",
]
[project.optional-dependencies]
# HTTP transport: the worker can serve over HTTP (`nlp_worker.py --http`) in
# addition to stdio. That path needs vgi-python's `http` extra (waitress).
# CI's http transport leg installs this via `uv sync --extra http`.
http = [
"vgi-python[http]>=0.14.0",
]
dev = [
"pytest>=8",
"mypy>=1.10",
"ruff>=0.5",
"pydoclint",
"en-core-web-sm",
]
[project.urls]
Homepage = "https://query.farm"
[tool.uv.sources]
en-core-web-sm = { url = "https://github.com/explosion/spacy-models/releases/download/en_core_web_sm-3.8.0/en_core_web_sm-3.8.0-py3-none-any.whl" }
[build-system]
requires = ["hatchling"]
build-backend = "hatchling.build"
[tool.hatch.build.targets.wheel]
packages = ["vgi_nlp"]
[tool.pytest.ini_options]
testpaths = ["tests"]
addopts = "-q"
[tool.ruff]
line-length = 120
target-version = "py313"
[tool.ruff.lint]
select = ["E", "F", "I", "UP", "B", "SIM", "D"]
[tool.ruff.lint.per-file-ignores]
# The PEP 723 inline-script header pins a model wheel by long URL; it cannot wrap.
"nlp_worker.py" = ["E501"]
# Docstrings (D) are enforced on the worker package/script (product code), not tests.
"tests/**" = ["D"]
"conftest.py" = ["D"]
[tool.ruff.lint.pydocstyle]
convention = "google"
[tool.ruff.format]
quote-style = "double"
[tool.pydoclint]
# Docstring consistency gate (complements ruff's D rules: ruff checks docstring
# shape, pydoclint checks documented args/returns/attrs match the code).
style = "google"
arg_type_hints_in_docstring = false
check_return_types = false
check_yield_types = false
check_class_attributes = true
skip_checking_raises = true
allow_init_docstring = true
[tool.mypy]
python_version = "3.13"
strict = true
warn_return_any = true
warn_unused_ignores = true
[[tool.mypy.overrides]]
# Genuinely untyped third-party libraries (no stubs published).
module = ["spacy.*", "fasttext.*", "vaderSentiment.*", "pyarrow.*"]
ignore_missing_imports = true
[tool.vgi-lint-check.execution]
# This worker loads a spaCy pipeline (+ fastText) per process. The VGI worker
# pool cold-loads those models on a fresh pool worker, so an executable example
# that lands on a cold worker pays a one-time ~15-25s model-load before the
# (millisecond) inference — see CLAUDE.md sharp-edge #4. Serialize example
# execution (the worker is single-model, CPU-bound: parallel cursors just
# contend and time out), widen the per-query cap to cover a cold load, and raise
# the slow-example threshold so the expected cold-load window is not flagged as
# CI bloat (VGI901/906/908). Inference itself is fast; this only accommodates the
# one-time model load.
concurrency = 1
timeout = 60
slow_seconds = 30