2
0
mirror of https://github.com/frappe/bench.git synced 2025-01-22 22:58:31 +00:00

Merge pull request #915 from gavindsouza/bench-pip

feat: bench pip instead of using ./env/bin/pip
This commit is contained in:
gavin 2020-02-07 14:30:46 +05:30 committed by GitHub
commit 5a7580fcca
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 13 additions and 1 deletions

View File

@ -31,11 +31,12 @@ def bench_command(bench_path='.'):
setup_logging(bench_path=bench_path)
from bench.commands.make import init, get_app, new_app, remove_app
from bench.commands.make import init, get_app, new_app, remove_app, pip
bench_command.add_command(init)
bench_command.add_command(get_app)
bench_command.add_command(new_app)
bench_command.add_command(remove_app)
bench_command.add_command(pip)
from bench.commands.update import update, retry_upgrade, switch_to_branch, switch_to_master, switch_to_develop

View File

@ -93,3 +93,14 @@ def include_app_for_update(app_name):
"Include app from updating"
from bench.app import remove_from_excluded_apps_txt
remove_from_excluded_apps_txt(app_name)
@click.command('pip', context_settings={"ignore_unknown_options": True}, help="For pip help use `bench pip help [COMMAND]` or `bench pip [COMMAND] -h`")
@click.argument('args', nargs=-1)
@click.pass_context
def pip(ctx, args):
"Run pip commands in bench env"
import os
from bench.utils import get_env_cmd
env_pip = get_env_cmd('pip')
os.execv(env_pip, (env_pip,) + args)