-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathpyproject.toml
More file actions
321 lines (292 loc) · 9.81 KB
/
Copy pathpyproject.toml
File metadata and controls
321 lines (292 loc) · 9.81 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
[project]
name = "lychd"
dynamic = ["version"]
description = "Systemd-native daemon for local agentic orchestration"
readme = "README.md"
authors = [
{ name = "LychD contributors", email = "hexanomicon@proton.me" }
]
requires-python = ">=3.12, <3.15"
license = "MPL-2.0"
license-files = [
"LICENSE",
"THIRD_PARTY_NOTICES.md",
"frontend/static/THIRD_PARTY_NOTICES.txt",
]
keywords = ["systemd", "agentic", "llm", "daemon", "litestar", "pydantic-ai", "quadlet", "ai"]
classifiers = [
"Development Status :: 2 - Pre-Alpha",
"Intended Audience :: Developers",
"Intended Audience :: System Administrators",
"License :: OSI Approved :: Mozilla Public License 2.0 (MPL 2.0)",
"Operating System :: POSIX :: Linux",
"Environment :: No Input/Output (Daemon)",
"Programming Language :: Python :: 3.12",
"Programming Language :: Python :: 3.13",
"Topic :: System :: Systems Administration",
"Topic :: Scientific/Engineering :: Artificial Intelligence",
"Framework :: Pydantic",
"Typing :: Typed",
]
dependencies = [
"advanced-alchemy>=1.8.0",
"alembic>=1.17.0",
"anyio>=4.0.0",
"asyncpg>=0.29.0",
"click>=8.1.0",
"httpx<=0.28.1", # PINNED, review later
"jinja2>=3.1.6",
"litestar[sqlalchemy,structlog,pydantic,opentelemetry]>=2.24.0,<3", # v3 migration not audited
"litestar-granian>=0.14.2",
"litestar-saq>=0.5.3",
"pgvector>=0.4.0",
"psycopg[pool]>=3.2.13,<4",
"pydantic>=2.10.0",
"pydantic-ai-slim[openai,logfire]==1.25.1", # exact until the v2 durability/message migration suite lands
"pydantic-settings[toml]>=2.10.1",
"rich>=13.9.0",
"sqlalchemy>=2.0.0",
"structlog>=24.4.0",
"tomlkit>=0.13.3",
]
[project.optional-dependencies]
# Local contributors may opt into Psycopg's self-contained native wheel when
# system libpq is unavailable. The production Vessel never installs extras and
# explicitly rejects this distribution at image-build time.
postgres-binary = [
"psycopg-binary==3.2.13",
]
[project.urls]
Homepage = "https://github.com/hexanomicon/lychd"
Issues = "https://github.com/hexanomicon/lychd/issues"
[dependency-groups]
docs = [
"zensical"
]
test = [
"pytest",
"pytest-asyncio",
"pytest-xdist",
"pytest-mock",
"pytest-cov",
"polyfactory",
"pytest-sugar",
"respx",
"selectolax",
]
container-test = [
"testcontainers[postgres]>=4.15.0,<5",
]
lint = [
"ruff>=0.1.0",
"codespell>=2.4.1",
"bump-my-version"
]
typing = [
"basedpyright>=1.1.0"
]
# NOTE:
# `typing` is intentionally NOT included in `dev`.
# Reason: some contributor setups (notably VSCodium + Pyright integration)
# can degrade when basedpyright is always installed in the default dev env.
# Use `make type-check` (which runs via `uv`) or sync the group explicitly
# when strict type analysis is needed.
dev = [
{ include-group = "docs" },
{ include-group = "test" },
{ include-group = "lint" },
]
[project.scripts]
lychd = "lychd.__main__:run_cli"
# --- BUILD SYSTEM ---
[build-system]
requires = ["hatchling>=1.27"]
build-backend = "hatchling.build"
[tool.hatch.version]
path = "src/lychd/__about__.py"
[tool.hatch.build.targets.sdist]
include = [
"/Containerfile",
"/LICENSE",
"/Makefile",
"/README.md",
"/THIRD_PARTY_NOTICES.md",
"/frontend",
"/pyproject.toml",
"/scripts",
"/src",
"/tests",
]
exclude = [
"/.agents",
"/.cache",
"/.coverage",
"/.jj",
"/node_modules",
"/site",
]
[tool.hatch.build.targets.wheel]
packages = ["src/lychd"]
# --- TESTING (Pytest) ---
[tool.pytest.ini_options]
minversion = "6.0"
testpaths = ["tests"]
# Keep core pytest defaults here. Parallelism and coverage mode are controlled
# by Makefile targets (`make test`, `make coverage`) to avoid duplicated flags.
addopts = [
"--strict-markers", # Fail on typos in markers
"--strict-config", # Fail on bad config
"--tb=short", # Cleaner error tracebacks
"-ra", # Show summary of skips/fails
"-v", # Verbose
]
log_cli = true
log_cli_level = "DEBUG"
log_cli_date_format = "%Y-%m-%d %H:%M:%S"
log_cli_format = "%(asctime)s %(levelname)s %(message)s"
markers = [
"unit: Pure logic tests. Fast. No database/network required.",
"integration: Tests that hit the DB, Redis, or external APIs. Slower.",
"container: Explicit disposable-container receipt excluded from the ordinary test/check gate.",
"slow: Tests that take a long time (e.g., heavy AI inference).",
]
# Silence noise from dependencies
filterwarnings = [
"ignore::DeprecationWarning:pkg_resources",
"ignore::DeprecationWarning:google.*",
"ignore::DeprecationWarning:passlib.*",
"ignore::DeprecationWarning:litestar.constants.*",
"ignore::DeprecationWarning:httpx._client",
]
[tool.coverage.run]
branch = true
parallel = true
concurrency = ["multiprocessing"]
omit = ["tests/*"]
[tool.coverage.report]
show_missing = true
skip_covered = true
fail_under = 80
exclude_lines = [
'if TYPE_CHECKING:',
'pragma: no cover',
"if __name__ == .__main__.:",
'def __repr__',
'raise NotImplementedError',
'if 0:',
'class .*\bProtocol\):',
'@(abc\.)?abstractmethod',
'if settings\.debug:',
]
# --- LINTING (Ruff) ---
[tool.ruff]
line-length = 120
target-version = "py313" # Restored to your preference
src = ["src", "tests"]
[tool.codespell]
ignore-words-list = "tread,wither,selectin,selectinload"
[tool.ruff.lint]
select = ["ALL"]
fixable = ["ALL"]
# I merged your broad ignores ("D", "ANN") with the reference's specific ones.
# This list is safer than ignoring "ALL" docstrings, but still suppresses
# the annoying ones like "Missing docstring in __init__".
ignore = [
"E501", # Line length (Handled by formatter)
"ANN101", # Missing type annotation for `self`
"ANN102", # Missing type annotation for `cls`
"ANN401", # Dynamically typed expressions (Any)
"D100", # Missing docstring in public module
"D104", # Missing docstring in public package
"D106", # Missing docstring in public nested class
"D102", # pydocstyle - missing docstring in public method
"D101", # pydocstyle - missing docstring in public class
"D103", # pydocstyle - missing docstring in public function
"D203", # One-blank-line-before-class (conflicts with D211)
"D213", # Multi-line-summary-second-line (conflicts with D212)
"TD003", # Missing issue link for TODO
"FIX002", # Line contains TODO (Restored your ignore)
"COM812", # Trailing comma (Conflicts with formatter)
"ISC001", # Implicit string concatenation (Conflicts with formatter)
"PLC0415", # Import outside toplevel (Useful for lazy loading)
"TC001", # Move import to TYPE_CHECKING (Sometimes annoying with Pydantic)
"TC002", # Move import to TYPE_CHECKING
"TC003", # Move import to TYPE_CHECKING
"TD", # flake8-todos - Ignores rules about TODO formatting
"PLR0913", # Too many arguments
]
[tool.ruff.lint.isort]
known-first-party = ["lychd", "tests"]
[tool.ruff.lint.pep8-naming]
# Allow SQLAlchemy standard class methods
classmethod-decorators = [
"classmethod",
"sqlalchemy.ext.declarative.declared_attr",
"sqlalchemy.orm.declared_attr.directive",
"sqlalchemy.orm.declared_attr",
]
[tool.ruff.lint.flake8-tidy-imports]
ban-relative-imports = "all"
[tool.ruff.lint.per-file-ignores]
# --- TESTS ---
"tests/**/*" = [
"S101", # Use of `assert` detected. (Standard for pytest, though insecure in production code).
"PLR2004", # Magic value used in comparison. (Allowed for assertions like `status == 200`).
"SLF001", # Private member accessed. (Allowed for white-box testing of internal state).
"ARG001", # Unused function argument. (Allowed for pytest fixtures that handle setup/teardown).
"D", # Missing docstrings. (Test functions names should be descriptive enough).
]
# --- INIT FILES ---
"__init__.py" = [
"F401", # Module imported but unused. (Required for re-exporting symbols to the public API).
"D104", # Missing docstring in public package. (Redundant for init files that just expose imports).
"TID252", # Relative imports. (Idiomatic in __init__ to expose APIs via `from . import ...`).
]
# --- DB MIGRATIONS ---
"src/lychd/db/migrations/versions/*" = [
"D", # Docstring rules. (Migration files follow the semi-generated alembic template).
"E501", # Line length. (Autogenerated column DDL can be long).
"INP001", # Implicit namespace package. (Alembic version dirs carry no __init__.py).
"PGH003", # Blanket type-ignore. (The alembic script template uses `# type: ignore`).
]
[tool.ruff.format]
quote-style = "double"
indent-style = "space"
# --- TYPE CHECKING (BasedPyright) ---
[tool.pyright]
include = ["scripts", "src", "tests"]
venvPath = "."
venv = ".venv"
typeCheckingMode = "strict"
reportMissingImports = true
reportMissingTypeStubs = false
disableBytesTypePromotions = true
reportUnnecessaryTypeIgnoreComment = true
# Restored to TRUE as per your original file.
# You fixed the _engine issue, so you can afford to be strict here.
reportPrivateUsage = true
# --- VERSIONING ---
[tool.bumpversion]
current_version = "0.0.2"
parse = "(?P<major>\\d+)\\.(?P<minor>\\d+)\\.(?P<patch>\\d+)"
serialize = ["{major}.{minor}.{patch}"]
search = "{current_version}"
replace = "{new_version}"
regex = false
ignore_missing_files = false
tag = false
sign_tags = false
tag_name = "v{new_version}"
tag_message = "Bump version: {current_version} → {new_version}"
allow_dirty = false
commit = false
message = "Bump version: {current_version} → {new_version}"
commit_args = ""
[[tool.bumpversion.files]]
filename = "pyproject.toml"
search = 'version = "{current_version}"'
replace = 'version = "{new_version}"'
[[tool.bumpversion.files]]
filename = "src/lychd/__about__.py"
search = '__version__ = "{current_version}"'
replace = '__version__ = "{new_version}"'