Skip to content

fix(protocols): re-export what each data and schema submodule exports (#1807) - #1815

Merged
JarryShaw merged 1 commit into
mainfrom
fix/1807-package-reexports
Oct 16, 2026
Merged

JarryShaw merged 1 commit into
mainfrom
fix/1807-package-reexports

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

#1797 found pcapkit.protocols.data.link missing the L2TP data model (fixed in #1806). The same gap was open across the data and schema packages: names a submodule lists in __all__ that its package and aggregator did not re-export.

  • Re-exported, in each intermediate package and in the data/schema aggregators, under the prefixes the siblings use:
    • the MH messages, options, suboptions, attributes and extensions (MH_*);
    • the HOPOPT and IPv6-Opts SMFDPDOption and QuickStartOption (HOPOPT_*, IPv6_Opts_*);
    • ipv4.Option and ipv6_route.RoutingType on the schema side;
    • PCAP-NG PacketBlock and the PACK_* options (PCAPNG_*);
    • HTTP/2 Settings (HTTPv2_Settings).
  • Module-only by design: the schema.internet.ipv6_option field callbacks. No package re-exports field callbacks, the same names exist in sibling modules, and ipv6_option.rst documents them on their own page. They are recorded in the new test's allowlist.
  • Guard: tests/protocols/test_package_reexports_1807_unit.py walks every data and schema package and checks re-export by identity, a tight allowlist, and no shadowed star-imports. It fails on main.
  • Safety: no name maps to two objects in either aggregator, and pcapkit's own top-level names are unchanged. Additions only.

Closes #1807

…#1807)

- data/schema internet: re-export the MH messages, options, suboptions,
  attributes and extensions, and the HOPOPT and IPv6-Opts SMFDPDOption and
  QuickStartOption bases, under their MH_/HOPOPT_/IPv6_Opts_ prefixes.
- schema internet: re-export ipv4.Option as IPv4_Option and
  ipv6_route.RoutingType as IPv6_Route_RoutingType.
- data/schema misc: re-export PacketBlock and the PACK_* options as PCAPNG_*.
- data application: re-export httpv2.Settings as HTTPv2_Settings.
- data and schema aggregators list every new name.
- ipv6_option's field callbacks stay module-only, recorded in the test.
- tests: walk every data and schema package and check it re-exports its
  children's __all__ by identity, that the allowlist is tight, and that no
  star-import is shadowed. Fails on origin/main; protocol suites pass.

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

Copy link
Copy Markdown
Owner Author

Verdict: GOOD TO GO at 7bd02d2f1. A Sonnet cross-review (author: Opus) re-ran the inventory by object identity: every gap is closed and only the justified ipv6_option callbacks remain. It found no star-import clash, and pcapkit's public surface is unchanged (additions only, in data and schema). The new test fails on main, and removing any one re-export fails it where no other test notices. tests/project and the protocol suites pass.

@JarryShaw JarryShaw added the review: good-to-go Cross-review at the current head says ready; CI state is separate label Oct 16, 2026
@JarryShaw JarryShaw moved this to In review in PyPCAPKit Oct 16, 2026
@github-actions

Copy link
Copy Markdown
Contributor

Coverage: 89.63% (unit tier, Python 3.15, 7bd02d2f1, Unit Tests run success)

Package Statements Missed Branches Partial Cover
pcapkit (top level) 104 3 20 3 95.16%
pcapkit/const 18862 954 2368 868 91.06%
pcapkit/corekit 2462 69 780 35 96.55%
pcapkit/dumpkit 276 3 100 3 98.40%
pcapkit/foundation 2915 164 1016 34 93.59%
pcapkit/interface 138 7 52 5 93.68%
pcapkit/protocols 17408 224 4580 189 98.10%
pcapkit/toolkit 872 177 298 8 77.18%
pcapkit/utilities 512 2 158 4 99.10%
pcapkit/vendor 4417 2342 1010 157 43.38%

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

@JarryShaw
JarryShaw merged commit 9ee325e into main Oct 16, 2026
56 checks passed
@github-project-automation github-project-automation Bot moved this from In review to Done in PyPCAPKit Oct 16, 2026
@JarryShaw
JarryShaw deleted the fix/1807-package-reexports branch October 16, 2026 13:13
@JarryShaw JarryShaw removed the review: good-to-go Cross-review at the current head says ready; CI state is separate label Oct 16, 2026
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): data and schema packages omit names their submodules export

1 participant