✨ feat(cli): accept plugin CLI options during provisioning#3791
Merged
gaborbernat merged 1 commit intotox-dev:mainfrom Feb 20, 2026
Merged
✨ feat(cli): accept plugin CLI options during provisioning#3791gaborbernat merged 1 commit intotox-dev:mainfrom
gaborbernat merged 1 commit intotox-dev:mainfrom
Conversation
ab12c37 to
755efa8
Compare
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.
Plugins that add CLI options via
tox_add_optioncouldn't be used withrequires-based provisioning. Runningtox --demo-pluginwhere--demo-pluginis defined by a plugin inrequireswould fail with "unrecognized arguments" because CLI argument validation happened before provisioning had a chance to install the plugin and re-execute tox.🔧 The fix defers unknown argument validation until after the provisioning check. During initial CLI parsing,
parse_known_argsis used instead ofparse_args, allowing unrecognized flags through. If provisioning is needed, tox re-executes in the provisioned environment where the plugin is installed and the flag is recognized. If provisioning is not needed, any remaining unknown arguments still raise the familiar error message — so typos and invalid flags are still caught.The demo plugin used in integration tests now also registers a
--demo-pluginCLI flag viatox_add_optionto exercise this path.Fixes #2935