Skip to content

refactor(vendor): keep the vendor variables in pcapkit.vendor (#1726) - #1745

Merged
JarryShaw merged 1 commit into
mainfrom
refactor/1726-vendor-vars-stay-in-vendor
Oct 14, 2026
Merged

JarryShaw merged 1 commit into
mainfrom
refactor/1726-vendor-vars-stay-in-vendor

Conversation

@JarryShaw

Copy link
Copy Markdown
Owner

Please follow the guide below

What is the purpose of your pull request?

Tick the commit type your subject line carries.

  • fix — corrects a defect
  • feat — adds a feature
  • perf — changes performance, not behaviour
  • refactor — changes neither behaviour nor performance
  • test — tests only
  • docs — documentation only
  • ci — workflows or build tooling
  • release — bumps the version or rolls up a distribution
  • chore — anything else

Refs #1726. This follows the owner's later ruling that the vendor variables stay in pcapkit.vendor, which reverses the part of #1743 that moved them.

  • Names restored: pcapkit.vendor.default.MAX_RETRY (PCAPKIT_VENDOR_RETRY, default 5, minimum 1) and CI_MODE (PCAPKIT_CI_MODE) are back under their 1.4.x names. feat(utilities)!: one config module for the tunable limits (#1726) #1743's versionremoved notes for them are gone.
  • Bad values still warn: both now read through config.read_limit and config.read_flag, the newly public _read_limit and _read_flag. A bad value warns with ConfigWarning and falls back, where 1.4.x crashed on a non-integer and read 0 as 1.
  • Proxies: get_proxies() reads PCAPKIT_HTTP_PROXY and PCAPKIT_HTTPS_PROXY itself, on every call.
  • Removed from config: VENDOR_RETRY, CI_MODE, http_proxy and https_proxy. They never shipped, so they are deleted outright with no re-export.
  • Docs: the four variables are documented on the pcapkit.vendor.default page, and config.rst links there. Sphinx warnings are identical to main.
  • Tests: feat(utilities)!: one config module for the tunable limits (#1726) #1743's mutation-killing vendor tests move to tests/vendor/test_vendor_variables_1726_unit.py. Their notices, both retry loops and the per-call proxy reads are all kept.

@JarryShaw JarryShaw added the refactor Restructuring for its own sake — neither a fix nor a new capability (refactor: prefix) label Oct 14, 2026
@JarryShaw JarryShaw moved this to In review in PyPCAPKit Oct 14, 2026
@JarryShaw

Copy link
Copy Markdown
Owner Author

Verdict: GOOD TO GO at 8c525c06f. A Sonnet cross-review checked it (author: Opus).

  • MAX_RETRY and CI_MODE are back under their 1.4.x names, with no versionremoved left behind. The new versionchanged notes match the pre-feat(utilities)!: one config module for the tunable limits (#1726) #1743 source.
  • get_proxies() reads both proxy variables on every call. Mutants that cached either one at import were killed.
  • read_limit and read_flag are public, documented and listed in __all__. config imports only os, typing and utilities.warnings, and importing it does not load pcapkit.vendor.
  • config's vendor names are gone, with no re-export. No stale reader or test is left anywhere in the repo.
  • Sphinx shows the same 168 warnings on both trees. In the built HTML, the envvar-PCAPKIT_* anchors are on vendor/default.html.
  • My own re-run in the PR's tree: test_config_unit 36 passed, tests/vendor 142 passed, plus isort, the refactor(corekit)!: move utilities.decorators into corekit, and state the corekit/utilities rule (#1712, option A) #1735 boundary, documentation_claims and public_api.

@JarryShaw JarryShaw added review: good-to-go Cross-review at the current head says ready; CI state is separate 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 14, 2026
@JarryShaw

Copy link
Copy Markdown
Owner Author

Verdict: NEEDS CHANGES at 8c525c06f. CI fails test_unit_tests_queue.py::TestDocsOnlyPathRunsEveryDocsReader on 3.11–3.14. The new tests/vendor/test_vendor_variables_1726_unit.py reads the docs, so it has to be listed in project-tests in unit-tests.yml. A one-line fix is in progress.

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
JarryShaw force-pushed the refactor/1726-vendor-vars-stay-in-vendor branch from 8c525c0 to e41eaf0 Compare October 14, 2026 23:21
@JarryShaw

Copy link
Copy Markdown
Owner Author

Verdict: GOOD TO GO at e41eaf041. A Sonnet check verified the fix (author: Opus).

  • The only change since 8c525c06f is one line, unit-tests.yml:1709: tests.vendor.test_vendor_variables_1726_unit is appended to project-tests' docs-reader step.
  • test_unit_tests_queue.py fails on the old head and passes on the new one. I re-ran it myself: 38 passed, 505 subtests.
  • A wider scan found no other docs reader missing from that step.

@JarryShaw JarryShaw added review: good-to-go Cross-review at the current head says ready; CI state is separate and removed review: needs-changes Cross-review at the current head says changes are required; see the verdict comment labels Oct 14, 2026
@JarryShaw
JarryShaw merged commit d651060 into main Oct 14, 2026
54 of 55 checks passed
@JarryShaw
JarryShaw deleted the refactor/1726-vendor-vars-stay-in-vendor branch October 14, 2026 23:43
@github-project-automation github-project-automation Bot moved this from In review to Done in PyPCAPKit Oct 14, 2026
@JarryShaw JarryShaw removed the review: good-to-go Cross-review at the current head says ready; CI state is separate label Oct 14, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

refactor Restructuring for its own sake — neither a fix nor a new capability (refactor: prefix)

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

1 participant