Repository navigation
docs: retarget Protocol/ProtocolBase cross-references to match the #1103 display rule - #2422
Conversation
|
Coverage: 91.73% (unit tier, Python 3.15,
Per-file detail: the |
|
Review: GOOD TO GO at Independently confirmed (second measurement, different method): the "doc lives at ProtocolBase" premise is backwards for the rendered page. Built the actual docs on the pinned toolchain (Sphinx 9.2.0) and checked all 62 members, including the 18 this PR links to, with no exceptions: So this PR's current form (display Everything else checks out: 46 roles changed exactly as described, 0 scope creep (26/26 files AST-identical), carve-outs justified ( |
|
Good to go or needs changes? (the label mismatch the verdict) |
|
Needs changes — my mistake posting it confusingly. The cross-review's GOOD TO GO was narrowly scoped to "does this correctly implement the literal split-display-target format as asked" (it does). But that same review independently confirmed the format's premise is backwards for the rendered page (doc renders at |
Applying the #1103 ruling to the member references #2420 left behind: a `ProtocolBase.<member>` cross-reference now reads `Protocol.<member>`, for one consistent public vocabulary, and links there too. Both halves move, because on the rendered page that is where the documentation is. `protocol.rst` documents the members with nested `autoproperty`/`automethod` directives under `.. autoclass:: ...Protocol`, so `Protocol.<member>` carries the signature and the docstring; the `ProtocolBase` block is `:no-members:` plus grouped `:no-index-entry:` stubs whose body only links back to the `Protocol.*` entries, and the general index lists `Protocol.*` alone. Measured on the pinned docs toolchain (`Sphinx==9.2.0`). * 46 sites in `pcapkit/` and `docs/source/`. 37 move display *and* target to `Protocol.<member>`; the other 9 already targeted `Protocol` and only needed the display text. The explicit target is the fully-qualified spelling the house style asks for -- the form 124 existing references already use. * `from_data` is consistent again: `internet.py` and `application.py` pointed at `ProtocolBase.from_data` where `link.py` and `transport.py` pointed at `Protocol.from_data` for the same kind of reference. All four now read alike. * `__init_subclass__` keeps `ProtocolBase` (6 sites), since `Protocol` overrides it and naming `Protocol` would name a different method. So do `schema.py` and `protocol-layer-placement.rst`, whose adjacent prose would otherwise contradict itself, and `register`'s `Raises:` clause, which names the class the guard's `issubclass` tests (#2316/#1016). * `changelog/1.5.0.rst` keeps its five `ProtocolBase.<member>` references. Each names the class a *built-in* protocol inherits the member from -- the built-ins derive from `ProtocolBase`, not `Protocol` -- and `CHANGELOG.md` is generated from that file by `util/changelog_md.py`, where a role flattens to a code span with no link, so moving them would rewrite release-note prose rather than an href. * `tests/` and `examples/` are untouched (28 sites): their docstrings are not part of the Sphinx render. Hrefs only. A role-canonicalisation guard reports no role and no display-text change beyond the above, and an AST-structure guard (`ast.dump` with docstrings stripped) is identical for every touched `.py` file.
eb35d4b to
a6cc560
Compare
|
Flipped the 37 split-form sites to plain Verified independently: AST guard shows 22/22 touched files prose-only; a role-canonicalisation guard shows exactly 37 target changes, 0 display/role changes elsewhere; a docs build on the pinned toolchain is byte-identical warning-count before/after (1 pre-existing, unrelated); a rendered-HTML link audit shows the The 5 Dispatching the next cross-review round against this head. |
|
Review: NEEDS CHANGES at Everything else verified independently: single commit on current Two real but small follow-ups noted, not blocking: |
Please follow the guide below
make pylint,make mypy,make isort)make testpasses, and a test case covers the changeWhat is the purpose of your pull request?
docs— documentation onlyDescription of your pull request and other information
Follow-up to #2420, applying the owner's #1103 ruling: a
ProtocolBase.<member>cross-reference should display asProtocol.<member>for one consistent public vocabulary.Round 3 implemented that literally — display
Protocol.<member>, link targetProtocolBase.<member>, via Sphinx's split role syntax — but found the stated premise backwards: a real docs build on the pinned toolchain showed the full rendered entry (signature + docstring) lives atProtocol.<member>, notProtocolBase.<member>(ProtocolBase's block is:no-members:with link-only stubs).This round flips the target to match: 37 sites now have display AND target reading
Protocol.<member>(fully-qualified — the bare dotted-short form resolves nowhere outsidepcapkit.protocols.protocol), on top of the 9 display-only fixes already in the PR — 46 sites total, 24 files, net vsmain.5 sites in
docs/source/changelog/1.5.0.rststay onProtocolBase: each names the class a built-in protocol inherits the member from (0 of 44 shipped protocol classes haveProtocolin their MRO), andCHANGELOG.mdis generated from this file where the role flattens to an unlinked code span — retargeting would rewrite release-note prose, not a docs href.1461is the weakest of the five (ext.rst:284already says the same fact usingProtocol.__init__); flagged, not flipped unasked.Carve-outs untouched: 6
__init_subclass__sites (Protocolgenuinely overrides this),schema.py:853,protocol-layer-placement.rst:209(MRO set-difference discussion namingProtocolBaseon purpose).register'sRaises:clause is unchanged (names the classissubclassactually tests, per #2316/#1016, test-locked).Not reached this round:
ipv6_ext.py:96/ipv6_ext.rst:129still target theProtocolBasestub — same shape as the flipped 37, missed; andtests//examples/sites (not part of the Sphinx render) remain for a dedicated #1103 pass.Verification
.pyfiles structurally identical tomain; all 125 differing lines are comments/docstrings.Protocol/ProtocolBaseroles in the touched files: 46 changed, 0 added/removed, 0 remaining with display class ≠ target class outside the documented carve-outs.TransTypeambiguity, unrelated) before/after. Rendered-link audit: display/target mismatches 27→0 vsmain-plus-round-3, 9→0 vs round 3's own baseline.tests/project2107 passed/80 skipped; wider tier (protocols, corekit, utilities, foundation, dumpkit, interface, toolkit, cli) 3769 passed/35 skipped/0 failed, 62944 subtests; root-leveltests/test_*.py246 passed.