Skip to content

fix(utilities): export hold_warnings in pcapkit.utilities.warnings.__all__ (#1602) - #1603

Merged
JarryShaw merged 1 commit into
mainfrom
fix/1602-export-hold-warnings
Oct 10, 2026
Merged

JarryShaw merged 1 commit into
mainfrom
fix/1602-export-hold-warnings

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

Description of your pull request and other information

Closes #1602.

Adds 'hold_warnings' beside 'warn' in pcapkit.utilities.warnings.__all__. The class name and its # pylint: disable=invalid-name stay, per the ruling on #1599.

New test test_hold_warnings_is_exported (#1580's test file) asserts the entry and that import * brings the class in. Without the entry it fails: AssertionError: 'hold_warnings' not found in ['warn', 'BaseWarning', ...].

I ran narrow selections only, and all passed: that file, tests/project/test_all_exports_unit.py, test_public_api.py and test_isort_clean.py. make test was not run, so that box is unticked.

…all__ (#1602)

`hold_warnings` is public -- documented by `autoclass` and imported by
`pcapkit.protocols.protocol` -- but was missing from `__all__`, so
`from pcapkit.utilities.warnings import *` did not bring it in. List it beside
`warn`, as the stdlib lists `catch_warnings`. The name stays lowercase per the
ruling on #1599.

A new test pins the entry and the star import.
@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 10, 2026
@JarryShaw

Copy link
Copy Markdown
Owner Author

Verdict: GOOD TO GO at db0b592af. This was a Sonnet cross-review; the author ran on Opus.

  • Scope: one commit on 931960f21, 2 files, +10/−1. The only source change adds 'hold_warnings' beside 'warn' in pcapkit/utilities/warnings.py:78. The class name stays, per the refactor(utilities): rename hold_warnings to HoldWarnings #1599 ruling.
  • Fail-before: on main the new test fails with 'hold_warnings' not found in ['warn', 'BaseWarning', ...]. It passes on the head.
  • Exports: a diff of the __all__ lists and the star-import namespace on both trees shows that only pcapkit.utilities.warnings gains hold_warnings. pcapkit.__all__, pcapkit.all.__all__ and pcapkit.utilities.__all__ are unchanged.
  • Narrow runs pass: test_trial_parse_warnings_1580_unit.py, test_all_exports_unit.py, test_public_api.py, test_isort_clean.py.

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

Copy link
Copy Markdown
Contributor

Coverage: 89.63% (unit tier, Python 3.14, db0b592af, Unit Tests run success)

Package Statements Missed Branches Partial Cover
pcapkit (top level) 104 3 20 3 95.16%
pcapkit/const 18858 956 2366 870 91.04%
pcapkit/corekit 2366 67 760 35 96.48%
pcapkit/dumpkit 275 3 100 3 98.40%
pcapkit/foundation 2855 154 1004 42 93.57%
pcapkit/interface 138 7 52 5 93.68%
pcapkit/protocols 16996 227 4540 192 98.04%
pcapkit/toolkit 800 123 282 6 83.27%
pcapkit/utilities 494 4 146 4 98.75%
pcapkit/vendor 4409 2342 1006 157 43.25%

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

@JarryShaw
JarryShaw merged commit c43e931 into main Oct 10, 2026
40 checks passed
@JarryShaw
JarryShaw deleted the fix/1602-export-hold-warnings branch October 10, 2026 14:49
@JarryShaw JarryShaw removed the review: good-to-go Cross-review at the current head says ready; CI state is separate label Oct 10, 2026
@JarryShaw JarryShaw added this to the PyPCAPKit v1.5 milestone Oct 26, 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(utilities): hold_warnings is public but missing from pcapkit.utilities.warnings.__all__

1 participant