Skip to content

build!: require Python 3.8+ and drop the BPC conversion (#2051) - #2053

Merged
JarryShaw merged 1 commit into
mainfrom
feat/2051-require-python-38
Oct 22, 2026
Merged

JarryShaw merged 1 commit into
mainfrom
feat/2051-require-python-38

Conversation

@JarryShaw

Copy link
Copy Markdown
Owner
  • Searched for similar pull requests
  • Followed the coding style (make pylint, make mypy, make isort)
  • make test passes, and a test case covers the change
  • Added a changelog entry

What is the purpose of your pull request?

  • build — changes the build system or external dependencies
  • Breaking change

Description of your pull request and other information

Closes #2051. Closes #2040. The owner ruled that 1.5.0 requires Python 3.8+, because BPC is no longer maintained, and that the 3.7 KTLO legs go.

  • pyproject.toml:
    • requires-python = ">=3.8", with no upper bound: nothing reads <4, and a cap gets copied into every dependent's metadata.
    • The bpc-* requirements and their note are gone.
    • The always-true markers are dropped: scapy's >= '3.7', and pathlib2 for 3.4.
  • setup.py: only setup() is left. refactor() and the four command overrides that existed only to call it are removed. The <= 2 guard stays on purpose: pip builds metadata with setup.py before it checks requires-python, so a 3.8 guard would replace pip's clean error with a traceback (measured).
  • Version gates: the gates below 3.8 are removed from compat.py, pcapng, pcap/frame, ethernet, arp, toolkit/pypcapfile, infoclass and protocol. The 3.9–3.11 gates stay.
  • CI:
    • "3.7" is dropped from .github/python-versions.toml, so the Python, Integration and Compat 3.7 KTLO legs go. No required check or needs: named them, and the updater does not re-add a dropped EOL version, which a new test checks.
    • EXPECTED in coverage-comment.yml is now empty. Its 3.7 entries are gone, and so is the pypy3.10 entry, now stale: on ci(conda): upload the macos-26-intel legs with the anaconda CLI (#2044) #2049's CI that leg installed and passed 930 tests.
  • vermin: targets = 3.8. It stays non-blocking.
  • Docs: README, SECURITY, CONTRIBUTING, the Makefile and the docs pages that stated 3.6/3.7 support or described the BPC conversion.
  • Tests: the new tests/project/test_requires_python_floor_2051.py fails on main's pyproject.toml and vermin.ini (4 failed) and passes here. The pins of the old contract are updated; 284 affected test files pass.

On 3.7, pip install . now stops with ERROR: Package 'pypcapkit' requires a different Python: 3.7.16 not in '>=3.8'.

@JarryShaw JarryShaw added dependencies Pull requests that update a dependency file python Pull requests that update Python code ci Pull requests that change CI or workflow configuration (ci: subject prefix) breaking Breaks public-facing behaviour or API (apply alongside the type label) review: running A cross-review is in flight against the current head - no verdict yet labels Oct 22, 2026
@JarryShaw JarryShaw moved this to In review in PyPCAPKit Oct 22, 2026
@JarryShaw
JarryShaw force-pushed the feat/2051-require-python-38 branch from 776bbbe to e35f671 Compare October 22, 2026 20:49
@JarryShaw

Copy link
Copy Markdown
Owner Author

NEEDS CHANGES at e35f6713e (Sonnet cross-review). One fix:

  • The make_tmp_dir docstring in tests/project/test_pyshark_encap_map.py still says requires-python = ">=3.6, <4" and "present since 3.6". It needs rewording for >=3.8.

Also being cleaned up: the dead sys.version_info >= (3, 8) gates in tests/protocols/test_protocol_make_unit.py and tests/test_support_helpers.py.

Checks that held:

  • Every removed gate was below 3.8, and the kept branch is the one 3.8–3.10 already took. The gates at 3.9 and above are untouched.
  • compat.__all__ is unchanged.
  • The removed setup.py overrides only called refactor(). Wheels built from main and from this PR both have 534 entries, with Requires-Python: >=3.8 and no bpc.
  • No workflow or required context names a 3.7 job.
  • Dropping the pypy3.10 entry from EXPECTED is justified: on run 39841966324, a descendant of 8df1192d0, both pypy3.10 KTLO legs succeeded.
  • The new floor and setup tests fail on main. 297 tests pass across the touched files.

@JarryShaw JarryShaw added review: needs-changes Cross-review at the current head says changes are required; see the verdict comment and removed review: running A cross-review is in flight against the current head - no verdict yet labels Oct 22, 2026
@JarryShaw
JarryShaw force-pushed the feat/2051-require-python-38 branch from e35f671 to 858f3e3 Compare October 22, 2026 21:00
@JarryShaw

Copy link
Copy Markdown
Owner Author

Pushed 858f3e30a (was e35f6713e), with the review fixes:

  • Docstring: the make_tmp_dir docstring now states the 3.8 floor.
  • Dead gates: the two always-true >= (3, 8) test gates are gone, and the tests behave the same.
  • Re-grep: two more stale lines turned up and are fixed: tests/utilities/_harness.py ("from 3.6") and a comment in test_stdlib_feature_probes_1709_unit.py. Every other hit is an RFC anchor, a third-party bound or history.

The touched files and the floor test give 95 passed. A delta re-review is in progress.

@JarryShaw JarryShaw added review: running A cross-review is in flight against the current head - no verdict yet and removed review: needs-changes Cross-review at the current head says changes are required; see the verdict comment labels Oct 22, 2026
@JarryShaw

Copy link
Copy Markdown
Owner Author

GOOD TO GO at 858f3e30a (Sonnet delta re-review).

  • Docstring: now states the 3.8 floor, and its API versions are right: TemporaryDirectory.cleanup dates from 3.2 and addCleanup from 3.1.
  • Gates: both dead >= (3, 8) gates are gone, and the tests behave the same.
  • Repo-wide grep: every remaining hit for bpc, pathlib2, 3.6, 3.7 or <4 is legitimate.

The touched files and tests/utilities: 240 passed. The earlier verdict on the rest of the PR stands.

@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 22, 2026
@JarryShaw

Copy link
Copy Markdown
Owner Author

Red, being fixed: Project tests fails test_docs_ktlo_defined_1950_unit::FirstMentionTests::test_markdown_spells_the_acronym_out_at_first_use, and my local project ordering leg fails the same test (1840 tests, 1 failure). The cause is the new requires-python changelog entry: it is now the first mention of KTLO in CHANGELOG.md, and #1950 requires the acronym spelled out ("keep the lights on") at first use. The fix is in progress, and the full project leg will be rerun before this is ready again.

@JarryShaw JarryShaw added review: needs-changes Cross-review at the current head says changes are required; see the verdict comment and removed review: good-to-go Cross-review at the current head says ready; CI state is separate labels Oct 22, 2026
The owner ruled on #2040 that 1.5.0 is a full turn to Python 3.8+; the
bpc-* backport tools are no longer maintained.

- pyproject.toml: requires-python ">=3.8"; drop the bpc-* and pathlib2
  requirements and the markers constant from 3.8 on (scapy's >= '3.7').
- setup.py: drop refactor() and the build commands that only ran it.
- pcapkit: drop the version gates 3.8 can no longer take, in compat.py
  and the py37/py38 flags elsewhere; the compat names stay exported.
- vermin.ini targets 3.8.
- CI: drop the 3.7 KTLO legs, and empty coverage-comment.yml's EXPECTED,
  as the pypy3.10 legs install since #2040's cryptography cap.
- Docs and comments that stated 3.6/3.7 support or the conversion, and
  the 1.5.0 changelog entries, CHANGELOG.md regenerated.
- Tests: retarget the 3.7 pins; pin the floor, no bpc-* requirement and
  no constant marker; the updater does not re-add a dropped version.

Affected test files pass, run one by one.

Closes #2040
@JarryShaw
JarryShaw force-pushed the feat/2051-require-python-38 branch from 858f3e3 to 676ad23 Compare October 22, 2026 21:32
@JarryShaw

Copy link
Copy Markdown
Owner Author

Pushed 676ad2304 (was 858f3e30a). The fix spells out the acronym at first use: "The 3.7 KTLO (keep the lights on) legs go with it", with CHANGELOG.md regenerated. Re-run on this head: the full project leg (util/run_unittest_leg.py project) gives 1840 tests, 0 failures, and test_docs_ktlo_defined_1950_unit plus test_changelog_md give 72 passed. A delta re-review is in progress.

@JarryShaw JarryShaw added review: running A cross-review is in flight against the current head - no verdict yet and removed review: needs-changes Cross-review at the current head says changes are required; see the verdict comment labels Oct 22, 2026
@JarryShaw

Copy link
Copy Markdown
Owner Author

GOOD TO GO at 676ad2304 (Sonnet delta re-review). The diff changes only the KTLO first-use wording in 1.5.0.rst and the regenerated CHANGELOG.md. The expansion matches workflows.rst's KTLO (*keep the lights on*). test_docs_ktlo_defined_1950_unit, test_changelog_md and test_docs_internal_refs_1940_unit give 79 passed, and util/changelog_md.py --check reports the two files in step. The full project leg on this head: 1840 tests, 0 failures.

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

Copy link
Copy Markdown
Contributor

Coverage: 91.52% (unit tier, Python 3.15, 676ad2304, Unit Tests run success)

Package Statements Missed Branches Partial Cover
pcapkit (top level) 104 4 20 2 95.16%
pcapkit/const 19599 881 2618 867 92.11%
pcapkit/corekit 2565 71 812 37 96.56%
pcapkit/dumpkit 282 3 102 3 98.44%
pcapkit/foundation 2930 23 1022 25 98.79%
pcapkit/interface 138 4 52 3 96.32%
pcapkit/protocols 17414 219 4574 185 98.14%
pcapkit/toolkit 869 36 298 10 95.20%
pcapkit/utilities 473 7 136 5 98.03%
pcapkit/vendor 4431 1995 1018 167 51.73%

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

@JarryShaw

Copy link
Copy Markdown
Owner Author

Ordering check on 676ad2304: the project leg (util/run_unittest_leg.py project) ran 1840 tests, OK (71 skipped). CI: 58 checks green, 0 failing. KTLO 3.8, 3.9 and 3.10 legs: 0 failing tests. The 3.7 legs are gone, as intended. Ready to merge.

@JarryShaw
JarryShaw merged commit 23e0201 into main Oct 22, 2026
60 checks passed
@github-project-automation github-project-automation Bot moved this from In review to Done in PyPCAPKit Oct 22, 2026
@JarryShaw
JarryShaw deleted the feat/2051-require-python-38 branch October 22, 2026 23:01
@JarryShaw JarryShaw removed the review: good-to-go Cross-review at the current head says ready; CI state is separate label Oct 22, 2026
JarryShaw added a commit that referenced this pull request Oct 22, 2026
After #2053 setup.py was a Python 2 guard and a bare setup(); pyproject.toml
declares everything, and the wheel builds the same files without it.

- Delete setup.py and tests/project/test_setup.py.
- Add tests/project/test_no_setup_py_2061.py: fails if setup.py returns, or if
  a COPY in examples/benchmark/Dockerfile names an untracked path.
- examples/benchmark/Dockerfile: stop copying setup.py.
- pyproject.toml, test_actions_pinned_1968: the static readme is now explained
  by Dependabot building the editable from pyproject.toml alone
  (fetch_project_file falls back to it when setup.py is absent), not by its
  stub setup.py.
- util/classify_changes.py, tests/_tiers.py: examples no longer name the
  removed files.
- Changelog entry in 1.5.0.rst; CHANGELOG.md regenerated.
JarryShaw added a commit that referenced this pull request Oct 22, 2026
After #2053 setup.py was a Python 2 guard and a bare setup(); pyproject.toml
declares everything, and the wheel builds the same files without it.

- Delete setup.py and tests/project/test_setup.py.
- Add tests/project/test_no_setup_py_2061.py: fails if setup.py returns, or if
  a COPY in examples/benchmark/Dockerfile names an untracked path.
- examples/benchmark/Dockerfile: stop copying setup.py.
- pyproject.toml, test_actions_pinned_1968: the static readme is now explained
  by Dependabot fetching pyproject.toml in setup.py's place
  (fetch_project_file) and passing it through unstubbed, not by its stub
  setup.py.
- util/classify_changes.py, tests/_tiers.py: examples no longer name the
  removed files.
- Changelog entry in 1.5.0.rst; CHANGELOG.md regenerated.
JarryShaw added a commit that referenced this pull request Oct 23, 2026
After #2053 setup.py was a Python 2 guard and a bare setup(); pyproject.toml
declares everything, and the wheel builds the same files without it.

- Delete setup.py and tests/project/test_setup.py.
- Add tests/project/test_no_setup_py_2061.py: fails if setup.py returns, or if
  a COPY in examples/benchmark/Dockerfile names an untracked path.
- examples/benchmark/Dockerfile: stop copying setup.py.
- pyproject.toml, test_actions_pinned_1968: the static readme is now explained
  by Dependabot fetching pyproject.toml in setup.py's place
  (fetch_project_file) and passing it through unstubbed, not by its stub
  setup.py.
- util/classify_changes.py, tests/_tiers.py: examples no longer name the
  removed files.
- Changelog entry in 1.5.0.rst; CHANGELOG.md regenerated.
@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

breaking Breaks public-facing behaviour or API (apply alongside the type label) ci Pull requests that change CI or workflow configuration (ci: subject prefix) dependencies Pull requests that update a dependency file python Pull requests that update Python code

Projects

Status: Done

1 participant