summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/tox/config/loader/str_convert.py2
-rw-r--r--src/tox/tox_env/python/pip/pip_install.py5
2 files changed, 6 insertions, 1 deletions
diff --git a/src/tox/config/loader/str_convert.py b/src/tox/config/loader/str_convert.py
index e31c034f..f07545f5 100644
--- a/src/tox/config/loader/str_convert.py
+++ b/src/tox/config/loader/str_convert.py
@@ -63,6 +63,8 @@ class StrConvert(Convert[str]):
pos = splitter.instream.tell()
except ValueError:
args.append(value[pos:])
+ if len(args) == 0:
+ raise ValueError(f"attempting to parse {value!r} into a command failed")
if args[0] != "-" and args[0].startswith("-"):
args[0] = args[0][1:]
args = ["-"] + args
diff --git a/src/tox/tox_env/python/pip/pip_install.py b/src/tox/tox_env/python/pip/pip_install.py
index a148ce32..2136e862 100644
--- a/src/tox/tox_env/python/pip/pip_install.py
+++ b/src/tox/tox_env/python/pip/pip_install.py
@@ -160,7 +160,10 @@ class Pip(Installer[Python]):
outcome.assert_success()
def build_install_cmd(self, args: Sequence[str]) -> list[str]:
- cmd: Command = self._env.conf["install_command"]
+ try:
+ cmd: Command = self._env.conf["install_command"]
+ except ValueError as exc:
+ raise Fail(f"unable to determine pip install command: {str(exc)}") from exc
install_command = cmd.args
try:
opts_at = install_command.index("{packages}")