summaryrefslogtreecommitdiff
path: root/src/tox/provision.py
diff options
context:
space:
mode:
authorJürgen Gmach <juergen.gmach@googlemail.com>2021-03-20 18:45:28 +0100
committerGitHub <noreply@github.com>2021-03-20 17:45:28 +0000
commit813e62c384ee5ae6dfe500187cb52758d8479730 (patch)
tree82bc0f2a2963a70385f1f5370af2e7ef372bcdb2 /src/tox/provision.py
parentec50a6f2ccdf83a070d0037d7e685aa3c843821e (diff)
downloadtox-git-813e62c384ee5ae6dfe500187cb52758d8479730.tar.gz
Show skipped envs in reports on platform mismatch (#1970)
Co-authored-by: Bernát Gábor <gaborjbernat@gmail.com>
Diffstat (limited to 'src/tox/provision.py')
-rw-r--r--src/tox/provision.py7
1 files changed, 6 insertions, 1 deletions
diff --git a/src/tox/provision.py b/src/tox/provision.py
index 9710a70e..ef06a813 100644
--- a/src/tox/provision.py
+++ b/src/tox/provision.py
@@ -14,7 +14,9 @@ from tox.config.loader.memory import MemoryLoader
from tox.config.sets import CoreConfigSet
from tox.execute.api import StdinSource
from tox.plugin.impl import impl
+from tox.report import HandledError
from tox.session.state import State
+from tox.tox_env.errors import Skip
from tox.tox_env.python.req_file import RequirementsFile
from tox.tox_env.python.runner import PythonRun
from tox.tox_env.python.virtual_env.package.api import PackageType
@@ -108,7 +110,10 @@ def run_provision(deps: List[Requirement], state: State) -> int: # noqa
env_python = tox_env.env_python()
logging.info("will run in a automatically provisioned python environment under %s", env_python)
recreate = state.options.no_recreate_provision is False if state.options.recreate else False
- tox_env.ensure_setup(recreate=recreate)
+ try:
+ tox_env.ensure_setup(recreate=recreate)
+ except Skip as exception:
+ raise HandledError(f"cannot provision tox environment {tox_env.conf['env_name']} because {exception}")
args: List[str] = [str(env_python), "-m", "tox"]
args.extend(state.args)
outcome = tox_env.execute(cmd=args, stdin=StdinSource.user_only(), show=True, run_id="provision")