Repository navigation
feat(utilities)!: one config module for the tunable limits (#1726) - #1743
Merged
Merged
Conversation
Every tunable limit and the vendor crawlers' retry and CI settings move to the new pcapkit.utilities.config, each read once from a PCAPKIT_* variable. Readers look them up as config.<NAME> at call time, so one patch reaches every engine. A bad value warns with the new ConfigWarning, naming the variable and the value, and falls back; -1 lifts a limit, and that or a value above the default warns of the risk. The proxy variables are still read on every call, through config.http_proxy() and https_proxy(). A bad PCAPKIT_DEVMODE, PCAPKIT_VERBOSE or PCAPKIT_SPHINX is recorded by utilities.logging and reported by utilities.warnings once it has loaded. Both flag readers strip whitespace, and a ConfigWarning given at import names the importing module rather than <sys>:0. The docs extra now needs Sphinx>=7.3, for versionremoved. BREAKING CHANGE: the old homes are removed, with no re-export: protocols.protocol.FRAME_LAYER_LIMIT, protocols.internet.internet.EXTENSION_HEADER_LIMIT, toolkit.pypcapfile.IPV6_TCP_WARNED_LIMIT, dumpkit.common.FALLBACK_LIMIT, utilities.chardet.DETECT_CACHE_SIZE, corekit.io._READ_CHUNK, the corekit.fields.field zero-pad guards, and vendor.default.MAX_RETRY and CI_MODE. Refs #1726
Owner
Author
|
Verdict: GOOD TO GO at
|
Contributor
|
Coverage: 89.69% (unit tier, Python 3.15,
Per-file detail: the |
Owner
Author
|
The red here is GraalPy alone (#1740). Its runner was lost ( |
This was referenced Oct 14, 2026
JarryShaw
added a commit
that referenced
this pull request
Oct 14, 2026
The crawlers' variables move back out of pcapkit.utilities.config, which now holds the tunable limits only. - Restore pcapkit.vendor.default.MAX_RETRY (PCAPKIT_VENDOR_RETRY, default 5, minimum 1) and CI_MODE (PCAPKIT_CI_MODE) under their 1.4.x names, and drop #1743's versionremoved notes for them. - Read them with config.read_limit and config.read_flag, made public from _read_limit and _read_flag, so a bad value still warns with ConfigWarning, naming the variable and the value, and falls back. - get_proxies() reads PCAPKIT_HTTP_PROXY and PCAPKIT_HTTPS_PROXY itself on every call. config.VENDOR_RETRY, CI_MODE, http_proxy and https_proxy never shipped, so they are removed outright. - Document the four variables on the pcapkit.vendor.default page, which config.rst and index.rst link to. - Move #1743's vendor tests to tests/vendor/test_vendor_variables_1726_unit.py, and run it in project-tests' docs-only step, since it reads the docs. Refs #1726
JarryShaw
added a commit
that referenced
this pull request
Oct 14, 2026
…#1745) The crawlers' variables move back out of pcapkit.utilities.config, which now holds the tunable limits only. - Restore pcapkit.vendor.default.MAX_RETRY (PCAPKIT_VENDOR_RETRY, default 5, minimum 1) and CI_MODE (PCAPKIT_CI_MODE) under their 1.4.x names, and drop #1743's versionremoved notes for them. - Read them with config.read_limit and config.read_flag, made public from _read_limit and _read_flag, so a bad value still warns with ConfigWarning, naming the variable and the value, and falls back. - get_proxies() reads PCAPKIT_HTTP_PROXY and PCAPKIT_HTTPS_PROXY itself on every call. config.VENDOR_RETRY, CI_MODE, http_proxy and https_proxy never shipped, so they are removed outright. - Document the four variables on the pcapkit.vendor.default page, which config.rst and index.rst link to. - Move #1743's vendor tests to tests/vendor/test_vendor_variables_1726_unit.py, and run it in project-tests' docs-only step, since it reads the docs. Refs #1726
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 elseRefs #1726. This PR covers rulings 1–6. Ruling 7, one home per duplicated RFC constant, follows in #1739. It also closes #1708, by fixing that issue's last three agreement lines and dropping its guard's
PENDINGallowlist.pcapkit/utilities/config.py: every tunable is read once from aPCAPKIT_*variable. That covers the frame-layer and extension-header limits, the IPv6-TCP warned cache, the dumpkit fallback, the chardet cache, the read chunk, the three zero-pad guards, and the vendor retry and CI settings. The proxies are read per call, as before.configimports onlyutilities.warnings.config.<NAME>at call time, so one patch reaches every engine.ConfigWarning, naming the variable, the value and the importing module, then falls back to the default.-1lifts a limit; that, or a value above the default, warns of its own risk. BadDEVMODE/VERBOSE/SPHINXvalues now warn too.versionremoved:: 1.5.0, and thedocsextra now needsSphinx>=7.3.docs/source/pcapkit/utilities/config.rstgives every variable's default, range and risk.-1case per reader. Across five Sonnet rounds, every mutant is killed except one proven equivalent.Closes #1708