Repository navigation
fix: restore Python 3.11 TypedDict compatibility - #242
Conversation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: ASSERTIVE Plan: Pro Run ID: 📒 Files selected for processing (22)
📝 WalkthroughWalkthroughSystematically updated Changes
Estimated code review effort🎯 2 (Simple) | ⏱️ ~10 minutes Possibly related issues
Possibly related PRs
Suggested labels
Poem
🚥 Pre-merge checks | ✅ 2 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (2 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Ref #241 Ref #222 ## Summary - switch runtime-loaded `TypedDict` payload surfaces to `typing_extensions.TypedDict` so Pydantic stays compatible with Python 3.11 - carry the same import boundary through adjacent devtool and test helper surfaces for consistency - stabilize one slow Hypothesis Drive payload property test that started flaking once the suite was exercised under 3.11 ## Problem Open refactor PRs were failing the `test (3.11)` GitHub Actions leg with `pydantic.errors.PydanticUserError: Please use typing_extensions.TypedDict instead of typing.TypedDict on Python < 3.12.` The repo verified locally on newer interpreters, but several runtime-loaded payload and state models still imported `TypedDict` from `typing`, which Pydantic v2 rejects under Python 3.11. ## Solution - rewired the affected runtime payload surfaces in `polylogue/` to import `TypedDict` from `typing_extensions`, including state, pipeline, surface-payload, source-assembly, and query-model helpers - mirrored the same import boundary in adjacent devtool and test/helper modules so the repo uses one consistent `TypedDict` contract across supported Python versions - updated `tests/unit/sources/test_drive_source_client.py` to suppress the `HealthCheck.too_slow` warning for the newline-delimited payload property test, which became flaky when the suite was actually run under Python 3.11 ## Verification - `ruff check devtools/pipeline_probe.py devtools/project_motd.py polylogue/cli/embed_stats.py polylogue/pipeline/run_finalization.py polylogue/pipeline/run_stages.py polylogue/pipeline/semantic_capture.py polylogue/pipeline/services/indexing.py polylogue/pipeline/services/ingest_worker.py polylogue/sources/assembly.py polylogue/storage/backends/queries/stats.py polylogue/storage/query_models.py polylogue/storage/session_product_runtime.py polylogue/storage/state_views.py polylogue/surface_payloads.py tests/infra/cli_subprocess.py tests/unit/cli/test_source_selection_helpers.py tests/unit/core/test_filters_props.py tests/unit/pipeline/test_resilience.py tests/unit/sources/test_drive_source_client.py tests/unit/sources/test_parser_crashlessness.py tests/unit/sources/test_source_laws.py tests/unit/storage/test_store_ops.py` - `uv run --python 3.11 --extra dev pytest -q -n 0 tests/unit/ui/test_ui.py tests/unit/scenarios/test_scenario_specs.py tests/integration/test_cli_machine_contract.py tests/unit/showcase/test_scenario_models.py` - `uv run --python 3.11 --extra dev pytest -q -n 0 tests/unit/sources/test_drive_source_client.py` - `devtools verify`
Open refactor PRs were failing the `test (3.11)` CI leg with `pydantic.errors.PydanticUserError: Please use typing_extensions.TypedDict instead of typing.TypedDict on Python < 3.12.` The repo verified locally on newer interpreters, but several runtime-loaded payload and state models still imported `TypedDict` from `typing`, which Pydantic v2 rejects under 3.11. Rewires the affected runtime payload surfaces in `polylogue/` to import `TypedDict` from `typing_extensions` (state, pipeline, surface-payload, source-assembly, query-model helpers). Mirrors the same import boundary in adjacent devtool and test/helper modules so the repo uses one consistent `TypedDict` contract across supported Python versions. Also stabilizes one slow Hypothesis Drive payload property test that started flaking once the suite was actually exercised under 3.11 (`HealthCheck.too_slow` suppression on `test_drive_source_client.py`'s newline-delimited property test). Verification: ruff clean across touched modules; pytest green under `uv run --python 3.11`; devtools verify green. Ref #241 Ref #222
Open refactor PRs were failing the `test (3.11)` CI leg with `pydantic.errors.PydanticUserError: Please use typing_extensions.TypedDict instead of typing.TypedDict on Python < 3.12.` The repo verified locally on newer interpreters, but several runtime-loaded payload and state models still imported `TypedDict` from `typing`, which Pydantic v2 rejects under 3.11. Rewires the affected runtime payload surfaces in `polylogue/` to import `TypedDict` from `typing_extensions` (state, pipeline, surface-payload, source-assembly, query-model helpers). Mirrors the same import boundary in adjacent devtool and test/helper modules so the repo uses one consistent `TypedDict` contract across supported Python versions. Also stabilizes one slow Hypothesis Drive payload property test that started flaking once the suite was actually exercised under 3.11 (`HealthCheck.too_slow` suppression on `test_drive_source_client.py`'s newline-delimited property test). Verification: ruff clean across touched modules; pytest green under `uv run --python 3.11`; devtools verify green. Ref #241 Ref #222
Open refactor PRs were failing the `test (3.11)` CI leg with `pydantic.errors.PydanticUserError: Please use typing_extensions.TypedDict instead of typing.TypedDict on Python < 3.12.` The repo verified locally on newer interpreters, but several runtime-loaded payload and state models still imported `TypedDict` from `typing`, which Pydantic v2 rejects under 3.11. Rewires the affected runtime payload surfaces in `polylogue/` to import `TypedDict` from `typing_extensions` (state, pipeline, surface-payload, source-assembly, query-model helpers). Mirrors the same import boundary in adjacent devtool and test/helper modules so the repo uses one consistent `TypedDict` contract across supported Python versions. Also stabilizes one slow Hypothesis Drive payload property test that started flaking once the suite was actually exercised under 3.11 (`HealthCheck.too_slow` suppression on `test_drive_source_client.py`'s newline-delimited property test). Verification: ruff clean across touched modules; pytest green under `uv run --python 3.11`; devtools verify green. Ref #241 Ref #222
|
@codex review |
|
Codex Review: Didn't find any major issues. Can't wait for the next one! ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
If Codex has suggestions, it will comment; otherwise it will react with 👍. Codex can also answer questions or update the PR. Try commenting "@codex address that feedback". |
Ref #241
Ref #222
Summary
TypedDictpayload surfaces totyping_extensions.TypedDictso Pydantic stays compatible with Python 3.11Problem
Open refactor PRs were failing the
test (3.11)GitHub Actions leg withpydantic.errors.PydanticUserError: Please use typing_extensions.TypedDict instead of typing.TypedDict on Python < 3.12.The repo verified locally on newer interpreters, but several runtime-loaded payload and state models still importedTypedDictfromtyping, which Pydantic v2 rejects under Python 3.11.Solution
polylogue/to importTypedDictfromtyping_extensions, including state, pipeline, surface-payload, source-assembly, and query-model helpersTypedDictcontract across supported Python versionstests/unit/sources/test_drive_source_client.pyto suppress theHealthCheck.too_slowwarning for the newline-delimited payload property test, which became flaky when the suite was actually run under Python 3.11Verification
ruff check devtools/pipeline_probe.py devtools/project_motd.py polylogue/cli/embed_stats.py polylogue/pipeline/run_finalization.py polylogue/pipeline/run_stages.py polylogue/pipeline/semantic_capture.py polylogue/pipeline/services/indexing.py polylogue/pipeline/services/ingest_worker.py polylogue/sources/assembly.py polylogue/storage/backends/queries/stats.py polylogue/storage/query_models.py polylogue/storage/session_product_runtime.py polylogue/storage/state_views.py polylogue/surface_payloads.py tests/infra/cli_subprocess.py tests/unit/cli/test_source_selection_helpers.py tests/unit/core/test_filters_props.py tests/unit/pipeline/test_resilience.py tests/unit/sources/test_drive_source_client.py tests/unit/sources/test_parser_crashlessness.py tests/unit/sources/test_source_laws.py tests/unit/storage/test_store_ops.pyuv run --python 3.11 --extra dev pytest -q -n 0 tests/unit/ui/test_ui.py tests/unit/scenarios/test_scenario_specs.py tests/integration/test_cli_machine_contract.py tests/unit/showcase/test_scenario_models.pyuv run --python 3.11 --extra dev pytest -q -n 0 tests/unit/sources/test_drive_source_client.pydevtools verify