diff --git a/bench/commands/__init__.py b/bench/commands/__init__.py index 4eedad79..e4ecb8c3 100755 --- a/bench/commands/__init__.py +++ b/bench/commands/__init__.py @@ -135,6 +135,9 @@ def migrate_env(python, no_backup = False): pvenv = pvenv ), cwd = path) + pip = osp.join(pvenv, 'bin', 'pip') + exec_cmd('{pip} install --upgrade pip'.format(pip=pip)) + exec_cmd('{pip} install --upgrade setuptools'.format(pip=pip)) # TODO: Options papps = osp.join(path, 'apps') @@ -143,7 +146,6 @@ def migrate_env(python, no_backup = False): for app in apps: papp = osp.join(papps, app) if osp.isdir(papp) and osp.exists(osp.join(papp, 'setup.py')): - pip = osp.join(pvenv, 'bin', 'pip') exec_cmd('{pip} install -e {app}'.format( pip = pip, app = papp )) diff --git a/bench/commands/make.py b/bench/commands/make.py index eb0c21ba..639868ed 100755 --- a/bench/commands/make.py +++ b/bench/commands/make.py @@ -2,7 +2,7 @@ import click @click.command() @click.argument('path') -@click.option('--python', type = str, default = 'python2', help = 'Path to Python Executable.') +@click.option('--python', type = str, default = 'python', help = 'Path to Python Executable.') @click.option('--ignore-exist', is_flag = True, default = False, help = "Ignore if Bench instance exists.") @click.option('--apps_path', default=None, help="path to json files with apps to install after init") @click.option('--frappe-path', default=None, help="path to frappe repo") @@ -16,7 +16,7 @@ import click def init(path, apps_path, frappe_path, frappe_branch, no_procfile, no_backups, no_auto_update, clone_from, verbose, skip_redis_config_generation, ignore_exist = False, - python = 'python2'): # Let's change we're ready. - + python = 'python'): # Let's change we're ready. - ''' Create a New Bench Instance. ''' diff --git a/bench/commands/setup.py b/bench/commands/setup.py index d2736553..053e6357 100755 --- a/bench/commands/setup.py +++ b/bench/commands/setup.py @@ -68,10 +68,11 @@ def setup_backups(): setup_backups() @click.command('env') -def setup_env(): +@click.option('--python', type = str, default = 'python', help = 'Path to Python Executable.') +def setup_env(python='python'): "Setup virtualenv for bench" from bench.utils import setup_env - setup_env() + setup_env(python=python) @click.command('firewall') @click.option('--ssh_port') diff --git a/bench/utils.py b/bench/utils.py index 1a2a2f80..aafa29cd 100755 --- a/bench/utils.py +++ b/bench/utils.py @@ -29,7 +29,7 @@ def init(path, apps_path=None, no_procfile=False, no_backups=False, no_auto_update=False, frappe_path=None, frappe_branch=None, wheel_cache_dir=None, verbose=False, clone_from=None, skip_redis_config_generation=False, ignore_exist = False, - python = 'python2'): # Let's change when we're ready. - + python = 'python'): # Let's change when we're ready. - from .app import get_app, install_apps_from_path from .config.common_site_config import make_config from .config import redis @@ -152,7 +152,7 @@ def which(executable, raise_err = False): return exec_ -def setup_env(bench_path='.', python = 'python2'): +def setup_env(bench_path='.', python = 'python'): python = which(python, raise_err = True) exec_cmd('virtualenv -q {} -p {}'.format('env', python), cwd=bench_path)