Skip to content

docs(protocols): name ProtocolBase in every register's Raises, as #1016 ruled (#2316) - #2333

Merged
JarryShaw merged 1 commit into
mainfrom
docs/2316-register-raises-protocolbase
Oct 26, 2026
Merged

JarryShaw merged 1 commit into
mainfrom
docs/2316-register-raises-protocolbase

Conversation

@JarryShaw

Copy link
Copy Markdown
Owner

What is the purpose of your pull request?

  • docs — documentation only

Description

Closes #2316, as #1016 ruled.

  • Fix:
    • Link.register, Internet.register and Transport.register now name ProtocolBase in Raises:, matching the ProtocolBase, SCTP, Frame and PCAPNG sites. So does the ProtocolBase.__proto__ #: comment.
    • The error message still names Protocol.
  • Test: test_register_class_guard_unit gains two checks: every register site's Raises: names ProtocolBase, and the __proto__ comments say ProtocolBase subclass.
  • Fail-without-fix: on origin/main, 5 failed (Link, Internet, TCP, UDP, protocol.py).
  • Prose only: docstrings and comments in the library files; code_of reports all four as docs-only.

… ruled (#2316)

Problem: Link, Internet and Transport register's Raises said "not a
Protocol subclass", and the ProtocolBase.__proto__ comment said values are
Protocol subclasses, while _next_layer_entry checks ProtocolBase and the
other layers already said so.

Fix: name ProtocolBase in those three Raises clauses and the __proto__
comment. The error message keeps naming Protocol, per #1016. Docstring and
comment only; the AST is unchanged.

Test: test_register_class_guard_unit pins ProtocolBase in every register
site's Raises and in the __proto__ comments; it fails on origin/main.
@JarryShaw JarryShaw added this to the PyPCAPKit v1.5 milestone Oct 26, 2026
@JarryShaw JarryShaw added docs Pull requests that change documentation only (docs: subject prefix) review: running A cross-review is in flight against the current head - no verdict yet labels Oct 26, 2026
@JarryShaw

Copy link
Copy Markdown
Owner Author

Review: GOOD TO GO at e6aec8ad2 (Sonnet).

  • Raises: sections: every register that reaches _next_layer_entry now names ProtocolBase: Link, Internet, Transport, ProtocolBase (both blocks), SCTP, Frame and PCAPNG. The __proto__ #: comment does too.
  • Error message: it still says Protocol (fix(foundation): registrar error messages and type hints name the public class, not the Base the guard checks #1016).
  • Library diff: docstrings and comments only. An AST dump of all four files, with docstrings blanked, matches origin/main.
  • Fail-without-fix: on origin/main, 5 failed (Link, Internet, TCP and UDP Raises, plus the __proto__ comment). On the head, 149 passed.
  • Non-blocking: the Raises guard covers Link, Internet, TCP and UDP. SCTP, ProtocolBase, Frame and PCAPNG are correct today but not pinned.

@JarryShaw JarryShaw added review: good-to-go Cross-review at the current head says ready; CI state is separate and removed review: running A cross-review is in flight against the current head - no verdict yet labels Oct 26, 2026
@JarryShaw JarryShaw moved this to In review in PyPCAPKit Oct 26, 2026
@github-actions

Copy link
Copy Markdown
Contributor

Coverage: 91.56% (unit tier, Python 3.15, e6aec8ad2, Unit Tests run success)

Package Statements Missed Branches Partial Cover
pcapkit (top level) 104 4 20 2 95.16%
pcapkit/const 19599 881 2618 867 92.11%
pcapkit/corekit 2589 74 816 37 96.51%
pcapkit/dumpkit 282 3 102 3 98.44%
pcapkit/foundation 3023 23 1044 25 98.82%
pcapkit/interface 138 4 52 3 96.32%
pcapkit/protocols 17437 218 4586 185 98.15%
pcapkit/toolkit 869 36 298 10 95.20%
pcapkit/utilities 504 7 146 5 98.15%
pcapkit/vendor 4432 1988 1018 167 51.87%

Per-file detail: the coverage-html artifact of this run.

@JarryShaw

Copy link
Copy Markdown
Owner Author

Ready to merge at e6aec8ad2. Closes #2316.

  • Review: GOOD TO GO (Sonnet).
  • CI: every check passed, Required checks passed included. The experimental legs are green, and KTLO shows no warnings.
  • Ordering leg: protocols gave 1944 tests with 0 failures, run with the PR merged into 2d8c8b516.
  • Merge state: mergeable. It is BEHIND only because of main's test-only pushes since then, and no file overlaps.

@JarryShaw
JarryShaw merged commit 8a30a54 into main Oct 26, 2026
67 checks passed
@JarryShaw
JarryShaw deleted the docs/2316-register-raises-protocolbase branch October 26, 2026 23:40
@github-project-automation github-project-automation Bot moved this from In review to Done in PyPCAPKit Oct 26, 2026
@JarryShaw JarryShaw removed the review: good-to-go Cross-review at the current head says ready; CI state is separate label Oct 26, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

docs Pull requests that change documentation only (docs: subject prefix)

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

docs(protocols): register's Raises name Protocol in some layers, ProtocolBase in others

1 participant