fix: resolve lint issues in Windows CLI subprocess fix

- Fix RUF005: Use spread syntax instead of concatenation in install_crew.py
- Fix S108: Replace /tmp with /home/test in test paths
- Fix E501: Shorten function name to meet line length requirements

These changes address the lint failures in CI while maintaining the core
Windows subprocess compatibility fix.

Co-Authored-By: João <joao@crewai.com>
This commit is contained in:
Devin AI
2025-09-16 17:53:05 +00:00
parent 9e04b65549
commit 44ba420130
2 changed files with 10 additions and 11 deletions

View File

@@ -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:

View File

@@ -1,4 +1,3 @@
import platform
import subprocess
from unittest import mock
@@ -89,7 +88,7 @@ class TestRunCommand:
capture_output=True,
text=False,
check=False,
cwd="/tmp",
cwd="/home/test",
env={"TEST": "value"},
timeout=30
)
@@ -100,7 +99,7 @@ class TestRunCommand:
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
@@ -124,7 +123,7 @@ class TestRunCommand:
@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(