Repository navigation
refactor(corekit)!: move decorators into corekit (#1735) - #1737
Merged
Merged
Conversation
seekset, beholder and prepare act on a protocol's file and schema, and beholder imports protocol classes, so #1712's option A rules them out of pcapkit.utilities. - corekit: git mv pcapkit/utilities/decorators.py to pcapkit/corekit/decorators.py. Its top-level imports are only utilities.exceptions and utilities.logging, so no cycle. Not added to corekit's __init__: the public-API guard skips submodules. - utilities: no re-export. pcapkit.utilities.decorators now raises ModuleNotFoundError, seekset/beholder/prepare leave utilities.__all__ and all.py's exclusions, and the logger is pcapkit.corekit.decorators. - importers: protocol.py, internet.py, ipv6.py and schema.py import from corekit; every docstring, test and example reference follows. - docs: the page moves to corekit/decorators.rst with a migration note; the rule goes on a new conventions page, utilities-or-corekit. - tests: test_decorators.py moves to tests/corekit; a project guard parses every module under pcapkit/utilities/ and fails on any pcapkit import outside it, at top level, in a function or under TYPE_CHECKING; an old-path test pins the move. New tests fail on origin/main; touched suites pass on 3.8, 3.10, 3.11 and 3.14; Sphinx warnings unchanged at 63. Closes #1735
Owner
Author
|
Verdict: GOOD TO GO at
|
Contributor
|
Coverage: 89.65% (unit tier, Python 3.15,
Per-file detail: the |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Please follow the guide below
You will be asked some questions, please read them carefully and answer honestly
Put an
xinto all the boxes [ ] relevant to your pull request (like that [x])Use Preview tab to see how your pull request will actually look like
Searched for similar pull requests
Followed the coding style (
make pylint,make mypy,make isort)make testpasses, and a test case covers the change. Narrow runs only, listed below.Added a changelog entry under
docs/source/changelog/and regeneratedCHANGELOG.md, if the change is user-visible: N/A — centralised in docs(changelog): shared 1.5.0 changelog — long-lived, merges last (#610, #616, #617, #618, #620) #657What is the purpose of your pull request?
Tick the commit type your subject line carries.
fix— corrects a defectfeat— adds a featureperf— changes performance, not behaviourrefactor— changes neither behaviour nor performancetest— tests onlydocs— documentation onlyci— workflows or build toolingrelease— bumps the version or rolls up a distributionchore— anything elseCloses #1735. This applies option A from #1712:
utilitiesholds services that import nothing from pcapkit outsideutilities. It follows the no-re-export rule from #1715.pcapkit/utilities/decorators.pyis nowpcapkit/corekit/decorators.py.protocol.py,internet.py,ipv6.pyandschema.pyimport from the new path, and so do the docs, tests and examples.pcapkit.utilities.decoratorsnow raisesModuleNotFoundError.seekset,beholderandprepareare no longer available frompcapkit.utilities.pcapkit.corekit.decorators.utilities-or-corekit, states the rule.tests/project/test_utilities_import_boundary_1735_unit.pyparses every module underpcapkit/utilities/and fails on any import from elsewhere in pcapkit, whether at top level, inside a function or underTYPE_CHECKING.origin/mainthe new tests give 5 failed, 3 passed; the guard flagsdecorators.py:28,29,130,132.test_decorators.pymoves totests/corekit, which is not a plain-unittest leg; this follows the refactor(corekit)!: move the byte-order field helpers into corekit (#1711) #1715 precedent.