Skip to content
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.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -181,3 +181,5 @@ examples/tests/**/*
uv.lock
.DS_Store

.python-version

2 changes: 1 addition & 1 deletion agentstack/_tools/composio/config.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
"find_actions_by_tags"
],
"dependencies": [
"composio>=1.0.0"
"composio-core>=0.6.0"
],
"cta": "!!! Composio provides 150+ tools. Additional setup is required in agentstack/tools/composio/__init__.py"
}
38 changes: 27 additions & 11 deletions agentstack/packaging.py
Original file line number Diff line number Diff line change
Expand Up @@ -48,11 +48,22 @@ def on_progress(line: str):
def on_error(line: str):
log.error(f"uv: [error]\n {line.strip()}")

_wrap_command_with_callbacks(
[get_uv_bin(), 'pip', 'install', '--python', '.venv/bin/python', '.'],
on_progress=on_progress,
on_error=on_error,
)
try:
result = _wrap_command_with_callbacks(
[get_uv_bin(), 'pip', 'install', '--python', '.venv/bin/python', '.'],
on_progress=on_progress,
on_error=on_error,
)
if result is False:
log.info("Retrying uv installation with --no-cache flag...")
_wrap_command_with_callbacks(
[get_uv_bin(), 'pip', 'install', '--no-cache', '--python', '.venv/bin/python', '.'],
on_progress=on_progress,
on_error=on_error,
)
except Exception as e:
log.error(f"Installation failed: {str(e)}")
raise


def remove(package: str):
Expand Down Expand Up @@ -137,8 +148,9 @@ def _wrap_command_with_callbacks(
on_progress: Callable[[str], None] = lambda x: None,
on_complete: Callable[[str], None] = lambda x: None,
on_error: Callable[[str], None] = lambda x: None,
) -> None:
"""Run a command with progress callbacks."""
) -> bool:
"""Run a command with progress callbacks. Returns bool for cmd success."""
process = None
try:
all_lines = ''
process = subprocess.Popen(
Expand All @@ -165,12 +177,16 @@ def _wrap_command_with_callbacks(

if process.wait() == 0: # return code: success
on_complete(all_lines)
return True
else:
on_error(all_lines)
return False
except Exception as e:
on_error(str(e))
return False
finally:
try:
process.terminate()
except:
pass
if process:
try:
process.terminate()
except:
pass
Binary file modified docs/images/the_agent_stack.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
4 changes: 2 additions & 2 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -44,8 +44,8 @@ test = [
"tox",
]
crewai = [
"crewai==0.83.0",
"crewai-tools==0.14.0",
"crewai==0.100.0",
"crewai-tools==0.33.0",
]
langgraph = [
"langgraph>=0.2.61",
Expand Down