Repository navigation
refactor(python): move the launcher's argv config-path scan to its own module - #1047
Merged
Merged
Conversation
`config_paths_from_argv` moves out of `dirsql/cli/resolve_config_extensions.py` into `dirsql/cli/config_paths_from_argv.py`, leaving `with_resolved_extensions` alone in the module named for it. Mirrors #1039, which made the same call on the TypeScript twin. Behaviour-preserving: the symbol is package-internal and appears in no barrel, so the published API and the CLI are unchanged. The argv-parsing test cases relocate to the new module's colocated test file; the launcher's own tests now mock the scan as a collaborator. Part of #1042.
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.
Part of #1042.
Moves the launcher's argv config-path scan out of
packages/python/dirsql/cli/resolve_config_extensions.pyinto its own module, clearing that file'sone-function-per-fileviolation atmax_lines = 12(Kevin's chosen target for the campaign)._config_paths_from_argvbecomesconfig_paths_from_argvinpackages/python/dirsql/cli/config_paths_from_argv.py;with_resolved_extensionsstays in the module named for it and imports the scan relatively. The underscore drops because the symbol is now imported across modules; it stays out of every barrel, so nothing about the public API changes.Mirrors #1039. That PR made exactly this call on the TypeScript twin — moved
configPathsFromArgvintopackages/ts/src/cli/config-paths-from-argv.tsand keptwithResolvedExtensionswhere it was. Same shape here, so the two launchers keep matching. PR C is doing the remaining TypeScript splits concurrently.No
testing-conventions.tomltouched. This is a pure refactor; a separate PR sets the ceilings once every split has landed.packages/python/dirsql/resolve_config_extensions.py(the non-clione) violates only atmax_lines = 10, so it is out of scope at 12 and untouched.Verification
testing-conventions@0.0.111pinned by hand (the workflows call the reusable workflow at@v0and pin no npm version), against a copy ofpackages/python/testing-conventions.tomlwithmax_lines = 12:Before:
After: no output — zero violations.
just preflight:0 failing pair(s), 3 skipped(the threepackagingpairs, which need a built artifact). Pythonunit mutation:no surviving mutants — every mutation was caught (47 mutant(s) tested). Pythonunit coverage: clean at the 100% floor.Tests
Behaviour-preserving refactor, so red/green does not apply — there is no new behaviour to fail a test first. The existing cases were split by which unit they actually exercise:
resolve_config_extensions_test.pyinto a colocatedconfig_paths_from_argv_test.pythat calls the function directly.resolve_config_extensions_test.pykeeps the launcher's own plumbing — theinitand native-config guards,--extensionflag construction — and now mocks the scan as a collaborator (mock.patch.object(..., autospec=True)), alongside the resolver it already mocked, satisfyingunit lintisolation.Manual exercise
Built the binary (
cargo build -p dirsql --features cli) and the extension module (uv run maturin develop), staged the repo'stestextcdylib fixture as an installed packagemanualext, and ran the CLI path that resolves a config extension by package name:The
42proves the whole chain through the moved code: the launcher scanned-c ./.dirsql.tomlout of argv withconfig_paths_from_argv, the shared resolver turnedmanualextinto the loadable's literal path, the launcher appended--extension, and the binary loaded it.E2E Verification
packages/python/e2e-attestations/<branch>.jsonreceipt written ifpackages/pythonchanged (just e2e-attest-python)packages/ts/e2e-attestations/<branch>.jsonreceipt written ifpackages/tschanged (just e2e-attest-ts) — not required,packages/tsuntouchedjust test-e2e, thenjust e2e-attest-python37 passed in 13.57s; receipt atpackages/python/e2e-attestations/claude-tackle-1042-py12.json(exit 0).Per #1041,
testing-conventions e2e attest(local CLI 0.0.85) pruned 14 unrelated receipts and auto-committed the deletions. The attest commit was rewritten to add the one new receipt and nothing else;git show --staton it reads1 file changed, 7 insertions(+).Changelog / Migrations
<root>/<pkg>/changelog.d/for each changed package (or:skip-changelogtrailer on a commit with reason) —packages/python/changelog.d/2026-09-04-config-paths-from-argv-module.md<root>/<pkg>/migrations.d/(or: not required -- additive/bugfix only)Migration: not required. The moved symbol was module-private (
_config_paths_from_argv), is exported from no barrel, and appears in no documented surface.with_resolved_extensionskeeps its name and module, and its only call site (dirsql/cli/main.py) is unchanged. No public API breaks, no deprecation is removed, and runtime behaviour is identical — the manual exercise and the 37-case e2e suite both confirm it.PARITY.md: no change. Neither
config_paths_from_argvnorwith_resolved_extensionsappears inPARITY.md,packages/python/dirsql/__init__.py, orpackages/ts/src/index.ts. No drift introduced, none restored.