Conversation
Start a fresh GraphServer on an OS-assigned loopback port for every test, then point in-process defaults and child environments at it. This prevents tests from attaching to unrelated servers while preserving explicit address overrides. Keep implicit auto-start coverage with a dedicated isolated test and re-enable test_attach for multiprocess attachment.
Wait for both child processes with a bounded timeout and assert successful exit codes. Ensure failed or hung children are terminated and make the test module importable to Windows spawn workers.
Pass the resolved GraphServer address to backend processes so Python 3.14 forkserver workers do not reuse a stale environment value.
The optional `schema` extra (pydantic, soft-imported) adds three behaviors, all degrading to exactly the previous behavior when absent: - SettingsSchemaMetadata gains a pydantic-generated json_schema, attached at the one choke point every producer already flows through (settings_schema_from_type), so graph component metadata, settings snapshots, and settings events all carry a standard schema consumers can validate against without parsing the field_type strings. - Dynamic settings field updates are validated and coerced in the owning backend process, where everything needed is importable, before the patch is applied and broadcast. A refused value fails the process control request with the reason. It no longer publishes a value the settings type cannot hold. - Structured settings snapshot values prefer pydantic's JSON-mode dump, which round-trips exactly what the type's schema describes.
Reorder and split imports in `settingsmeta` to match project style.
Emits one JSON doc per module for component types, streams, settings, and collection children without instantiating them. Everything is read from class-level state the component metaclasses already maintain (__streams__, __settings_type__, __components__), so nothing is instantiated, no settings values are required, and no graph server is involved. This is the generic core of what downstream inspector CLIs hand-roll to drive settings UIs from a separate venv; they can shrink onto this command and keep only their app-specific conventions.
settingsmeta is reached by a plain `import ezmsg.core`, so importing pydantic at module level charged every ezmsg process roughly 200 ms and 5 MB, including every spawned backend process, which re-imports from scratch on spawn platforms regardless of whether or not it ever described or coerced a setting. Deferring the import behind a cached accessor means only the process that builds graph metadata, and processes that actually handle settings updates, pay for it.
…son-schema-settings-stack
This branch was successfully deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Integrate
feature/json-schema-settingson top of #270 so a single release branch includes the enum serialization fix, resolved generic stream metadata, and optional JSON-schema settings support.This merge preserves Konrad’s commits and includes
ezmsg[schema], JSON Schema in settings metadata, validation/coercion of dynamic field updates, andezmsg inspect. Pydantic remains optional and is loaded on first use. The feature branch’s test-isolation and multiprocess-attach prerequisites are retained. No merge conflicts required manual resolution.PR stack: #258 → #265 → #267 → #270 → this PR. Merge/review in that order; this branch’s tip already contains the combined history and can be used for a beta tag after bumping the version. The version remains
3.10.0b3; no tag or release is created by this PR.Validation (Python 3.12, macOS):
pytest tests --benchmark-disable).git diff --checkpasses.The existing CI workflow only auto-runs for PRs targeting
mainordev, so these stacked PRs require a manual workflow dispatch or retargeting for the platform/Python matrix.