From 67835049352219c8779be4a99c50558c3d4cacf3 Mon Sep 17 00:00:00 2001 From: Jarry Shaw Date: Mon, 21 Sep 2026 22:04:20 -0400 Subject: [PATCH] docs: add CITATION.cff and bring the copyright notice up to date Requested by the owner, who is happy for anyone to use the project as long as credit is clearly stated and honoured. BSD-3-Clause already delivers that, so the licence is deliberately unchanged -- still BSD-3-Clause, no NOTICE file and no change to its terms. * Add CITATION.cff in Citation File Format 1.2.0, which GitHub renders as the "Cite this repository" button and which citation managers and dependency inventories read directly. Validated with `cffconvert --validate` and against the published 1.2.0 schema; `doi` and `orcid` are omitted rather than invented, since neither exists for this project today. * Bump the LICENSE copyright line from 2018-2023 to 2018-2026. That was its only occurrence in the tree -- docs/source/conf.py already derives its own from the current year. * Drop a stray `s` after the closing `DAMAGE.` of the licence text, present since the Mozilla-to-BSD relicence, so the wording now matches canonical BSD-3-Clause. The PEP 639 licence-metadata modernisation was considered and deliberately not made; the PR description carries the measurement that ruled it out. `python -m build` and `twine check` both pass on the sdist and the wheel. --- CHANGELOG.md | 1 + CITATION.cff | 40 +++++++++++++++++++++++++++++++++ LICENSE | 4 ++-- docs/source/changelog/1.5.0.rst | 16 +++++++++++++ 4 files changed, 59 insertions(+), 2 deletions(-) create mode 100644 CITATION.cff diff --git a/CHANGELOG.md b/CHANGELOG.md index 7e41571ed1..730640c770 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -64,6 +64,7 @@ This is the resolution of #548, which reported `TransType.L2TP` (115) as registe - **Fixed** -- `httpv1`'s `_RE_METHOD` was unanchored and `re.match` anchors only at the start, so it prefix-matched, and the request-line reader then passed the whole `para1` to `Method.get` rather than the captured `method` group. Together those meant `b'Get'` matched on the single character `G`, satisfied the guard that decides a start-line is a request, and handed the entire mixed-case token to a lookup that raised on it. Fixing either half alone still gives a wrong answer -- normalising the lookup would parse `b'Get'` as `GET` off a one-character match, and passing the group would parse it as a method named `G`. The pattern is now anchored at both ends and the captured group is what is looked up, so a token that is not a method is a malformed request line rather than a mis-parsed one. Method tokens are case-sensitive per [RFC 9110 Section 9.1](https://datatracker.ietf.org/doc/html/rfc9110#section-9.1), so no `re.I` was added: `GET` parses, `Get` and `get` are rejected (#583). - **Fixed** -- `_RE_STATUS` in the same reader carried the same unanchored prefix defect, found by auditing `_RE_METHOD`'s siblings, and it escaped as the wrong exception type. That pattern is only a guard -- the value is taken from `int(para2)` on the raw token -- so a prefix match let a malformed status past the guard and then out of `int()` uncaught, where `_read_http_header` documents `ProtocolError`. Measured: a status of `200x` raised `ValueError: invalid literal for int() with base 10: b'200x'`, and one of `2000` raised `ValueError: 2000 is not a valid StatusCode`; both are now `ProtocolError`. [RFC 9112 Section 4](https://datatracker.ietf.org/doc/html/rfc9112#section-4) gives `status-code = 3DIGIT`, exactly three, so the anchor is what the grammar already said -- the production lives in HTTP/1.1 because `status-code` is part of its `status-line`, while [RFC 9110 Section 15](https://datatracker.ietf.org/doc/html/rfc9110#section-15) covers the code semantics and the IANA registry rather than the syntax. `_RE_VERSION` was audited at the same time and is safe as it stands, because both of its call sites read the captured group rather than the raw token (#583). - **Fixed** -- `get()`'s documented `default` was ignored on the integer path throughout the generated `pcapkit.const` tree, because `get` delegated the lookup to the enum call and `_missing_` has no access to the caller's `default` -- so `Hardware.get(99999, 0)` raised `ValueError: 99999 is not a valid Hardware` instead of returning the fallback it was handed. The integer path now consults `default` before letting the lookup error escape. `-1`, the placeholder the generated signature already carried, is what separates "no default was supplied" from "a default was supplied and should be used", so a caller that asked for no fallback still gets the error rather than a silent substitution. The sweep #584 asked for puts the scope at 110 of the 118 integer registries, not the three the issue named; the two carrying a bespoke integer fallback of their own, `pcapng` `OptionType` and `reg` `AppType`, are deliberately left alone, since neither drops a default by raising. Not reachable from wire data -- every value a wire field can carry already resolves -- so this is a contract fix rather than a parse fix. Applied to the nine vendor templates as well as the 113 generated modules, and a new test renders the shared template and compares it against the module generated from it, so a regeneration cannot quietly undo it (#584). +- **Added** -- `CITATION.cff`, citation metadata in Citation File Format 1.2.0, which GitHub renders as the repository's "Cite this repository" button and which citation managers and dependency inventories read directly. It is the machine-readable half of the attribution BSD-3-Clause already asks for, so credit carries into a paper or a bill of materials rather than depending on a reader opening `LICENSE`. Validated with `cffconvert --validate` and against the published 1.2.0 schema; `doi` and `orcid` are omitted rather than invented, since neither exists for this project today and both are checked formats, so a wrong value would still validate. The licence itself is deliberately unchanged -- still BSD-3-Clause, no `NOTICE` file, no change to its terms. Alongside it the copyright line moves from `2018-2023` to `2018-2026` -- `LICENSE` was its only occurrence in the tree, since `docs/source/conf.py` already derives its own from the current year -- and a stray `s` after the closing `DAMAGE.` of the licence text, present since the Mozilla-to-BSD relicence, is removed, so the wording now matches canonical BSD-3-Clause exactly (#615). Preceded by `1.5.0a1` (2026-09-15), `1.5.0b1` and `1.5.0b2` (both 2026-09-18) and `1.5.0b3` (2026-09-19), all published as prereleases and so resolved only by `pip install --pre`. `1.5.0b1` half-shipped: the tag, the GitHub release and the Conda deployments landed, but PyPI rejected the wheel because `twine check` found a Sphinx-only `:mod:` role in `README.rst`, which `pyproject.toml` declares as the dynamic long description. `1.5.0b2` is what reshipped it -- the release workflow is version-driven, so an existing version cannot republish -- and `1.5.0b3` followed the CI change that stops a TestPyPI outage from costing a release its wheels (#497, #498). diff --git a/CITATION.cff b/CITATION.cff new file mode 100644 index 0000000000..8c655e45cf --- /dev/null +++ b/CITATION.cff @@ -0,0 +1,40 @@ +# Citation metadata for PyPCAPKit, in Citation File Format 1.2.0. +# c.f. https://citation-file-format.github.io +# +# This is the machine-readable half of the attribution that BSD-3-Clause asks for. +# GitHub renders it as the repository's "Cite this repository" button, and citation +# managers, Zenodo and dependency inventories read it directly -- so credit carries +# into a paper or a bill of materials instead of depending on a reader noticing +# ``LICENSE``. It grants nothing and restricts nothing; the licence is unchanged. +# +# ``version`` and ``date-released`` describe the newest *published* release, so they +# move with ``pcapkit.__version__`` in ``pcapkit/__init__.py`` and the matching entry +# under ``docs/source/changelog/`` when a release goes out. +# +# No ``doi`` and no ``orcid``: neither exists for this project or its author today, +# and both fields are checked formats rather than free text, so an invented value +# would validate and still be wrong. They are omitted rather than guessed. +cff-version: 1.2.0 +message: If you use this software, please cite it as below. +title: PyPCAPKit +abstract: >- + PyPCAPKit is a comprehensive, Python-native network packet analysis library: a + PCAP file extraction, construction and analysis toolkit that dissects protocols + in more detail than the common extractors do, over a choice of extraction + engines, and exposes them through a Pythonic interface. +type: software +authors: + - given-names: Jarry + family-names: Shaw + email: jarryshaw@icloud.com + alias: JarryShaw +repository-code: https://github.com/JarryShaw/PyPCAPKit +url: https://jarryshaw.github.io/PyPCAPKit/ +repository-artifact: https://pypi.org/project/pypcapkit/ +license: BSD-3-Clause +version: 1.5.0b4 +date-released: '2026-09-20' +keywords: + - network + - pcap + - packet diff --git a/LICENSE b/LICENSE index fd9e06d0d2..5d8442d77f 100755 --- a/LICENSE +++ b/LICENSE @@ -1,6 +1,6 @@ BSD 3-Clause License -Copyright (c) 2018-2023, Jarry Shaw +Copyright (c) 2018-2026, Jarry Shaw All rights reserved. Redistribution and use in source and binary forms, with or without @@ -26,4 +26,4 @@ DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.s +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. diff --git a/docs/source/changelog/1.5.0.rst b/docs/source/changelog/1.5.0.rst index 3e039b554f..2d42d175a1 100644 --- a/docs/source/changelog/1.5.0.rst +++ b/docs/source/changelog/1.5.0.rst @@ -814,6 +814,22 @@ pull requests between #326 and #509. well as the 113 generated modules, and a new test renders the shared template and compares it against the module generated from it, so a regeneration cannot quietly undo it (#584). +* **Added** -- ``CITATION.cff``, citation metadata in Citation File Format + 1.2.0, which GitHub renders as the repository's "Cite this repository" button + and which citation managers and dependency inventories read directly. It is + the machine-readable half of the attribution BSD-3-Clause already asks for, so + credit carries into a paper or a bill of materials rather than depending on a + reader opening ``LICENSE``. Validated with ``cffconvert --validate`` and + against the published 1.2.0 schema; ``doi`` and ``orcid`` are omitted rather + than invented, since neither exists for this project today and both are + checked formats, so a wrong value would still validate. The licence itself is + deliberately unchanged -- still BSD-3-Clause, no ``NOTICE`` file, no change to + its terms. Alongside it the copyright line moves from ``2018-2023`` to + ``2018-2026`` -- ``LICENSE`` was its only occurrence in the tree, since + ``docs/source/conf.py`` already derives its own from the current year -- and a + stray ``s`` after the closing ``DAMAGE.`` of the licence text, present since + the Mozilla-to-BSD relicence, is removed, so the wording now matches canonical + BSD-3-Clause exactly (#615). Preceded by ``1.5.0a1`` (2026-09-15), ``1.5.0b1`` and ``1.5.0b2`` (both 2026-09-18) and ``1.5.0b3`` (2026-09-19), all published as prereleases and so