Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix when there is no 4th arg passed to build_isolated #2056

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
1 change: 1 addition & 0 deletions CONTRIBUTORS
Expand Up @@ -9,6 +9,7 @@ Andrii Soldatenko
Andrzej Klajnert
Anthon van der Neuth
Anthony Sottile
Antoine Dechaume
Anudit Nagar
Ashley Whetter
Asmund Grammeltwedt
Expand Down
1 change: 1 addition & 0 deletions docs/changelog/2056.bugfix.rst
@@ -0,0 +1 @@
Fix a ``tox-conda`` isolation build bug - by :user:`AntoineD`.
2 changes: 1 addition & 1 deletion src/tox/helper/build_isolated.py
Expand Up @@ -29,7 +29,7 @@ def _ensure_module_in_paths(module, paths):
dist_folder = sys.argv[1]
backend_spec = sys.argv[2]
backend_obj = sys.argv[3] if len(sys.argv) >= 4 else None
backend_paths = sys.argv[4].split(os.path.pathsep) if sys.argv[4] else []
backend_paths = sys.argv[4].split(os.path.pathsep) if (len(sys.argv) >= 5 and sys.argv[4]) else []

sys.path[:0] = backend_paths

Expand Down
9 changes: 9 additions & 0 deletions tests/unit/package/builder/test_package_builder_isolated.py
@@ -1,8 +1,10 @@
import os
import subprocess

import py
import pytest

import tox.helper
from tox.package.builder.isolated import get_build_info
from tox.reporter import _INSTANCE

Expand Down Expand Up @@ -193,3 +195,10 @@ def test_verbose_isolated_build_in_tree(initproj, mock_venv, cmd):
assert "running sdist" in result.out, result.out
assert "running egg_info" in result.out, result.out
assert "Writing example123-0.5{}setup.cfg".format(os.sep) in result.out, result.out


def test_isolated_build_script_args(tmp_path):
"""Verify that build_isolated.py can be called with only 2 argurments."""
# cannot import build_isolated because of its side effects
script_path = os.path.join(os.path.dirname(tox.helper.__file__), "build_isolated.py")
subprocess.check_call(("python", script_path, str(tmp_path), "setuptools.build_meta"))
jugmac00 marked this conversation as resolved.
Show resolved Hide resolved