From d5aebc0569018112f98e94bc45c3ba92c41fd4c5 Mon Sep 17 00:00:00 2001 From: Gavin D'souza Date: Mon, 31 Aug 2020 14:11:29 +0530 Subject: [PATCH] docs: Add development on bench README --- README.md | 31 +++++++++++++++++++++++++++++++ 1 file changed, 31 insertions(+) diff --git a/README.md b/README.md index 8bdc2af4..abbbb7f4 100755 --- a/README.md +++ b/README.md @@ -18,6 +18,7 @@ Bench is a command-line utility that helps you to install, update, and manage mu - [Bench Manager](#bench-manager) - [Guides](#guides) - [Resources](#resources) + - [Development](#development) - [License](#license) @@ -254,6 +255,36 @@ For an exhaustive list of guides, check out [Bench Guides](https://frappe.io/doc For an exhaustive list of resources, check out [Bench Resources](https://frappe.io/docs/user/en/bench/resources). +## Development + +To contribute and develop on the bench CLI tool, clone this repo and create an editable install. In editable mode, you may get the following warning everytime you run a bench command: + + WARN: bench is installed in editable mode! + + This is not the recommended mode of installation for production. Instead, install the package from PyPI with: `pip install frappe-bench` + + +```sh +$ git clone https://github.com/frappe/bench ~/bench-repo +$ pip3 install -e ~/bench-repo +$ bench src +/Users/frappe/bench-repo +``` + +To clear up the editable install and switch to a stable version of bench, uninstall via pip and delete the corresponding egg file from the python path. + + +```sh +# Delete bench installed in editable install +$ rm -r $(find ~ -name '*.egg-info') +$ pip3 uninstall frappe-bench + +# Install latest released version of bench +$ pip3 install -U frappe-bench +``` + +To confirm the switch, check the output of `bench src`. It should change from something like `$HOME/bench-repo` to `/usr/local/lib/python3.6/dist-packages` and stop the editable install warnings from getting triggered at every command. + ## License This repository has been released under the [GNU GPLv3 License](LICENSE).