-
Notifications
You must be signed in to change notification settings - Fork 5
Expand file tree
/
Copy pathpyproject.toml
More file actions
171 lines (147 loc) · 5.29 KB
/
pyproject.toml
File metadata and controls
171 lines (147 loc) · 5.29 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
# Sibyl workspace configuration
# Shared dependency and tooling config for the graph + task workflow monorepo
# =============================================================================
# UV Workspace Configuration (virtual workspace - not a package)
# =============================================================================
[tool.uv]
# =============================================================================
# Version Constraints (enforced across all workspace members)
# Members use loose specs, these ensure consistent bounds
# =============================================================================
constraint-dependencies = [
# Dev tooling
"ruff>=0.14,<1.0",
"ty>=0.0.10,<1.0",
"pytest>=9.0,<10.0",
"pytest-asyncio>=1.3,<2.0",
"pytest-cov>=7.0,<8.0",
"pre-commit>=4.0,<5.0",
# E2E testing
"httpx>=0.28,<1.0",
"playwright>=1.50,<2.0",
# Transitive deps (avoid yanked versions)
"numpy>=2.4.1",
]
[tool.uv.workspace]
members = [
"apps/api",
"apps/cli",
"packages/python/sibyl-core",
]
# =============================================================================
# Shared Dependency Sources
# These are inherited by all workspace members
# =============================================================================
[tool.uv.sources]
# Local packages - workspace members reference each other
sibyl-core = { workspace = true }
sibyl-dev = { workspace = true }
sibyld = { workspace = true }
# =============================================================================
# Shared Tool Configuration
# =============================================================================
[tool.ruff]
line-length = 100
src = ["apps/*/src", "packages/*/src", "hooks"]
[tool.ruff.lint]
select = [
"E", "F", "I", "UP", "B", "SIM", "RUF",
"ASYNC", "S", "C4", "T20", "PT", "PL", "TRY",
]
ignore = [
"E501", # Line length (formatter handles)
"S101", # Assert (tests/contracts)
"TRY003", # Long exception messages
"PLR0913", # Too many arguments
]
[tool.ruff.lint.per-file-ignores]
# Hooks need print for output, subprocess for CLI calls, silent failures
"hooks/*.py" = [
"T20", # print statements (needed for hook output)
"S603", # subprocess call (calling our own CLI)
"S607", # partial executable path (sibyl is in PATH)
"S110", # try-except-pass (intentional silent failures)
"SIM105", # contextlib.suppress (explicit try-except is clearer here)
"PLR2004", # magic numbers (thresholds are clear in context)
]
[tool.ruff.lint.isort]
known-first-party = ["sibyl", "sibyl_core", "sibyl_cli"]
[tool.ty.environment]
python-version = "3.13"
[tool.ty.rules]
# External packages without stubs (FalkorDB, Graphiti, etc.)
unresolved-import = "ignore"
# Graphiti uses dynamic attributes
unresolved-attribute = "warn"
possibly-missing-attribute = "warn"
# Gradual adoption - start with warnings
invalid-argument-type = "warn"
invalid-return-type = "warn"
# Sentinel patterns and dynamic dict access - warn for now
invalid-assignment = "warn"
unsupported-operator = "warn"
# Runtime length checks not visible to static analysis
index-out-of-bounds = "warn"
[tool.ty.src]
include = ["apps/*/src/**/*.py", "packages/python/*/src/**/*.py", "hooks/*.py"]
exclude = ["**/build/**", "**/.venv/**", "**/migrations/**"]
# Hooks use sys.exit() for control flow which ty doesn't understand
[[tool.ty.overrides]]
include = ["hooks/*.py"]
[tool.ty.overrides.rules]
invalid-argument-type = "ignore"
# Intentional monkey-patching for FalkorDB concurrency fixes
[[tool.ty.overrides]]
include = ["**/graph/client.py"]
[tool.ty.overrides.rules]
invalid-assignment = "ignore"
# crawl4ai has complex union types that confuse ty
[[tool.ty.overrides]]
include = ["**/crawler/*.py"]
[tool.ty.overrides.rules]
missing-argument = "ignore"
# SQLAlchemy/SQLModel: column comparisons return ColumnElement, not bool
# Also affects .desc(), .asc(), .label(), .op() methods on mapped columns
# cli/*.py also has entity union types (EntitySummary | RelatedEntity | Unknown)
[[tool.ty.overrides]]
include = ["**/db/*.py", "**/api/routes/*.py", "**/auth/*.py", "**/cli/*.py"]
[tool.ty.overrides.rules]
invalid-argument-type = "ignore"
unresolved-attribute = "ignore"
no-matching-overload = "ignore"
unsupported-operator = "ignore"
possibly-missing-attribute = "ignore"
# arq worker/jobs: cron() function, SQLAlchemy queries
[[tool.ty.overrides]]
include = ["**/jobs/*.py"]
[tool.ty.overrides.rules]
invalid-argument-type = "ignore"
# FastAPI/Starlette middleware and app setup
[[tool.ty.overrides]]
include = ["**/api/app.py", "**/server.py", "**/locks.py"]
[tool.ty.overrides.rules]
invalid-argument-type = "ignore"
# crawl4ai service types - result container union
[[tool.ty.overrides]]
include = ["**/crawler/service.py"]
[tool.ty.overrides.rules]
invalid-argument-type = "ignore"
possibly-missing-attribute = "ignore"
# Graph entity manager - dynamic dict access
[[tool.ty.overrides]]
include = ["**/graph/entities.py"]
[tool.ty.overrides.rules]
invalid-argument-type = "ignore"
[tool.pytest.ini_options]
asyncio_mode = "auto"
asyncio_default_fixture_loop_scope = "function"
addopts = ["-ra", "--strict-markers", "-v"]
filterwarnings = [
"error",
"ignore::DeprecationWarning",
"ignore::pytest.PytestUnraisableExceptionWarning",
]
[dependency-groups]
dev = [
"ty>=0.0.13",
]