Skip to content

fix(protocols): export Protocol from pcapkit.protocols.protocol (#1770) - #1778

Merged
JarryShaw merged 2 commits into
mainfrom
fix/1770-protocolbase-registry-message
Oct 15, 2026
Merged

JarryShaw merged 2 commits into
mainfrom
fix/1770-protocolbase-registry-message

Conversation

@JarryShaw

Copy link
Copy Markdown
Owner

Please follow the guide below

What is the purpose of your pull request?

Tick the commit type your subject line carries.

  • fix — corrects a defect
  • feat — adds a feature
  • perf — changes performance, not behaviour
  • refactor — changes neither behaviour nor performance
  • test — tests only
  • docs — documentation only
  • ci — workflows or build tooling
  • release — bumps the version or rolls up a distribution
  • chore — anything else

Summary

pcapkit/protocols/protocol.py's __all__ listed only ProtocolBase, so from pcapkit.protocols.protocol import * did not bind Protocol, the module's user-facing class. It now lists both. ProtocolMeta stays out, as protocol.rst files it under internal definitions.

Closes #1770

- protocol.py: __all__ listed only ProtocolBase, so a star-import did not
  bind Protocol, the module's user-facing class. It now lists both.
  ProtocolMeta stays out, as protocol.rst files it under Internal
  Definitions.
- The registry error still names Protocol while the guard tests
  ProtocolBase. That gap is deliberate: the message's reader is a third
  party, who should subclass the public class (#1016).
- New test_protocol_module_exports_1770_unit.py pins __all__ and the
  star-import, and that a non-Protocol built-in passes the guard.

Narrow runs and tests/project (930 passed, 1 skipped) pass.

Closes #1770
@JarryShaw JarryShaw added the fix Pull requests that fix a defect (fix: subject prefix) label Oct 15, 2026
@JarryShaw

Copy link
Copy Markdown
Owner Author

Verdict: GOOD TO GO at 777f000a7. A Sonnet cross-review (author: Opus), after one fix round. The first review caught that the error-message half reversed #1016, so that half was dropped. Re-checked: only the __all__ line changes in protocol.py, the guard pins match main, the test bites, and tests/project passed 930. The branch is behind main but merges cleanly.

@JarryShaw JarryShaw added the review: good-to-go Cross-review at the current head says ready; CI state is separate label Oct 15, 2026
@JarryShaw JarryShaw moved this to In review in PyPCAPKit Oct 15, 2026
@JarryShaw
JarryShaw merged commit 376bca2 into main Oct 15, 2026
12 checks passed
@JarryShaw
JarryShaw deleted the fix/1770-protocolbase-registry-message branch October 15, 2026 21:59
@github-project-automation github-project-automation Bot moved this from In review to Done in PyPCAPKit Oct 15, 2026
@JarryShaw JarryShaw removed the review: good-to-go Cross-review at the current head says ready; CI state is separate label Oct 15, 2026
JarryShaw added a commit that referenced this pull request Oct 15, 2026
…1803)

Entries:
- add #1791 (breaking: pack() leaves its instance unchanged), #1778
  (Protocol in protocol.__all__), #1781 (PortEnumField miss with a
  nameless proto), #1779 (vendor.ipx _path), #1780 (examples READMEs to
  Markdown, build leftovers) and #1790 (36 ambiguous cross-references)
- fold #1776 into the RPL 0x23 entry and #1381 into the dump-schema one

Accuracy:
- the benchmark and legacy_smoke READMEs are README.md since #1780
- EngineBase stays out of __all__, as #1016 settled
- the #575 peek calls get() only once the value resolves
- the #647 and #764 entries point at #775/#860, under which nothing mints
- the #861 entry names #869 and #874 for the EnumRegistry move

Figures:
- preamble: 685 citations, #340 to #1791
- process.rst pin: 298 entries; CHANGELOG.md regenerated

Refs #1103
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

fix Pull requests that fix a defect (fix: subject prefix)

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

fix(protocols): pcapkit.protocols.protocol's __all__ omits Protocol

1 participant