2
0
mirror of https://github.com/frappe/bench.git synced 2025-01-10 09:02:10 +00:00

fix: install one app at a time, frappe first

This commit is contained in:
Ankush Menat 2022-11-29 12:33:53 +05:30
parent 61e0f4acbf
commit 4f0193ca93

View File

@ -212,18 +212,23 @@ def migrate_env(python, backup=False):
shutil.move(dest, target)
# Create virtualenv using specified python
venv_creation, packages_setup = 1, 1
def _install_app(app):
app_path = f"-e {os.path.join('apps', app)}"
exec_cmd(f"{pvenv}/bin/python -m pip install --upgrade {app_path}")
try:
logger.log(f"Setting up a New Virtual {python} Environment")
venv_creation = exec_cmd(f"{virtualenv} --python {python} {pvenv}")
exec_cmd(f"{virtualenv} --python {python} {pvenv}")
apps = " ".join([f"-e {os.path.join('apps', app)}" for app in bench.apps])
packages_setup = exec_cmd(f"{pvenv}/bin/python -m pip install --upgrade {apps}")
# Install frappe first
_install_app("frappe")
for app in bench.apps:
if str(app) != "frappe":
_install_app(app)
logger.log(f"Migration Successful to {python}")
except Exception:
if venv_creation or packages_setup:
logger.warning("Migration Error", exc_info=True)
logger.warning("Python env migration Error", exc_info=True)
raise