Skip to content

Commit 0d8a133

Browse files
authored
Merge pull request #250 from AgentOps-AI/dependency-default-install
[Bug] Dependency default install
2 parents 3f76db8 + 47d12be commit 0d8a133

File tree

5 files changed

+32
-14
lines changed

5 files changed

+32
-14
lines changed

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -181,3 +181,5 @@ examples/tests/**/*
181181
uv.lock
182182
.DS_Store
183183

184+
.python-version
185+

agentstack/_tools/composio/config.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
"find_actions_by_tags"
1313
],
1414
"dependencies": [
15-
"composio>=1.0.0"
15+
"composio-core>=0.6.0"
1616
],
1717
"cta": "!!! Composio provides 150+ tools. Additional setup is required in agentstack/tools/composio/__init__.py"
1818
}

agentstack/packaging.py

Lines changed: 27 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -48,11 +48,22 @@ def on_progress(line: str):
4848
def on_error(line: str):
4949
log.error(f"uv: [error]\n {line.strip()}")
5050

51-
_wrap_command_with_callbacks(
52-
[get_uv_bin(), 'pip', 'install', '--python', '.venv/bin/python', '.'],
53-
on_progress=on_progress,
54-
on_error=on_error,
55-
)
51+
try:
52+
result = _wrap_command_with_callbacks(
53+
[get_uv_bin(), 'pip', 'install', '--python', '.venv/bin/python', '.'],
54+
on_progress=on_progress,
55+
on_error=on_error,
56+
)
57+
if result is False:
58+
log.info("Retrying uv installation with --no-cache flag...")
59+
_wrap_command_with_callbacks(
60+
[get_uv_bin(), 'pip', 'install', '--no-cache', '--python', '.venv/bin/python', '.'],
61+
on_progress=on_progress,
62+
on_error=on_error,
63+
)
64+
except Exception as e:
65+
log.error(f"Installation failed: {str(e)}")
66+
raise
5667

5768

5869
def remove(package: str):
@@ -137,8 +148,9 @@ def _wrap_command_with_callbacks(
137148
on_progress: Callable[[str], None] = lambda x: None,
138149
on_complete: Callable[[str], None] = lambda x: None,
139150
on_error: Callable[[str], None] = lambda x: None,
140-
) -> None:
141-
"""Run a command with progress callbacks."""
151+
) -> bool:
152+
"""Run a command with progress callbacks. Returns bool for cmd success."""
153+
process = None
142154
try:
143155
all_lines = ''
144156
process = subprocess.Popen(
@@ -165,12 +177,16 @@ def _wrap_command_with_callbacks(
165177

166178
if process.wait() == 0: # return code: success
167179
on_complete(all_lines)
180+
return True
168181
else:
169182
on_error(all_lines)
183+
return False
170184
except Exception as e:
171185
on_error(str(e))
186+
return False
172187
finally:
173-
try:
174-
process.terminate()
175-
except:
176-
pass
188+
if process:
189+
try:
190+
process.terminate()
191+
except:
192+
pass

docs/images/the_agent_stack.png

1.02 MB
Loading

pyproject.toml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -44,8 +44,8 @@ test = [
4444
"tox",
4545
]
4646
crewai = [
47-
"crewai==0.83.0",
48-
"crewai-tools==0.14.0",
47+
"crewai==0.100.0",
48+
"crewai-tools==0.33.0",
4949
]
5050
langgraph = [
5151
"langgraph>=0.2.61",

0 commit comments

Comments
 (0)