Skip to content

FIX preserve imports across repeated CLI flags - #306

Open
Neallin-917 wants to merge 1 commit into
joblib:masterfrom
Neallin-917:codex/fix-cli-repeated-imports
Open

Neallin-917 wants to merge 1 commit into
joblib:masterfrom
Neallin-917:codex/fix-cli-repeated-imports

Conversation

@Neallin-917

Copy link
Copy Markdown

Fixes #305.

Use argparse's extend action for -i / --import, with a list default, so repeated flags retain the modules from earlier occurrences. This follows the approach proposed in the issue. Single-flag usage and empty import groups remain supported.

Extend the existing CLI subprocess tests for repeated short, long and mixed flags, including a missing module in the first group so dropping that group cannot pass unnoticed. Also cover empty import groups.

Validation on macOS arm64, Python 3.12.13:

  • Before the parser change: CLI tests 3 failed, 6 passed (the three repeated-flag cases lose the first missing-module warning).
  • After: CLI tests 9 passed.
  • pytest -vlrxXs -W error: 32 passed, 83 skipped. Skips cover unavailable native BLAS/OpenMP helpers, Windows/Linux/conda-specific cases and other runtime-specific coverage; this is not validation of those platforms or the full CI matrix.
  • pre-commit run --all-files --show-diff-on-failure: passed after applying the repository formatter.

AI disclosure: implemented and tested with OpenAI Codex under the account owner's authorization. No independent human code review is claimed.

AI-assisted with OpenAI Codex; no independent human review claimed.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

CLI: a repeated -i silently drops the modules of the previous ones

1 participant