docs: move recipe examples into included source files#826
Open
l46983284-cpu wants to merge 2 commits into
Open
docs: move recipe examples into included source files#826l46983284-cpu wants to merge 2 commits into
l46983284-cpu wants to merge 2 commits into
Conversation
Non-doctest recipe snippets now live under docs/examples/recipes/ and are pulled into docs/recipes.md with literalinclude, matching the svcs pattern so example code can be checked independently. Fixes hynek#819 Signed-off-by: Alex Chen <l46983284@gmail.com>
Moving recipes into docs/examples/*.py made ty check those files. Optional pathos import is intentional for the ThreadPool recipe and is not part of the typed API surface under tests/typing. Include docs/examples in the existing ty override that keeps full rules only for tests/typing. Signed-off-by: Alex Chen <l46983284@gmail.com>
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.
Summary
Move non-doctest recipe examples out of
docs/recipes.mdintodocs/examples/recipes/and include them withliteralinclude, following the pattern used in hynek/svcs.This keeps recipe source verifiable as real Python files (compile/lint) instead of only living inside markdown fences. Doctest/pycon examples stay inline.
Fixes #819
Pull Request Checklist
mainbranch.api.py.docs/api.rstby hand.versionadded,versionchanged, ordeprecateddirectives..rstand.mdfiles is written using semantic newlines.Test plan
python -m py_compile docs/examples/recipes/*.pyand AST parseruff check docs/examples/recipes/*.pypytest -q→ 884 passed, 37 skipped