Skip to content

Commit

Permalink
feat: ADd warning from poetry -> uv
Browse files Browse the repository at this point in the history
  • Loading branch information
pythonbyte committed Oct 16, 2024
1 parent c9152f2 commit 8822e50
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 0 deletions.
6 changes: 6 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -252,6 +252,12 @@ or
python src/my_project/main.py
```

If an error happens due to the usage of poetry, please run the following command to update your crewai package:

```bash
crewai update
```

You should see the output in the console and the `report.md` file should be created in the root of your project with the full final report.

In addition to the sequential process, you can use the hierarchical process, which automatically assigns a manager to the defined crew to properly coordinate the planning and execution of tasks through delegation and validation of results. [See more about the processes here](https://docs.crewai.com/core-concepts/Processes/).
Expand Down
19 changes: 19 additions & 0 deletions src/crewai/cli/run_crew.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,32 @@

import click
import tomllib
from packaging import version

from crewai.cli.utils import get_crewai_version


def run_crew() -> None:
"""
Run the crew by running a command in the UV environment.
"""
command = ["uv", "run", "run_crew"]
crewai_version = get_crewai_version()
min_required_version = "0.71.0"

with open("pyproject.toml", "rb") as f:
data = tomllib.load(f)

if data.get("tool", {}).get("poetry") and (
version.parse(crewai_version) < version.parse(min_required_version)
):
click.secho(
f"You are running an older version of crewAI ({crewai_version}) that uses poetry pyproject.toml. "
f"Please run `crewai update` to update your pyproject.toml to use uv.",
fg="red",
)
print()

try:
subprocess.run(command, capture_output=False, text=True, check=True)

Expand Down

0 comments on commit 8822e50

Please sign in to comment.