Skip to content
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

Forward install command options to uv sync #1510

Merged
merged 1 commit into from
Oct 25, 2024
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
10 changes: 7 additions & 3 deletions src/crewai/cli/cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -178,10 +178,14 @@ def test(n_iterations: int, model: str):
evaluate_crew(n_iterations, model)


@crewai.command()
def install():
@crewai.command(context_settings=dict(
ignore_unknown_options=True,
allow_extra_args=True,
))
@click.pass_context
def install(context):
"""Install the Crew."""
install_crew()
install_crew(context.args)


@crewai.command()
Expand Down
5 changes: 3 additions & 2 deletions src/crewai/cli/install_crew.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,13 @@
import click


def install_crew() -> None:
def install_crew(proxy_options: list[str]) -> None:
"""
Install the crew by running the UV command to lock and install.
"""
try:
subprocess.run(["uv", "sync"], check=True, capture_output=False, text=True)
command = ["uv", "sync"] + proxy_options
subprocess.run(command, check=True, capture_output=False, text=True)

except subprocess.CalledProcessError as e:
click.echo(f"An error occurred while running the crew: {e}", err=True)
Expand Down
Loading