mirror of
https://github.com/frappe/bench.git
synced 2024-11-12 08:16:28 +00:00
Merge branch 'develop' into referrer-policy
This commit is contained in:
commit
0b707b1d82
31
README.md
31
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).
|
||||
|
@ -1,4 +1,4 @@
|
||||
VERSION = "5.1.0"
|
||||
VERSION = "5.2.1"
|
||||
PROJECT_NAME = "frappe-bench"
|
||||
FRAPPE_VERSION = None
|
||||
|
||||
|
@ -18,6 +18,7 @@ from bench.utils import PatchError, bench_cache_file, check_latest_version, drop
|
||||
|
||||
from_command_line = False
|
||||
change_uid_msg = "You should not run this command as root"
|
||||
src = os.path.dirname(__file__)
|
||||
|
||||
|
||||
def cli():
|
||||
@ -72,7 +73,7 @@ def check_uid():
|
||||
|
||||
|
||||
def cmd_requires_root():
|
||||
if len(sys.argv) > 2 and sys.argv[2] in ('production', 'sudoers', 'supervisor', 'lets-encrypt', 'fonts',
|
||||
if len(sys.argv) > 2 and sys.argv[2] in ('production', 'sudoers', 'lets-encrypt', 'fonts',
|
||||
'print', 'firewall', 'ssh-port', 'role', 'fail2ban', 'wildcard-ssl'):
|
||||
return True
|
||||
if len(sys.argv) >= 2 and sys.argv[1] in ('patch', 'renew-lets-encrypt', 'disable-production'):
|
||||
|
@ -164,8 +164,8 @@ def disable_production():
|
||||
|
||||
@click.command('src', help="Prints bench source folder path, which can be used as: cd `bench src`")
|
||||
def bench_src():
|
||||
import bench
|
||||
print(os.path.dirname(bench.__path__[0]))
|
||||
from bench.cli import src
|
||||
print(os.path.dirname(src))
|
||||
|
||||
|
||||
@click.command('find', help="Finds benches recursively from location")
|
||||
|
@ -269,7 +269,7 @@ def install_bench(args):
|
||||
|
||||
def clone_bench_repo(args):
|
||||
'''Clones the bench repository in the user folder'''
|
||||
branch = args.bench_branch or 'master'
|
||||
branch = args.bench_branch or 'develop'
|
||||
repo_url = args.repo_url or 'https://github.com/frappe/bench'
|
||||
|
||||
if os.path.exists(tmp_bench_repo):
|
||||
@ -464,11 +464,11 @@ if __name__ == '__main__':
|
||||
with warnings.catch_warnings():
|
||||
warnings.simplefilter("ignore")
|
||||
setup_log_stream(args)
|
||||
install_prerequisites()
|
||||
setup_script_requirements()
|
||||
check_distribution_compatibility()
|
||||
check_system_package_managers()
|
||||
check_environment()
|
||||
install_prerequisites()
|
||||
install_bench(args)
|
||||
|
||||
log("Bench + Frappe + ERPNext has been successfully installed!")
|
||||
|
@ -5,6 +5,6 @@ Jinja2==2.10.3
|
||||
python-crontab==2.4.0
|
||||
requests==2.22.0
|
||||
semantic-version==2.8.2
|
||||
setuptools==40.8.0
|
||||
six==1.12.0
|
||||
virtualenv==16.6.0
|
||||
setuptools
|
||||
six
|
||||
virtualenv
|
||||
|
Loading…
Reference in New Issue
Block a user