forked from ChelseaKR/sprout
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathpyproject.toml
More file actions
170 lines (150 loc) · 5.04 KB
/
Copy pathpyproject.toml
File metadata and controls
170 lines (150 loc) · 5.04 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
[build-system]
requires = ["hatchling"]
build-backend = "hatchling.build"
[project]
name = "sprout"
version = "0.1.0"
description = "A grounded, evaluated, multilingual plant-care assistant: retrieval-mandatory extractive generation with enforced citations, a never-certify-safe toxicity guard, calibrated abstention, a WCAG 2.2 chat UI, and a public evaluation harness (groundedness, safety, calibration, refusal, multilingual) wired into CI from day one."
readme = "README.md"
requires-python = ">=3.12"
license = "Apache-2.0"
classifiers = [
"Development Status :: 3 - Alpha",
"Intended Audience :: Developers",
"License :: OSI Approved :: Apache Software License",
"Programming Language :: Python :: 3.12",
"Programming Language :: Python :: 3.13",
"Topic :: Scientific/Engineering :: Artificial Intelligence",
"Topic :: Text Processing :: Linguistic",
]
authors = [{ name = "Chelsea Kelly-Reif", email = "3114598+ChelseaKR@users.noreply.github.com" }]
keywords = [
"rag",
"retrieval-augmented-generation",
"plant-care",
"houseplants",
"groundedness",
"citations",
"toxicity-safety",
"calibration",
"accessibility",
"wcag",
"multilingual",
"responsible-ai",
"evaluation",
]
dependencies = [
"pydantic>=2.7",
"pyyaml>=6.0",
"typer>=0.27.1",
"jinja2>=3.1",
]
[project.optional-dependencies]
serve = ["fastapi>=0.141.1", "uvicorn>=0.52.3", "sse-starlette>=3.4.8"]
bedrock = ["boto3>=1.43.73"]
anthropic = ["httpx>=0.27"]
identify = ["httpx>=0.27"]
lang = ["langdetect>=1.0.9"]
corpus = ["sigstore>=3.0"]
observability = [
"opentelemetry-api>=1.27",
"opentelemetry-exporter-otlp-proto-http>=1.27",
"opentelemetry-sdk>=1.27",
]
# EXP-04: NLI-grade entailment verifier for the cloud generation path (ADR-0018). CPU-only
# ONNX inference — no torch/transformers — kept optional so the offline default install
# stays zero-ML-dependency.
nli = ["onnxruntime>=1.29.0", "tokenizers>=0.19", "huggingface-hub>=1.28.0", "numpy>=2.5.2"]
[project.scripts]
sprout = "sprout.cli:app"
[project.urls]
Homepage = "https://sprout.chelseakr.com/"
Repository = "https://github.com/ChelseaKR/sprout"
Documentation = "https://sprout.chelseakr.com/"
Changelog = "https://github.com/ChelseaKR/sprout/blob/main/CHANGELOG.md"
# The eval harness ships in-repo as the `sprout.eval` subpackage (the headline
# artifact), not as an external dependency: `make eval` runs entirely offline.
[dependency-groups]
dev = [
"pytest>=8.2",
"pytest-cov>=5.0",
"ruff>=0.16.3",
"mypy>=2.3.1",
"pip-audit>=2.7",
"hypothesis>=6.165.10",
"types-pyyaml>=6.0.12.20260815",
"httpx>=0.27",
"fastapi>=0.141.1",
"uvicorn>=0.52.3",
"sse-starlette>=3.4.8",
"sigstore>=3.0",
"opentelemetry-api>=1.27",
"opentelemetry-exporter-otlp-proto-http>=1.27",
"opentelemetry-sdk>=1.27",
]
docs = ["mkdocs>=1.6", "mkdocs-material>=9.7.7"]
[tool.hatch.build.targets.wheel]
packages = ["src/sprout"]
[tool.hatch.build.targets.sdist]
include = ["src/sprout", "corpus", "eval", "config", "web/dist", "README.md", "LICENSE", "NOTICE"]
[tool.ruff]
line-length = 100
target-version = "py312"
src = ["src", "tests"]
extend-exclude = ["src/sprout/_vendor"]
[tool.ruff.lint]
select = ["E", "F", "I", "B", "UP", "SIM", "C90", "RUF"]
[tool.ruff.lint.mccabe]
max-complexity = 10
[tool.ruff.lint.per-file-ignores]
"tests/*" = ["S101"]
"src/sprout/_vendor/**/*.py" = ["RUF022", "RUF100"]
[tool.mypy]
python_version = "3.12"
strict = true
warn_unreachable = true
disallow_any_unimported = true
files = ["src", "tests"]
[[tool.mypy.overrides]]
module = ["boto3.*", "botocore.*", "sse_starlette.*", "langdetect.*", "uvicorn.*"]
ignore_missing_imports = true
[[tool.mypy.overrides]]
module = ["sprout._vendor.genai_telemetry.*"]
ignore_errors = true
[[tool.mypy.overrides]]
# Optional `sprout[nli]` extra (EXP-04) — lazily imported, unstubbed, and not part of the
# base install; see providers/bedrock.py for the identical treatment of boto3.
module = ["onnxruntime.*", "huggingface_hub.*", "tokenizers.*", "numpy.*"]
ignore_missing_imports = true
[tool.pytest.ini_options]
minversion = "8.0"
addopts = "--cov=sprout --cov-report=term-missing --cov-fail-under=90 -ra --strict-markers --strict-config --import-mode=importlib -q"
testpaths = ["tests"]
markers = [
"integration: end-to-end tests over the bundled corpus (still offline/deterministic)",
]
filterwarnings = [
"error",
# starlette's TestClient warns when paired with httpx<2; not our code, dev-only.
"ignore:Using .httpx. with .starlette.testclient. is deprecated",
]
[tool.coverage.run]
branch = true
source = ["sprout"]
omit = [
"src/sprout/_vendor/*",
"src/sprout/providers/bedrock.py",
"src/sprout/providers/anthropic_native.py",
"src/sprout/providers/plantnet.py",
"src/sprout/eval/llm_judge.py",
]
[tool.coverage.paths]
source = ["src/sprout", "*/site-packages/sprout"]
[tool.coverage.report]
exclude_also = [
"if TYPE_CHECKING:",
"raise NotImplementedError",
"@(abc\\.)?abstractmethod",
"\\.\\.\\.",
"if __name__ == .__main__.:",
]