Repository navigation
refactor(corekit)!: move the byte-order field helpers into corekit (#1711) - #1715
Conversation
|
Verdict: GOOD TO GO at
|
|
Coverage: 89.42% (unit tier, Python 3.15,
Per-file detail: the |
|
Do not re-export. Directly update the import paths. |
|
Recorded: no re-export. |
…1711) packet_byteorder and byteorder_callback act on a NumberField and on the __packet__ key SchemaField hands a nested schema, but lived under one protocol family's schema package. - corekit: git mv pcapkit/protocols/schema/misc/byteorder.py to pcapkit/corekit/fields/byteorder.py, next to the NumberField and SchemaField it serves. It imports only sys and typing at runtime, so no cycle; it is not added to corekit.fields' __all__. - protocols: the old module is removed with no re-export, so importing pcapkit.protocols.schema.misc.byteorder now raises ModuleNotFoundError; frame.py and pcapng.py import from corekit. - docs: the page moves to corekit/fields/byteorder.rst; the old page and its toctree entry are removed, and every reference names the new module. - tests: the #1519 tests move to tests/corekit and run against the new path, plus an old-path-is-gone test and a no-upward-import check. New tests fail on 94bce81 and origin/main; touched suites pass on 3.8, 3.9, 3.10, 3.11 and 3.14; Sphinx warnings unchanged at 45. Closes #1711
94bce81 to
51d07f7
Compare
|
Done: there is no re-export. Verdict: GOOD TO GO at
|
…les (#2529) - httpv1.HTTP and httpv2.HTTP become HTTPv1 and HTTPv2, and the top-level HTTP class of the httpv1/httpv2 schema and data modules follows; their sub-structure classes keep their names. id(), alias and the dispatched layer (the base HTTP, data key 'http') are unchanged. - Package __init__ files import the new names directly; imports, mock and registrar targets, autoclass targets, cross-references, ext.rst rows and the Mermaid click anchors follow. - versionremoved 1.6.0 on each old path (module docstring and docs page), versionchanged 1.6.0 on each renamed class; register_protocol's docstring drops the HTTP name collision the rename removes. - Tests: the #1744 ledger takes a removal version and registers the six paths; the collision and symmetry tests build their own class named HTTP; new test_http_member_names_2529_unit.py fails before the rename. BREAKING CHANGE: HTTP in pcapkit.protocols.application.httpv1/httpv2, pcapkit.protocols.schema.application.httpv1/httpv2 and pcapkit.protocols.data.application.httpv1/httpv2 is renamed HTTPv1/HTTPv2 with no alias (#1715, #1744), so `from ...httpv1 import HTTP` raises ImportError. pcapkit.HTTPv1, pcapkit.protocols.HTTPv1 and the schema/data package names are unchanged. A member built directly reports info_name 'httpv1'/'httpv2' (was 'http'), and register_protocol(HTTPv1/HTTPv2) keeps the class under its own key instead of displacing HTTP under 'HTTP'.
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) (run on the touched modules)make testpasses, and a test case covers the change (narrow runs only, 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 elseDescription of your pull request and other information
packet_byteorderandbyteorder_callbackmove frompcapkit/protocols/schema/misc/byteorder.pytopcapkit/corekit/fields/byteorder.py. Per the owner's ruling, nothing is re-exported at the old path.pcapkit.protocols.schema.misc.byteordernow raisesModuleNotFoundError. That module shipped in 1.5.0b9 to b12 with its own docs page and__all__, though never in a stable release. The subject carries!, following the OSPF/RARP precedent (30714cd51).corekit/fields/: the callback setsNumberField._byteorder, andpacket_byteorderreads the__packet__key thatSchemaFieldbuilds. At runtime the module imports onlysysandtyping, so there is no cycle.frame.py,pcapng.py,corekit/fields/misc.py,examples/generators/endian.pyand four tests now import from corekit. Agit grepof the old dotted and slash paths finds only the new test'sOLD_PATH.corekit/fields/byteorder.rst. The old page and its toctree entry are removed, and the Sphinx warning count is unchanged.tests/corekit/test_fields_byteorder_1519_unit.pyasserts that the old path raisesModuleNotFoundError. That test fails on94bce816b, the head that still had the re-export.tests/protocols/misc: 230 passed.Closes #1711