Implement the typed doctest core architecture - #93
Draft
tony wants to merge 6 commits into
Draft
Conversation
why: Test the ADR boundaries against stock prompt semantics, typed markup extraction, shared groups, and extended execution. what: - Add immutable contracts, settings, models, and registry snapshots - Extract and project reStructuredText and MyST into group recipes - Run prompt and exec lanes with typed results and cleanup policy - Cover projection, runtime, registry, and Sphinx doctree behavior
why: Keep the released direct API and command shape while exercising the same extraction, projection, and execution path as other hosts. what: - Adapt the finder and direct runner to typed block and group results - Preserve stock failure and summary accounting across Python versions - Add direct facade ordering, location, and reporting regressions
why: Preserve pytest fixtures, checker semantics, and reporting without blocking the built-in doctest plugin or splitting shared group state. what: - Add one item per group with fresh attempt-local doctest materialization - Quarantine private pytest compatibility and filter duplicate collectors - Exercise fixtures, reruns, xdist, async fixtures, and contributions - Package the typed core, adapters, tests, and corrected plugin entry point
why: Broad major-version constraints hid invalid dependency combinations and did not prove the declared Python and pytest floor. what: - Pin docutils, pytest, asyncio, and rerun plugin matrix versions - Select the matrix interpreter for every uv command - Check installed dependency consistency before static and runtime gates
why: The proposed architecture contained compatibility and lifecycle claims that changed when exercised against real hosts and version floors. what: - Record the typed-core and thin-adapter bakeoff result - Narrow vanilla, diagnostics, line, and pytest compatibility promises - Define runner and registry contracts proven by the implementation - List deferred host lifecycle, reporting, async, and facade work
why: Public guidance must distinguish the direct command from pytest's one-item-per-group behavior without promising full stdlib transcripts. what: - Describe direct doctest command and summary behavior - Explain built-in pytest doctest plugin composition - Clarify bare-block isolation and the Sphinx default directive group - State the supported docutils range
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.
Depends on #92.
Summary
doctest_corepipeline for parsing, projection, registration, and execution.doctest_docutilsandpytest_doctest_docutilsas adapters over the core while preserving their command and collection surfaces.doctest.DocTestand source location for each block.docutils,pytest,pytest-asyncio, andpytest-rerunfailuresversions.The architecture ADR remains proposed. This draft implements it against the existing direct and pytest entry points so the contracts can be reviewed against executable behavior.
Why
The direct and pytest paths previously owned overlapping parsing and execution behavior. The pytest adapter also blocked the standard doctest plugin while depending on its implementation. A shared core separates host integration, scheduling identity, and diagnostic identity without merging source blocks or adding an xdist affinity protocol.
Impact
Documentation blocks within a group share one namespace, but each block retains its own location and failure detail. The pytest adapter coexists with the standard doctest plugin, so pytest continues to provide fixtures, checker and report options, and Python-module doctest collection.
Validation
uv run ruff format . --checkuv run py.testuv run ruff check .uv run mypy .just build-docsKnown CI failure
The push workflow fails in
mypyfor Python 3.13 withdocutils==0.21.2andpytest==7.2.0. An isolated local run with the same pins reproduces strict typing errors insrc/_pytest_doctest_compat.pyandsrc/pytest_doctest_docutils.py; the equivalentpytest==8.4.2run passes. The oldest pytest line exposes the private compatibility surface with weaker annotations, so the blocker remains unresolved.