-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathpyproject.toml
More file actions
231 lines (215 loc) · 7.37 KB
/
pyproject.toml
File metadata and controls
231 lines (215 loc) · 7.37 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
[build-system]
requires = ["hatchling"]
build-backend = "hatchling.build"
[project]
name = "polylogue"
version = "0.1.0"
description = "Polylogue CLI for AI chat archives"
readme = "README.md"
license = {text = "MIT"}
keywords = ["ai", "chatgpt", "claude", "conversation", "archive", "llm"]
authors = [{ name = "Sinity" }]
classifiers = [
"Development Status :: 4 - Beta",
"Environment :: Console",
"Intended Audience :: Developers",
"License :: OSI Approved :: MIT License",
"Programming Language :: Python :: 3",
"Programming Language :: Python :: 3.11",
"Programming Language :: Python :: 3.12",
"Programming Language :: Python :: 3.13",
"Topic :: Software Development :: Libraries",
]
requires-python = ">=3.11"
dependencies = [
"google-auth-oauthlib",
"google-api-python-client",
"google-auth-httplib2",
"httpx[http2]>=0.27.0,<1.0",
"rich>=13.0.0",
"textual>=0.47.0",
"jinja2",
"markdown-it-py",
"pygments>=2.20",
"ijson",
"sqlite-vec>=0.1.6", # Self-contained vector search
"questionary>=2.0.0",
"click>=8.1.0,<9.0",
"tenacity>=8.0.0",
"dateparser>=1.1.0",
"orjson>=3.9.0",
"structlog>=24.1.0",
"pydantic>=2.0,<3.0",
"aiosqlite>=0.19.0", # Async SQLite support
"pydantic-settings",
"glom>=24.7.0", # Declarative data extraction
"mcp>=1.0.0", # Model Context Protocol SDK
"pyyaml>=6.0", # YAML output format
"typing-extensions>=4.7", # TypedDict that pydantic accepts on Py<3.12
"watchfiles>=0.21", # Rust-backed filesystem watcher for live ingestion
# Transitive constraints to avoid known CVEs surfaced by pip-audit:
"cryptography>=46.0.7", # CVE-2026-39892 (transitive via google-auth)
"python-multipart>=0.0.26", # CVE-2026-40347 (transitive via mcp)
]
[project.optional-dependencies]
dev = [
"pytest>=9.0.3", # CVE-2025-71176
"pytest-cov>=4",
"pytest-asyncio>=0.23.0", # Async test support
"pytest-xdist>=3.5.0", # Parallel test execution
"pytest-randomly>=3.0", # Detect order-dependent tests; adds --randomly-seed
"pytest-benchmark>=5.0", # Microbenchmark suite (run with --benchmark-enable -p no:xdist)
"coverage[toml]>=7.6",
"hypothesis>=6.100",
"hypothesis-jsonschema>=0.23.0", # Generate test data from JSON schemas
"genson>=1.2.0", # Infer JSON schemas from samples
"jsonschema>=4.0.0", # Validate JSON against schemas
"syrupy>=4.0", # Snapshot testing — pytest plugin, .ambr files
"pyte>=0.8.0", # Terminal emulator for deterministic output snapshot tests
"mutmut>=3.0.0", # Mutation testing for coverage verification
"mypy>=1.17,<1.21",
"types-dateparser>=1.2.0", # dateparser library stubs for mypy
"types-PyYAML>=6.0", # yaml library stubs for mypy
"ruff>=0.1.0",
"pre-commit>=3.5.0",
"pip-audit>=2.7", # OSV-backed CVE scanning over the locked dev environment
]
ocr = [
"pillow",
"pytesseract",
]
fuzz = [
"atheris>=2.3.0", # Google's Python fuzzer
"mutmut>=3.0.0", # Mutation testing
]
tree-sitter = [
"tree-sitter>=0.22.0",
"tree-sitter-python>=0.21.0",
"tree-sitter-javascript>=0.21.0",
"tree-sitter-typescript>=0.21.0",
"tree-sitter-rust>=0.21.0",
"tree-sitter-go>=0.21.0",
"tree-sitter-java>=0.21.0",
"tree-sitter-c>=0.21.0",
"tree-sitter-cpp>=0.22.0",
"tree-sitter-bash>=0.21.0",
"tree-sitter-html>=0.21.0",
"tree-sitter-css>=0.21.0",
"tree-sitter-json>=0.21.0",
"tree-sitter-yaml>=0.6.0",
]
[project.urls]
Homepage = "https://github.com/sinity/polylogue"
Repository = "https://github.com/sinity/polylogue"
Issues = "https://github.com/sinity/polylogue/issues"
Documentation = "https://github.com/sinity/polylogue#readme"
[project.scripts]
polylogue = "polylogue.cli:main"
devtools = "devtools.__main__:main"
[tool.hatch.build.targets.wheel]
packages = ["polylogue", "devtools"]
[tool.hatch.build.hooks.custom]
path = "hatch_build.py"
[tool.pytest.ini_options]
addopts = "-ra -n auto --benchmark-disable --benchmark-storage=file://./.cache/pytest-benchmark"
testpaths = ["tests"]
asyncio_mode = "auto"
cache_dir = ".cache/pytest"
markers = [
"slow: marks tests as slow (deselect with '-m \"not slow\"')",
"integration: marks integration tests (pipeline, CLI end-to-end)",
"benchmark: marks benchmark tests (run with --benchmark-enable -p no:xdist -p no:randomly)",
"scale(level): parametric scale marker (small/medium/large/stretch)",
"machine_contract: marks root CLI JSON success/failure contract tests",
"query_routing: marks query-first CLI routing and read-surface tests",
"tui: marks Textual dashboard interaction tests",
"chaos: marks ingestion hostility, interruption, and chronology tests",
"live: marks operator-run live archive validation lanes",
]
filterwarnings = [
"ignore::ResourceWarning", # Unclosed sqlite3 connections in thread-local backend
"ignore::DeprecationWarning:dateparser", # dateparser strptime deprecation (external)
"ignore::pytest.PytestUnhandledThreadExceptionWarning", # aiosqlite cleanup in xdist workers
]
[tool.coverage.run]
source = ["polylogue"]
branch = true
data_file = ".cache/coverage/.coverage"
[tool.coverage.report]
skip_empty = true
show_missing = true
fail_under = 90
[tool.mypy]
python_version = "3.11"
strict = true
warn_unused_configs = true
warn_redundant_casts = true
warn_unused_ignores = true
warn_return_any = true
disallow_any_generics = true
disallow_incomplete_defs = true
disallow_untyped_defs = true
cache_dir = ".cache/mypy"
plugins = []
files = [
"polylogue",
"tests/**/*.py",
"devtools/**/*.py",
]
ignore_missing_imports = true
disallow_subclassing_any = false # Pydantic BaseModel seen as Any (plugin incompatible with nix mypy 1.17)
disallow_untyped_decorators = false # Click decorators are inherently untyped
[tool.ruff]
line-length = 120
target-version = "py310"
cache-dir = ".cache/ruff"
exclude = [
".git",
"__pycache__",
"build",
"dist",
".venv",
"venv",
]
[tool.ruff.lint]
select = [
"E", # pycodestyle errors
"F", # pyflakes
"I", # isort
"N", # pep8-naming
"UP", # pyupgrade
"B", # flake8-bugbear
"C4", # flake8-comprehensions
"SIM", # flake8-simplify
]
ignore = [
"E501", # line too long (handled by formatter)
"B008", # function calls in argument defaults
]
[tool.ruff.lint.per-file-ignores]
"tests/**" = [
"E402", # consolidated mega-files have mid-file section imports
"N803", # test parameter naming follows test conventions
"N806", # type alias naming in test helpers
"SIM105", # try-except-pass in test error handling is intentional
"SIM115", # NamedTemporaryFile(delete=False) pattern in benchmarks
"SIM117", # nested with-statements with comments between context managers
]
"polylogue/sources/providers/**" = ["N815"] # Pydantic alias fields match provider JSON schemas
[tool.ruff.lint.isort]
known-first-party = ["polylogue"]
[tool.mutmut]
paths_to_mutate = [
# Broad first-party surface. Chunk mutation campaigns with CLI globs,
# not by narrowing config down to a few hand-picked files.
"polylogue",
]
do_not_mutate = [
# Package markers and thin entrypoints add noise under mutation testing.
"polylogue/**/__init__.py",
"polylogue/**/__main__.py",
]
also_copy = ["polylogue", "README.md"]
# Mutmut runs inside one process; inheriting repo-wide `pytest -n auto`
# breaks trampoline bookkeeping inside xdist workers.
pytest_add_cli_args = ["-n", "0", "-p", "no:randomly", "-p", "no:random-order", "--benchmark-disable", "-m", "not benchmark"]