Skip to content

from_env(docs): Hide doctest setup with # doctest: +HIDE#719

Merged
tony merged 2 commits into
masterfrom
doctest-hide-badges
Jul 14, 2026
Merged

from_env(docs): Hide doctest setup with # doctest: +HIDE#719
tony merged 2 commits into
masterfrom
doctest-hide-badges

Conversation

@tony

@tony tony commented Jul 14, 2026

Copy link
Copy Markdown
Member

What

The four from_env classmethods (Server/Session/Window/Pane)
open their Examples with plumbing — a socket path and an env mapping —
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 runner
reads __doc__ from source), but is stripped from the rendered docs.

Session.from_env hides only its socket_path; its env carries 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 — the HIDE optionflag (so # doctest: +HIDE parses
    instead of raising at collection).
  • gp-sphinx>=0.0.1a34 — the autodoc-process-docstring render strip
    (plus the modifier-badge dedup that drops the duplicate left-hand
    classmethod prefix).

Both were bumped on master, so this branch carries only the four
docstring edits — no dependency or lockfile changes.

Verification

All four from_env doctests pass; ruff/mypy clean; the docs build
renders each example without its setup block and each signature without
the duplicate classmethod prefix.

@tony tony force-pushed the doctest-hide-badges branch from 4d6b7db to 0d74439 Compare July 14, 2026 00:40
@codecov

codecov Bot commented Jul 14, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 52.36%. Comparing base (29582ba) to head (ab4acca).
⚠️ Report is 3 commits behind head on master.

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.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@tony tony force-pushed the doctest-hide-badges branch from 0d74439 to 7cf5858 Compare July 14, 2026 00:43
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.
@tony tony force-pushed the doctest-hide-badges branch from 7cf5858 to b31b0d0 Compare July 14, 2026 01:52
@tony tony force-pushed the doctest-hide-badges branch from bdacf7a to b31b0d0 Compare July 14, 2026 01:59
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.
@tony tony marked this pull request as ready for review July 14, 2026 02:05
@tony tony merged commit f575d24 into master Jul 14, 2026
15 checks passed
@tony tony deleted the doctest-hide-badges branch July 14, 2026 02:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant