mirror of
https://github.com/crewAIInc/crewAI.git
synced 2026-01-09 08:08:32 +00:00
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:
@@ -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:
|
||||
|
||||
@@ -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(
|
||||
|
||||
Reference in New Issue
Block a user