diff --git a/src/crewai/cli/install_crew.py b/src/crewai/cli/install_crew.py index 649da342d..dc9bd81ab 100644 --- a/src/crewai/cli/install_crew.py +++ b/src/crewai/cli/install_crew.py @@ -14,7 +14,7 @@ def install_crew(proxy_options: list[str]) -> None: Install the crew by running the UV command to lock and install. """ try: - command = ["uv", "sync"] + proxy_options + command = ["uv", "sync", *proxy_options] run_command(command, check=True, capture_output=False, text=True) except subprocess.CalledProcessError as e: diff --git a/tests/cli/test_subprocess_utils.py b/tests/cli/test_subprocess_utils.py index 2ce123297..c9f6138a1 100644 --- a/tests/cli/test_subprocess_utils.py +++ b/tests/cli/test_subprocess_utils.py @@ -1,4 +1,3 @@ -import platform import subprocess from unittest import mock @@ -24,7 +23,7 @@ class TestRunCommand: mock_subprocess_run.assert_called_once() call_args = mock_subprocess_run.call_args - + assert call_args[1]["shell"] is True assert isinstance(call_args[0][0], str) assert "uv run test" in call_args[0][0] @@ -43,7 +42,7 @@ class TestRunCommand: mock_subprocess_run.assert_called_once() call_args = mock_subprocess_run.call_args - + assert call_args[1].get("shell", False) is False assert call_args[0][0] == command @@ -62,7 +61,7 @@ class TestRunCommand: mock_subprocess_run.assert_called_once() call_args = mock_subprocess_run.call_args command_str = call_args[0][0] - + assert '"hello world"' in command_str or "'hello world'" in command_str @mock.patch("platform.system") @@ -89,18 +88,18 @@ class TestRunCommand: capture_output=True, text=False, check=False, - cwd="/tmp", + cwd="/home/test", env={"TEST": "value"}, timeout=30 ) mock_subprocess_run.assert_called_once() call_args = mock_subprocess_run.call_args - + assert call_args[1]["capture_output"] is True assert call_args[1]["text"] is False assert call_args[1]["check"] is False - assert call_args[1]["cwd"] == "/tmp" + assert call_args[1]["cwd"] == "/home/test" assert call_args[1]["env"] == {"TEST": "value"} assert call_args[1]["timeout"] == 30 @@ -118,13 +117,13 @@ class TestRunCommand: mock_subprocess_run.assert_called_once() call_args = mock_subprocess_run.call_args - + assert call_args[1].get("shell", False) is False assert call_args[0][0] == command @mock.patch("platform.system") @mock.patch("subprocess.run") - def test_windows_string_command_passthrough(self, mock_subprocess_run, mock_platform): + def test_windows_string_passthrough(self, mock_subprocess_run, mock_platform): """Test that Windows passes through string commands unchanged.""" mock_platform.return_value = "Windows" mock_subprocess_run.return_value = subprocess.CompletedProcess( @@ -136,6 +135,6 @@ class TestRunCommand: mock_subprocess_run.assert_called_once() call_args = mock_subprocess_run.call_args - + assert call_args[0][0] == command_str assert call_args[1]["shell"] is True