✨ feat(config): add extra_setup_commands for --notest phase#3716
Merged
gaborbernat merged 1 commit intotox-dev:mainfrom Feb 17, 2026
Merged
✨ feat(config): add extra_setup_commands for --notest phase#3716gaborbernat merged 1 commit intotox-dev:mainfrom
gaborbernat merged 1 commit intotox-dev:mainfrom
Conversation
4945084 to
e589180
Compare
223de3f to
792f3ef
Compare
When running tox --notest in CI, users need to separate dependency setup from test execution. The existing commands_pre/commands/commands_post all run during the test phase and are skipped with --notest, leaving no way to run setup tasks like pre-commit install-hooks during the installation phase while keeping actual tests separate. Introduce extra_setup_commands that executes after all installations (deps and package) but before the test phase. This runs during --notest, enabling users to prepare their environment with tools and hooks while deferring test execution to a separate CI step. Resolves tox-dev#1504 Signed-off-by: Bernát Gábor <bgabor8@bloomberg.net>
f718d48 to
14fc07f
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.
When running
tox --notestin CI pipelines, teams need to separate dependency installation from test execution. The existingcommands_pre,commands, andcommands_postall run during the test phase and are completely skipped with--notest, leaving no way to run setup tasks during the installation phase. 🔧A common use case is installing pre-commit hooks with
pre-commit install-hooksduring the--notestphase, then runningpre-commit runas the actual test command in a separate CI step. This separation allows faster feedback and better resource utilization in CI environments.This PR introduces
extra_setup_commandsthat executes after all installations (dependencies and package) complete but before the test phase begins. ✨ These commands run during--notest, enabling users to prepare their environment with tools and hooks while deferring test execution to a separate step.The implementation adds the configuration option to
PythonRunenvironments only, deliberately excluding packaging environments to maintain their clean separation of concerns. Commands execute with the same change directory and error handling semantics as other command sets.Resolves #1504