-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathpyproject.toml
More file actions
122 lines (108 loc) · 3.31 KB
/
Copy pathpyproject.toml
File metadata and controls
122 lines (108 loc) · 3.31 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
[project]
name = "rag"
version = "0.2.0"
description = "Small RAG system"
readme = "README.md"
requires-python = ">=3.12,<3.13"
license = { text = "MIT" }
authors = [{ name = "Nymbl RAG Assessment" }]
dependencies = [
"fastapi>=0.115",
"pydantic>=2.7",
"pydantic-settings>=2.5",
"psycopg[binary,pool]>=3.2",
"pgvector>=0.3",
"typer>=0.12",
"uvicorn[standard]>=0.30",
"google-genai>=0.3",
"openai>=1.50",
"jinja2>=3.1",
"pypdf>=4.0",
"tiktoken>=0.7",
"python-multipart>=0.0.9",
"python-docx>=1.1",
"numpy>=1.26",
"sentence-transformers>=5.5.1",
"fastembed>=0.8.0",
]
[dependency-groups]
dev = [
"pytest>=8.3",
"pytest-asyncio>=0.24",
"httpx>=0.27",
"ruff>=0.6",
"reportlab>=4.0",
"vulture>=2.16",
"mypy>=2.1.0",
]
[project.scripts]
rag = "rag.cli.main:app"
[build-system]
requires = ["hatchling"]
build-backend = "hatchling.build"
[tool.hatch.build.targets.wheel]
packages = ["src/rag"]
[tool.hatch.build.targets.sdist]
include = ["src/rag", "migrations", "pyproject.toml", "README.md"]
# --- ruff -----------------------------------------------------------------
# Constitution Art VI.1 + VI.5: lint + format, ban bare/blind excepts.
[tool.ruff]
target-version = "py312"
line-length = 100
src = ["src", "tests"]
[tool.ruff.lint]
select = [
"E", # pycodestyle errors
"F", # pyflakes
"W", # pycodestyle warnings
"I", # isort
"B", # flake8-bugbear
"UP", # pyupgrade
"BLE", # flake8-blind-except — Art VI.5: no bare/blind except
"SIM", # flake8-simplify
"RUF", # ruff-specific
]
ignore = [
"E501", # line length is handled by formatter
]
[tool.ruff.lint.per-file-ignores]
"tests/**" = ["B011"] # allow `assert False` in tests
"src/rag/cli/**" = ["B008"] # typer.Argument(...) as default is idiomatic Typer
"scripts/**" = ["BLE001"] # ad-hoc utility scripts may surface third-party errors loosely
[tool.ruff.format]
quote-style = "double"
# --- mypy -----------------------------------------------------------------
# Constitution Art VI.3: type-hinted public surfaces. Strict mode is enabled
# for the library; third-party SDKs without py.typed markers are silenced
# at the import boundary so checking stays signal-rich.
[tool.mypy]
python_version = "3.12"
strict = true
files = ["src/rag"]
explicit_package_bases = true
mypy_path = "src"
[[tool.mypy.overrides]]
module = ["pgvector", "pgvector.*"]
ignore_missing_imports = true
[[tool.mypy.overrides]]
# Gemini SDK contents= argument is typed as a deep union that disallows
# bare list[str], but the SDK accepts it in practice and our prompt
# helpers always serialize to str. Suppressing arg-type for the
# provider boundary keeps the rest of the codebase strictly checked.
module = ["rag.providers.gemini"]
disable_error_code = ["arg-type"]
# --- pytest ----------------------------------------------------------------
[tool.pytest.ini_options]
minversion = "8.0"
asyncio_mode = "auto"
testpaths = ["tests"]
markers = [
"integration: requires RUN_INTEGRATION=1 and a running `make up` stack",
]
addopts = "-m 'not integration' -ra"
filterwarnings = [
"error",
# google-genai emits some deprecation warnings transitively; tolerate them.
"ignore::DeprecationWarning:google.*",
"ignore::DeprecationWarning:pydantic.*",
]