mirror of
https://github.com/frappe/bench.git
synced 2025-01-24 23:48:24 +00:00
Merge pull request #563 from rmehta/install-frappe-first
[py3] install frappe first
This commit is contained in:
commit
2dc796ba87
@ -26,7 +26,6 @@ def print_bench_version(ctx, param, value):
|
|||||||
def bench_command(bench_path='.'):
|
def bench_command(bench_path='.'):
|
||||||
"""Bench manager for Frappe"""
|
"""Bench manager for Frappe"""
|
||||||
import bench
|
import bench
|
||||||
from bench.app import get_current_frappe_version
|
|
||||||
from bench.utils import setup_logging
|
from bench.utils import setup_logging
|
||||||
|
|
||||||
bench.set_frappe_version(bench_path=bench_path)
|
bench.set_frappe_version(bench_path=bench_path)
|
||||||
@ -117,7 +116,7 @@ def migrate_env(python, no_backup = False):
|
|||||||
try:
|
try:
|
||||||
with tempdir() as dirpath:
|
with tempdir() as dirpath:
|
||||||
virtualenv = which('virtualenv')
|
virtualenv = which('virtualenv')
|
||||||
|
|
||||||
nvenv = 'env'
|
nvenv = 'env'
|
||||||
pvenv = osp.join(dirpath, nvenv)
|
pvenv = osp.join(dirpath, nvenv)
|
||||||
|
|
||||||
@ -129,9 +128,12 @@ def migrate_env(python, no_backup = False):
|
|||||||
|
|
||||||
# TODO: Options
|
# TODO: Options
|
||||||
|
|
||||||
papps = osp.join(path, 'apps')
|
apps_path = osp.join(path, 'apps')
|
||||||
for app in os.listdir(papps):
|
apps = os.listdir(apps_path)
|
||||||
papp = osp.join(papps, app)
|
apps = ['frappe'] + [app for app in apps if app!='frappe']
|
||||||
|
|
||||||
|
for app in apps:
|
||||||
|
papp = osp.join(apps_path, app)
|
||||||
if osp.isdir(papp) and osp.exists(osp.join(papp, 'setup.py')):
|
if osp.isdir(papp) and osp.exists(osp.join(papp, 'setup.py')):
|
||||||
pip = osp.join(pvenv, 'bin', 'pip')
|
pip = osp.join(pvenv, 'bin', 'pip')
|
||||||
exec_cmd('{pip} install -e {app}'.format(
|
exec_cmd('{pip} install -e {app}'.format(
|
||||||
@ -144,7 +146,7 @@ def migrate_env(python, no_backup = False):
|
|||||||
parch = osp.join(path, 'archived_envs')
|
parch = osp.join(path, 'archived_envs')
|
||||||
if not osp.exists(parch):
|
if not osp.exists(parch):
|
||||||
os.mkdir(parch)
|
os.mkdir(parch)
|
||||||
|
|
||||||
# Simply moving. Thanks, Ameya.
|
# Simply moving. Thanks, Ameya.
|
||||||
# I'm keen to zip.
|
# I'm keen to zip.
|
||||||
source = osp.join(path, 'env')
|
source = osp.join(path, 'env')
|
||||||
@ -153,10 +155,10 @@ def migrate_env(python, no_backup = False):
|
|||||||
log.debug('Backing up Virtual Environment')
|
log.debug('Backing up Virtual Environment')
|
||||||
stamp = datetime.now().strftime('%Y%m%d_%H%M%S')
|
stamp = datetime.now().strftime('%Y%m%d_%H%M%S')
|
||||||
dest = osp.join(path, str(stamp))
|
dest = osp.join(path, str(stamp))
|
||||||
|
|
||||||
os.rename(source, dest)
|
os.rename(source, dest)
|
||||||
shutil.move(dest, target)
|
shutil.move(dest, target)
|
||||||
|
|
||||||
log.debug('Setting up a New Virtual {python} Environment'.format(
|
log.debug('Setting up a New Virtual {python} Environment'.format(
|
||||||
python = python
|
python = python
|
||||||
))
|
))
|
||||||
@ -164,7 +166,7 @@ def migrate_env(python, no_backup = False):
|
|||||||
target = path
|
target = path
|
||||||
|
|
||||||
shutil.move(source, target)
|
shutil.move(source, target)
|
||||||
|
|
||||||
log.debug('Migration Successful to {python}'.format(
|
log.debug('Migration Successful to {python}'.format(
|
||||||
python = python
|
python = python
|
||||||
))
|
))
|
||||||
|
Loading…
x
Reference in New Issue
Block a user