fix: message

This commit is contained in:
Eduardo Chiarotti
2024-10-11 22:02:17 -03:00
parent 6187e458fe
commit d84766c356

View File

@@ -1,6 +1,7 @@
import subprocess
import click
import tomllib
def run_crew() -> None:
@@ -9,15 +10,16 @@ def run_crew() -> None:
"""
command = ["uv", "run", "run_crew"]
try:
subprocess.run(
command, capture_output=False, text=True, check=True, stderr=subprocess.PIPE
)
subprocess.run(command, capture_output=False, text=True, check=True)
except subprocess.CalledProcessError as e:
click.echo(f"An error occurred while running the crew: {e}", err=True)
click.echo(e.output, err=True, nl=True)
click.echo(e.stderr, err=True, nl=True)
if "table found" in e.stderr:
with open("pyproject.toml", "rb") as f:
data = tomllib.load(f)
if data.get("tool", {}).get("poetry"):
click.secho(
"It's possible that you are using an old version of crewAI that uses poetry, please run `crewai update` to update your pyproject.toml to use uv.",
fg="yellow",