Skip to content
Draft
Changes from 1 commit
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
Prev Previous commit
Next Next commit
merge main
  • Loading branch information
adubatl committed Mar 7, 2025
commit 146fc2c0ef250f59bf3f3c1c328b935aade4d4ef
11 changes: 10 additions & 1 deletion agentstack/update.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
import questionary
from agentstack import log
from agentstack.utils import get_version, get_framework, get_base_dir
from agentstack import conf
from agentstack import packaging


Expand Down Expand Up @@ -114,7 +115,15 @@ def check_for_updates(update_requested: bool = False):
if questionary.confirm(
f"New version of {AGENTSTACK_PACKAGE} available: {latest_version}! Do you want to install?"
).ask():
packaging.upgrade(f'{AGENTSTACK_PACKAGE}[{get_framework()}]')
try:
# handle update inside a user project
conf.assert_project()
packaging.upgrade(f'{AGENTSTACK_PACKAGE}[{get_framework()}]')
except conf.NoProjectError:
# handle update for system version of agentstack
packaging.set_python_executable(sys.executable)
packaging.upgrade(AGENTSTACK_PACKAGE, use_venv=False)

log.success(f"{AGENTSTACK_PACKAGE} updated. Re-run your command to use the latest version.")
else:
log.info("Skipping update. Run `agentstack update` to install the latest version.")
Expand Down
You are viewing a condensed version of this merge commit. You can view the full changes here.