Skip to content

[Bug] Dependency default install #250

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 4 commits into from
Jan 28, 2025
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_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(

Check warning on line 52 in agentstack/packaging.py

View check run for this annotation

Codecov / codecov/patch

agentstack/packaging.py#L51-L52

Added lines #L51 - L52 were not covered by tests
[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(

Check warning on line 59 in agentstack/packaging.py

View check run for this annotation

Codecov / codecov/patch

agentstack/packaging.py#L58-L59

Added lines #L58 - L59 were not covered by tests
[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

Check warning on line 66 in agentstack/packaging.py

View check run for this annotation

Codecov / codecov/patch

agentstack/packaging.py#L64-L66

Added lines #L64 - L66 were not covered by tests


def remove(package: str):
Expand Down Expand Up @@ -137,8 +148,9 @@
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 @@

if process.wait() == 0: # return code: success
on_complete(all_lines)
return True

Check warning on line 180 in agentstack/packaging.py

View check run for this annotation

Codecov / codecov/patch

agentstack/packaging.py#L180

Added line #L180 was not covered by tests
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:

Check warning on line 191 in agentstack/packaging.py

View check run for this annotation

Codecov / codecov/patch

agentstack/packaging.py#L191

Added line #L191 was not covered by tests
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