Skip to content

fix(all): pcapkit.all.__all__ omits names its packages export - #1142

Merged
JarryShaw merged 1 commit into
mainfrom
fix/1136-all-exports
Oct 6, 2026
Merged

JarryShaw merged 1 commit into
mainfrom
fix/1136-all-exports

Conversation

@JarryShaw

@JarryShaw JarryShaw commented Oct 6, 2026 •

Copy link
Copy Markdown
Owner
  • Searched for similar pull requests

  • Followed the coding style (make pylint, make mypy, make isort) — not run

  • make test passes, and a test case covers the change — ran tests/project only (see below)

  • Added a changelog entry — N/A, added centrally after the wave

  • fix — corrects a defect


Closes #1136

Adds the 18 missing names (corekit 5, foundation 8, protocols 5) to pcapkit/all.py under their existing groups: ESP/IPv6_Ext in Internet, HTTPv1/HTTPv2 in Application, PCAPNG as its own "PCAPNG Format" line. pcapkit.utilities (11 names, unlisted since 769a17c78 on 2022-05-29, which commented its group out) stays deliberately unlisted: generic helpers like warn/reset/configure should not land via import *.

New tests/project/test_all_exports_unit.py reads the from pcapkit.X import * lines with ast and fails on any export neither listed nor in its DELIBERATE_NON_EXPORTS; it also catches stale exclusions.

  • Probe: from pcapkit.all import * lacked ESP, HTTPv1, PCAPNG, EnumRegistry, ReassemblyManager, ... on main; all present now, warn still absent.
  • Without the fix: 3 failed, 4 passed (corekit, foundation, protocols subtests). With: 4 passed, 8 subtests passed.
  • test_all_layer_grouping_unit.py: 5 passed. tests/project: 389 passed, 1 skipped, 1297 subtests passed.

@JarryShaw JarryShaw added fix Pull requests that fix a defect (fix: subject prefix) review: running A cross-review is in flight against the current head - no verdict yet labels Oct 6, 2026
@JarryShaw

Copy link
Copy Markdown
Owner Author

Cross-review verdict on 3290d3e27: NEEDS CHANGES (ran on Sonnet; author Opus). One factual fix is needed.

The PR body, the test docstring and the new all.py comment all say the utilities group has never been listed. That is false. The group was active from 2018 until 769a17c78 (2022-05-29) commented it out while renaming decorators. I verified that commit. Please reword all three to say the group has been unlisted since then.

Everything else checks out:

  • Placement: all 18 added names sit in the right group, and the fix(all): pcapkit.all lists OSPF on the Link Layer line #1129 grouping test passes.
  • No collisions: no duplicate or shadowing names, and no name appears in two packages.
  • The new test catches every change I tried:
    • a removed name;
    • a bogus name;
    • a stale exclusion;
    • an added star-import, which is picked up automatically.
  • test_public_api: all 450 subtests pass.

Whether to exclude the 11 utilities names is your call. I have asked on #1136.

@JarryShaw JarryShaw added review: needs-changes Cross-review at the current head says changes are required; see the verdict comment and removed review: running A cross-review is in flight against the current head - no verdict yet labels Oct 6, 2026
- list the 18 names corekit, foundation and protocols export but all.py
  left out, under their existing group comments (ESP/IPv6_Ext in Internet,
  HTTPv1/HTTPv2 in Application)
- record pcapkit.utilities as deliberately unlisted, in all.py and the test
- add tests/project/test_all_exports_unit.py, which reads the star-imports
  from all.py and fails on any aggregated export neither listed nor excluded

Closes #1136
@JarryShaw
JarryShaw force-pushed the fix/1136-all-exports branch from 3290d3e to d46c714 Compare October 6, 2026 20:49
@JarryShaw JarryShaw added review: running A cross-review is in flight against the current head - no verdict yet and removed review: needs-changes Cross-review at the current head says changes are required; see the verdict comment labels Oct 6, 2026
@JarryShaw

Copy link
Copy Markdown
Owner Author

Cross-review verdict on d46c714ed: GOOD TO GO (ran on Sonnet; author Opus, round 2)

Round 1's history error is fixed. The all.py comment, the test comment and the PR body now all say the group has been unlisted since 769a17c78 (2022-05-29), and a case-insensitive grep finds no "never" or "2020" claim left.

The delta between the two heads changes comments only; __all__ and the test logic are identical. test_all_exports_unit and test_all_layer_grouping_unit pass.

The utilities exclusion is still the maintainer's call, on #1136.

@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 6, 2026
@github-actions

github-actions Bot commented Oct 6, 2026

Copy link
Copy Markdown
Contributor

Coverage: 88.75% (unit tier, Python 3.14, d46c714ed, Unit Tests run success)

Package Statements Missed Branches Partial Cover
pcapkit (top level) 104 4 20 4 93.55%
pcapkit/const 18757 1035 2342 846 90.23%
pcapkit/corekit 1873 91 578 22 94.33%
pcapkit/dumpkit 136 0 40 0 100.00%
pcapkit/foundation 2425 145 842 34 92.56%
pcapkit/interface 112 7 40 5 92.11%
pcapkit/protocols 15659 188 3944 163 98.18%
pcapkit/toolkit 487 65 144 1 85.42%
pcapkit/utilities 429 4 122 4 98.55%
pcapkit/vendor 4409 2359 1006 158 42.84%

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

@JarryShaw
JarryShaw merged commit 19bb51f into main Oct 6, 2026
40 checks passed
@github-project-automation github-project-automation Bot moved this from In review to Done in PyPCAPKit Oct 6, 2026
@JarryShaw
JarryShaw deleted the fix/1136-all-exports branch October 6, 2026 22:32
@JarryShaw JarryShaw removed the review: good-to-go Cross-review at the current head says ready; CI state is separate label Oct 6, 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(all): pcapkit.all.__all__ omits names its packages export

1 participant