From f0596c5928746d45984ee50dbc527d591803e9b1 Mon Sep 17 00:00:00 2001 From: Gavin D'souza Date: Thu, 6 Feb 2020 15:03:29 +0530 Subject: [PATCH 1/2] feat: bench pip * Directly install/update/remove packages from your env using bench pip commands. Pretty much just like using pip To check help don't add the --help flag, use the -h flag instead, use the pip help command. For example, checking help for pip install can be done by bench pip help install bench pip install -h --- bench/commands/__init__.py | 3 ++- bench/commands/make.py | 11 +++++++++++ 2 files changed, 13 insertions(+), 1 deletion(-) diff --git a/bench/commands/__init__.py b/bench/commands/__init__.py index 4572a42b..65757f6a 100755 --- a/bench/commands/__init__.py +++ b/bench/commands/__init__.py @@ -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 diff --git a/bench/commands/make.py b/bench/commands/make.py index a3bbd2e4..b9b01b3e 100755 --- a/bench/commands/make.py +++ b/bench/commands/make.py @@ -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) From e3bfe3a82dc2b50a4ace33839568f6c101043b96 Mon Sep 17 00:00:00 2001 From: Wing Yung Chan Date: Fri, 7 Feb 2020 21:37:13 +0000 Subject: [PATCH 2/2] docs: fixes in easy_install.md (#917) Fixed two minor typos --- docs/easy_install.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/docs/easy_install.md b/docs/easy_install.md index 958bd908..8caa7a30 100644 --- a/docs/easy_install.md +++ b/docs/easy_install.md @@ -1,7 +1,7 @@ # Easy Install Script - This script will install the pre-requisites, install bench and setup an ERPNext site `(site1.local under frappe-bench)` -- Passwords for Frappe Administrator and MariaDB (root) will be asked and saved under `~/passwoords.txt` +- Passwords for Frappe Administrator and MariaDB (root) will be asked and saved under `~/passwords.txt` - MariaDB (root) password may be `password` on a fresh server - You can then login as **Administrator** with the Administrator password - The log file is saved under `/tmp/logs/install_bench.log` in case you run into any issues during the install. @@ -45,7 +45,7 @@ Switch to `[frappe-user]` (using `su [frappe-user]`) and start the setup *Note: `user` flag to create a user and install using that user (By default, the script will create a user with the username `frappe` if the --user flag is not used)* -For production or development, append teh `--production` or `--develop` flag to the command respectively. +For production or development, append the `--production` or `--develop` flag to the command respectively. sudo python3 install.py --production --user [frappe-user] @@ -88,4 +88,4 @@ TLDR; Save the logs! 3. A lot of things can go wrong in setting up the environment due to prior settings, company protocols or even breaking changes in system packages and their dependencies. -4. Sharing your logfile in any issues opened related to this can help us find solutions to it faster and make the sript better! \ No newline at end of file +4. Sharing your logfile in any issues opened related to this can help us find solutions to it faster and make the sript better!