From 870a092687acd1d261d74c13feaccd8bb36c739c Mon Sep 17 00:00:00 2001 From: Eduardo Chiarotti Date: Fri, 18 Oct 2024 15:38:24 -0300 Subject: [PATCH] feat: add poetry.lock to uv migration --- src/crewai/cli/update_crew.py | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/src/crewai/cli/update_crew.py b/src/crewai/cli/update_crew.py index e2d39590d3..d38e11a252 100644 --- a/src/crewai/cli/update_crew.py +++ b/src/crewai/cli/update_crew.py @@ -1,3 +1,4 @@ +import os import shutil import tomli_w @@ -94,6 +95,15 @@ def migrate_pyproject(input_file, output_file): shutil.copy2(input_file, backup_file) print(f"Original pyproject.toml backed up as {backup_file}") + # Rename the poetry.lock file + lock_file = "poetry.lock" + lock_backup = "poetry-old.lock" + if os.path.exists(lock_file): + os.rename(lock_file, lock_backup) + print(f"Original poetry.lock renamed to {lock_backup}") + else: + print("No poetry.lock file found to rename.") + # Write the new pyproject.toml with open(output_file, "wb") as f: tomli_w.dump(new_pyproject, f)