Skip to content

Commit 95cec46

Browse files
Fix when there is no 4th arg passed to build_isolated (#2056)
Co-authored-by: Antoine DECHAUME <[email protected]> Co-authored-by: Bernát Gábor <[email protected]>
1 parent 726a275 commit 95cec46

File tree

4 files changed

+12
-1
lines changed

4 files changed

+12
-1
lines changed

CONTRIBUTORS

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ Andrii Soldatenko
99
Andrzej Klajnert
1010
Anthon van der Neuth
1111
Anthony Sottile
12+
Antoine Dechaume
1213
Anudit Nagar
1314
Ashley Whetter
1415
Asmund Grammeltwedt

docs/changelog/2056.bugfix.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Fix a ``tox-conda`` isolation build bug - by :user:`AntoineD`.

src/tox/helper/build_isolated.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ def _ensure_module_in_paths(module, paths):
2929
dist_folder = sys.argv[1]
3030
backend_spec = sys.argv[2]
3131
backend_obj = sys.argv[3] if len(sys.argv) >= 4 else None
32-
backend_paths = sys.argv[4].split(os.path.pathsep) if sys.argv[4] else []
32+
backend_paths = sys.argv[4].split(os.path.pathsep) if (len(sys.argv) >= 5 and sys.argv[4]) else []
3333

3434
sys.path[:0] = backend_paths
3535

tests/unit/package/builder/test_package_builder_isolated.py

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,10 @@
11
import os
2+
import subprocess
23

34
import py
45
import pytest
56

7+
import tox.helper
68
from tox.package.builder.isolated import get_build_info
79
from tox.reporter import _INSTANCE
810

@@ -193,3 +195,10 @@ def test_verbose_isolated_build_in_tree(initproj, mock_venv, cmd):
193195
assert "running sdist" in result.out, result.out
194196
assert "running egg_info" in result.out, result.out
195197
assert "Writing example123-0.5{}setup.cfg".format(os.sep) in result.out, result.out
198+
199+
200+
def test_isolated_build_script_args(tmp_path):
201+
"""Verify that build_isolated.py can be called with only 2 argurments."""
202+
# cannot import build_isolated because of its side effects
203+
script_path = os.path.join(os.path.dirname(tox.helper.__file__), "build_isolated.py")
204+
subprocess.check_call(("python", script_path, str(tmp_path), "setuptools.build_meta"))

0 commit comments

Comments
 (0)