Repository navigation
refactor(protocols)!: group each protocol's protocol, schema and data into one package (#2534) - #2753
Conversation
|
NEEDS CHANGES at
|
e9de6cc to
92d3f63
Compare
|
Round 2 pushed:
One question for you: see the next comment. |
|
Needs deciding: the #1744 test module says a removal is recorded twice, in the module docstring and on the docs page (#1103). The #2534 notes are on the docs pages only, and the guard accepts either.
Recommendation: 1. The page is where readers look up an old path; option 2 doubles the text without a home for the old path. Going ahead with 1 unless you pick 2. |
|
take 1 |
|
Ruling: option 1. The removal notes for #2534 live on the docs pages only, with no copies in module docstrings, and the guard accepts that as it stands. Nothing on the PR changes. The round-2 cross-review came back GOOD TO GO; the verdict follows once |
|
GOOD TO GO at
|
|
Needs deciding (raised in session): what to call the protocol module in each package, e.g.
Recommendation: 1. The paths users see are the same either way, and the trio stays regular. Tracebacks print the full path, so |
|
Coverage: 94.45% (unit tier, Python 3.15,
Per-file detail: the |
|
Ruling: keep |
|
Needs deciding (raised in session): should each package
Recommendation: 2. It is the smaller surface and needs no re-run before the release. If you want 1, I'd do the headline classes only, with the guard taught about the aliases. |
|
GOOD TO GO at
The |
|
take 1 and maybe we can use a file top level or module config for these files |
|
Ruling: option 1. The headings become plain Round 4 picks one mechanism. A repo |
The output of codemod-v2.py on 4f62f52, with no hand edits. - protocols/<layer>/<proto>.py and its schema/ and data/ modules become protocols/<layer>/<proto>/{protocol,schema,data}.py; each package __init__ exports its class alone, eagerly, and binds each public class its schema and data modules define as Schema_<name> and Data_<name>, outside __all__, in a block per role under a "# Header Schemas" or "# Data Models" heading, as ruled in review of #2753. A [tool.isort] section in pyproject.toml keeps isort off these files, filter_files included; protocol-family-grouping.rst shows the layout and the doc-claims test pins every __init__ to it. - The TLS record data models SSL reads move from tls/data.py to a new ssl/data.py, as pieces the family shares; tls/data.py keeps TLS. - The schema/ and data/ trees and their aggregations go, with no alias: schema/schema.py is protocols/schema.py, data/data.py and data/protocol.py merge into protocols/data.py, and ipv6_option merges into ipv6_ext.schema. - ProtocolBase.__init_subclass__ finds a class's schema and data in its own package and imports Raw's on demand. - Imports, ModuleDescriptor strings, docs targets, paths and test specs are rewritten; released changelogs get every role target, 1.6.0 stays with #2483. - versionremoved records every name v1.5.1 shipped that no longer resolves at its old path, read from the tag by a new util/shipped_names.py into a checked-in fixture; a re-export points at its defining module, and the address patterns #2614 removed unrecorded get their note too. - The 1744 test gains TestShippedNames, which fails on any such name left unrecorded; test_public_api leaves the ruled aliases out of its unlisted names; tests that walked or pinned the old trees follow the new layout, two that pinned only the aggregations are deleted, and a new test pins the layout and the aliases. All modules import, protocol models are unchanged, every unittest leg and project guard passes, and a non-editable docs build is warning-free.
9efd56d to
ac734d8
Compare
|
Round 4 pushed:
|
|
GOOD TO GO at
|
- Breaking: each protocol is a package of protocol, schema and data modules, the pcapkit.protocols.schema and .data trees and their aggregate exports removed with no alias, and a 1.5.x data model pickle fails to load (#2753), a new entry with the 1.5.1 imports and pickle measured. - 1.6.0's pcapkit.protocols role targets point at the package modules; the aggregator export claims of unreleased entries, the NoPayload and FrameRecord pickle claims and the TLSKeyLogEntries alias follow the layout. - CI: the LATEST tier's own job and the Coverage merge (#2754) and the ordering leg's halved rest of tests/protocols (21ec0a6, #2751), into the CI-legs entry; the package ruling into the conventions entry. - No entry for the test-only #2752. - The merge keeps #2483's class names in 1.5.0's conflicting roles under #2753's package paths. - CHANGELOG.md regenerated; util/changelog_md.py --check passes.
make pylint,make mypy,make isort)make testpasses, and a test case covers the changeWhat is the purpose of your pull request?
refactor— changes neither behaviour nor performanceDescription of your pull request and other information
Groups each protocol's protocol, schema and data modules into one package, for example
pcapkit.protocols.internet.ipv4.{protocol,schema,data}. The codemod does it all: one command, no hand edits.ssl/data.py, which removes thessl.protocol→tls.datacycle. Each package__init__exports its class only. Shipped names that move getversionremovedat their old paths, with no re-exports. The 1.5.0 changelog's references are rewritten.__init__s and two merged modules. Every other changed file is an import or reference rewrite.import pcapkittime is unchanged (0.637 → 0.640 s).1.5.0.rst. chore(docs): centralise changelog entries for unreleased versions #2483 merges last and takes the rewrite.Closes #2534