Skip to content

Commit 78a4970

Browse files
committed
env_select: ignore other env configurations when provisioning
When running provision, ignore other environments, since their configuration might not be valid until running in the provisioned environment. Fix #2862
1 parent df48a67 commit 78a4970

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

src/tox/session/env_select.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -242,6 +242,10 @@ def _finalize_config(self) -> None:
242242

243243
def _build_run_env(self, name: str) -> RunToxEnv | None:
244244
if self._provision is not None and self._provision[0] is False and name == self._provision[1]:
245+
# ignore provision env unless this is a provision run
246+
return None
247+
if self._provision is not None and self._provision[0] and name != self._provision[1]:
248+
# ignore other envs when this is a provision run
245249
return None
246250
env_conf = self._state.conf.get_env(name, package=False)
247251
if self._provision is not None and self._provision[1] == name:

0 commit comments

Comments
 (0)