You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
swarms/swarms/telemetry/auto_upgrade_swarms.py

21 lines
522 B

import subprocess
from loguru import logger
from swarms.telemetry.check_update import check_for_update
def auto_update():
"""auto update swarms"""
try:
outcome = check_for_update()
if outcome is True:
logger.info(
"There is a new version of swarms available! Downloading..."
)
subprocess.run(["pip", "install", "-U", "swarms"])
else:
logger.info("swarms is up to date!")
except Exception as e:
logger.error(e)