-
Notifications
You must be signed in to change notification settings - Fork 4
Expand file tree
/
Copy pathpyproject.toml
More file actions
241 lines (226 loc) · 9.29 KB
/
Copy pathpyproject.toml
File metadata and controls
241 lines (226 loc) · 9.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
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
[project]
name = "mewbo-workspace"
version = "0.0.14"
description = "Workspace package for the Mewbo monorepo."
readme = "README.md"
requires-python = ">=3.10,<4.0"
authors = [
{ name = "Krishnakanth Alagiri", email = "mail@kanth.tech" },
]
license = { text = "MIT" }
dependencies = [
"aniso8601>=10.0.1",
"mewbo-core>=0.0.10",
"mewbo-tools>=0.0.10",
"mewbo-cli>=0.0.10",
]
[project.scripts]
mewbo = "mewbo_cli.cli_master:main"
[project.optional-dependencies]
api = ["mewbo-api>=0.0.10"]
ha = ["mewbo-ha-conversation>=0.0.10"]
wiki = ["mewbo-api[wiki]>=0.0.10"]
mcp = ["mewbo-mcp>=0.0.10"]
[dependency-groups]
dev = [
"altair>=6.1.0",
"autopep8==2.3.2",
"flake8==7.3.0",
# mewbo-api's `docker` extra pulls the docker-py SDK. Only the api's OWN
# extras cover it (the workspace root's own optional-dependencies never
# forward it) — without this line `uv sync --all-extras` still leaves the
# SDK uninstalled, and the DockerContainerBackend test modules abort
# collection for the whole apps/mewbo_api/tests run.
"mewbo-api[docker]",
"mewbo-demo-seeder",
# Both demo workspace members belong here, not only in [tool.uv.sources].
# A source entry says where a package RESOLVES from; it does not install it.
# Left out, a `uv sync` drops mewbo-demo-framer from the shared venv and its
# whole suite aborts collection with ModuleNotFoundError — which reads as a
# broken package rather than a missing install.
"mewbo-demo-framer",
# The identity drivers live behind extras so a deployment installs only what
# it federates with. The suite needs every one of them present, or the driver
# paths import-guard themselves out and the run reports green having tested
# nothing.
"mewbo-iam[ldap,oidc,saml]",
# Same reason as the line above: the speech substrate's network leg lives
# behind its `gateway` extra, and the suite exercises the DEFAULT transport
# against a loopback listener. Without the extra installed that leg
# import-guards itself out and the run reports green having tested nothing.
"mewbo-speech[gateway]",
"mongomock==4.3.0",
"mypy==1.19.1",
"pandas>=2.3.3",
"pre-commit==3.8.0",
"pylint==3.3.9",
"pytest==8.4.2",
"pytest-cov==7.1.0",
# Parallel execution, used only through an explicit `-n <N> --dist loadfile`
# on an invocation — never through addopts. `-n auto` is refused on purpose:
# this machine routinely runs several suites at once and auto sizes to the
# CPU count with no awareness of that, which turns failure counts into
# load-dependent noise. `loadfile` rather than `load` because several test
# files save and restore module globals within one file, and `load` can split
# a single file across workers.
"pytest-xdist==3.8.0",
"pytest-timeout==2.4.0",
"ruff==0.15.8",
"streamlit>=1.56.0",
# zoneinfo has no tz database of its own: uv's managed CPython ships none, so
# ZoneInfo("US/Eastern") (the IDE TTL tests) raises ZoneInfoNotFoundError on
# any machine without a system tzdb. Pin it for the suite, not for runtime.
"tzdata>=2026.1",
"types-requests==2.33.0.20260327",
"vulture==2.16",
]
docs = [
"mike",
"mkdocs",
"mkdocs-callouts>=1.16.0",
# Brand-fork of mkdocs-shadcn — same `theme: shadcn` entrypoint plus the
# Mewbo brand chrome, Ask AI panel, sidebar nav-icons, prefetch
# speculation, ToC rail, dual-mode search modal, full SEO.
#
# Pin the immutable tag-release wheel, never `latest-master`: that rolling
# release renames its asset on every version bump (the filename embeds the
# version), 404ing the old URL and breaking builds. To upgrade: tag a new
# vX.Y.Z in the fork, update this URL, then refresh the lock:
#
# uv lock --upgrade-package mkdocs-shadcn-mewbo
"mkdocs-shadcn-mewbo @ https://github.com/mewbo-com/mkdocs-shadcn/releases/download/v1.15.0/mkdocs_shadcn_mewbo-1.15.0-py3-none-any.whl",
"mkdocstrings[python]",
"pymdown-extensions>=10.20.1",
]
[tool.uv.workspace]
# Apps are members (not bare path deps) so images can install one app and its
# locked dependency closure with the STANDARD `uv sync --frozen --package
# mewbo-api` — no export/constraints contortions (see docker/Dockerfile.api).
# mewbo_ha_conversation stays a PATH source (below), not a member: it declares
# homeassistant as a dependency (host platform, Python >=3.14), which cannot
# intersect the workspace's requires-python — and it deploys out-of-band on a
# separate host anyway.
members = [
"packages/*",
"apps/mewbo_api",
"apps/mewbo_cli",
"apps/mewbo_mcp",
"demo/seeder",
"demo/framer",
]
[tool.uv]
# Empty on purpose, and it is NOT uv's default (`["dev"]`) — it is what makes a
# bare `uv sync` mean the LEAN install that `docs/getting-started.md` publishes
# as the quick start (`uv sync --extra api`). Restore uv's default here and that
# published command silently drags ruff, mypy, pytest, streamlit and pandas into
# an end user's environment.
#
# ⚠️ The cost lands on a bare `uv sync`, which is EXACT by default: against this
# setting it reads "no group requested" as "remove the dev group", and takes 97
# packages out of a shared `.venv` — pytest's own plugins among them. Re-sync
# with the full `--all-extras --all-groups`, never a narrower form.
#
# `uv run` is NOT affected and never was: it is INEXACT by default, installing
# what is missing and removing nothing, which is why `uv run --exact` exists as
# an opt-in. Do not add `--no-sync` to call sites to guard against a hazard they
# do not have.
#
# Flipping this value would break the published lean install and would not even
# work: uv has `default-groups` but no `default-extras`, so a lean sync still
# drops every extra and takes the wiki, SCG and MCP test subtrees with it. See
# root CLAUDE.md → "Running, testing, linting".
default-groups = []
[tool.uv.sources]
mewbo-core = { workspace = true }
mewbo-tools = { workspace = true }
mewbo-graph = { workspace = true }
mewbo-iam = { workspace = true }
mewbo-speech = { workspace = true }
mewbo-cli = { workspace = true }
mewbo-api = { workspace = true }
mewbo-mcp = { workspace = true }
mewbo-demo-seeder = { workspace = true }
mewbo-demo-framer = { workspace = true }
mewbo-ha-conversation = { path = "apps/mewbo_ha_conversation", editable = true }
[build-system]
requires = ["hatchling>=1.25.0"]
build-backend = "hatchling.build"
[tool.hatch.build.targets.wheel]
# Metadata-only root meta-package: ships the `mewbo` entry point and dist
# metadata (mewbo_core.config.get_version fallback) with no package files.
bypass-selection = true
[tool.ruff]
line-length = 100
target-version = "py310"
extend-exclude = [
"apps/mewbo_ha_conversation/translations",
"vendor",
"scripts",
]
[tool.ruff.lint]
select = ["D", "E", "F", "I", "UP"]
fixable = ["ALL"]
per-file-ignores = { "packages/mewbo_tools/src/mewbo_tools/aider_bridge/edit_blocks.py" = ["D"], "vendor/**" = ["D"], "tests/**" = ["D"], "apps/*/tests/**" = ["D"] }
[tool.ruff.lint.isort]
combine-as-imports = true
[tool.ruff.lint.pydocstyle]
convention = "google"
[tool.mypy]
files = [
"packages/mewbo_core/src/mewbo_core/**/*.py",
"packages/mewbo_tools/src/mewbo_tools/**/*.py",
"packages/mewbo_graph/src/mewbo_graph/**/*.py",
"packages/mewbo_iam/src/mewbo_iam/**/*.py",
"packages/mewbo_speech/src/mewbo_speech/**/*.py",
"apps/mewbo_api/src/mewbo_api/**/*.py",
"apps/mewbo_mcp/src/mewbo_mcp/**/*.py",
"apps/mewbo_cli/src/mewbo_cli/**/*.py",
"apps/mewbo_ha_conversation/**/*.py",
"demo/seeder/src/mewbo_demo_seeder/**/*.py",
"demo/framer/src/mewbo_demo_framer/**/*.py",
]
explicit_package_bases = true
mypy_path = ["."]
python_version = "3.10"
ignore_missing_imports = true
warn_unused_ignores = true
warn_redundant_casts = true
warn_unused_configs = true
[tool.pytest.ini_options]
# A strict, generous time budget rather than a tuned one. The cap exists to turn
# pathology into a failure, NOT to encode today's speed as a contract: the
# slowest legitimate case measures ~27s, so 300s leaves an order of magnitude of
# headroom while still failing a run that has stopped making progress. A
# quadratic-regex defect once shipped as a PASSING test that burned eight
# minutes, and nothing could fail for it.
#
# `thread` is load-bearing, not a default. The signal method raises between
# bytecode instructions, so it cannot interrupt a long call inside a C
# extension — which is exactly what a runaway `re` match is. Only the thread
# method observes that class of hang at all; the cost is that it takes the whole
# process down rather than failing one test, which is the right trade when the
# alternative is a run that never returns.
timeout = 300
timeout_method = "thread"
# `--strict-markers`/`--strict-config` fail a typo instead of silently selecting
# nothing, which becomes load-bearing as soon as markers gate a test tier.
addopts = "--strict-markers --strict-config --durations=25"
# Tier 2. The default run collects these and they SKIP when the container is
# absent, so a plain `pytest` still needs no Docker; `make test-mongo` boots the
# substrate and selects them with `-m realmongo`.
markers = [
"realmongo: needs the real MongoDB from tests/docker-compose.test.yml (make test-mongo); skips when it is absent",
]
testpaths = [
"tests",
"apps/mewbo_api/tests",
"apps/mewbo_mcp/tests",
"apps/mewbo_cli/tests",
"demo/seeder/tests",
"demo/framer/tests",
]
[tool.coverage.run]
omit = [
"packages/mewbo_tools/src/mewbo_tools/vendor/*",
"vendor/*",
]