Skip to content

✨ feat(config): add extra_setup_commands for --notest phase#3716

Merged
gaborbernat merged 1 commit intotox-dev:mainfrom
gaborbernat:extra-setup-commands
Feb 17, 2026
Merged

✨ feat(config): add extra_setup_commands for --notest phase#3716
gaborbernat merged 1 commit intotox-dev:mainfrom
gaborbernat:extra-setup-commands

Conversation

@gaborbernat
Copy link
Member

When running tox --notest in CI pipelines, teams need to separate dependency installation from test execution. The existing commands_pre, commands, and commands_post all 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-hooks during the --notest phase, then running pre-commit run as 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_commands that 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 PythonRun environments 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

@gaborbernat gaborbernat force-pushed the extra-setup-commands branch 2 times, most recently from 4945084 to e589180 Compare February 17, 2026 01:22
@gaborbernat gaborbernat enabled auto-merge (squash) February 17, 2026 01:24
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>
@gaborbernat gaborbernat merged commit 1e2e12b into tox-dev:main Feb 17, 2026
28 checks passed
@gaborbernat gaborbernat deleted the extra-setup-commands branch February 18, 2026 07:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Introduce install_command_post executed with --notest

1 participant