from_env(docs): Hide doctest setup with # doctest: +HIDE#719
Merged
Conversation
4d6b7db to
0d74439
Compare
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #719 +/- ##
==========================================
+ Coverage 52.30% 52.36% +0.05%
==========================================
Files 26 26
Lines 3726 3726
Branches 747 747
==========================================
+ Hits 1949 1951 +2
+ Misses 1472 1471 -1
+ Partials 305 304 -1 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
0d74439 to
7cf5858
Compare
why: The socket_path/env plumbing that opens each from_env example is needed for the doctest to execute but is noise to the reader. Marking it hidden runs it as a test while keeping it out of the rendered docs. what: - Tag the setup lines in Server/Window/Pane.from_env with `# doctest: +HIDE`; split the env dicts so the marker fits <=88 cols. - Session.from_env hides only socket_path — its env carries the deliberately wrong session id the surrounding prose explains, so it stays visible (hide plumbing, not meaning). Relies on the +HIDE optionflag (gp-libs>=0.0.19) and the render strip (gp-sphinx>=0.0.1a34), both already pinned on master.
7cf5858 to
b31b0d0
Compare
bdacf7a to
b31b0d0
Compare
why: Note the docs-presentation change this branch introduces. what: - Add a Documentation entry: the from_env family now hides its environment-setup plumbing in rendered examples.
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.
What
The four
from_envclassmethods (Server/Session/Window/Pane)open their
Exampleswith plumbing — a socket path and anenvmapping —needed for the doctest to run but noise to the reader. Each such line is
now marked
# doctest: +HIDE: it still executes as a doctest (the runnerreads
__doc__from source), but is stripped from the rendered docs.Session.from_envhides only itssocket_path; itsenvcarries the"deliberately wrong session id" the surrounding prose explains, so it
stays visible — hide plumbing, not meaning.
Requires (already on master)
gp-libs>=0.0.19— theHIDEoptionflag (so# doctest: +HIDEparsesinstead of raising at collection).
gp-sphinx>=0.0.1a34— theautodoc-process-docstringrender strip(plus the modifier-badge dedup that drops the duplicate left-hand
classmethodprefix).Both were bumped on
master, so this branch carries only the fourdocstring edits — no dependency or lockfile changes.
Verification
All four
from_envdoctests pass;ruff/mypyclean; the docs buildrenders each example without its setup block and each signature without
the duplicate
classmethodprefix.