From 34197056ea7de6735ea0fd8fc63b18093b3f634b Mon Sep 17 00:00:00 2001 From: Himanshu Shivhare Date: Fri, 6 Jan 2023 15:18:47 +0530 Subject: [PATCH 1/7] chore: typo/readability fix (#1410) --- README.md | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) diff --git a/README.md b/README.md index 5e4edcdd..a5b9db56 100755 --- a/README.md +++ b/README.md @@ -107,14 +107,12 @@ usage: easy-install.py [-h] [-p] [-d] [-s SITENAME] [-n PROJECT] [--email EMAIL] Install Frappe with Docker options: - -h, --help show this help message and exit - -p, --prod Setup Production System - -d, --dev Setup Development System - -s SITENAME, --sitename SITENAME - The Site Name for your production site - -n PROJECT, --project PROJECT - Project Name - --email EMAIL Add email for the SSL. + -h, --help show this help message and exit + -p, --prod Setup Production System + -d, --dev Setup Development System + -s SITENAME, --sitename SITENAME The Site Name for your production site + -n PROJECT, --project PROJECT Project Name + --email EMAIL Add email for the SSL. ``` #### Troubleshooting From b3ad10b9e63ad2e966cdc89bc65f2a79be08cc7e Mon Sep 17 00:00:00 2001 From: Revant Nandgaonkar Date: Mon, 16 Jan 2023 16:24:56 +0530 Subject: [PATCH 2/7] ci: fix easy-install.py test (#1408) * ci: fix easy-install.py test related to https://github.com/frappe/frappe_docker/pull/1032 * ci: fix easy-install.py patched bench removed and frappe-bench installed --no-mariadb-socket required for new-site * fix: remove frappe version from .env * feat(easy-install): option to set version Co-authored-by: Ankush Menat --- easy-install.py | 25 ++++++++++++++++--------- 1 file changed, 16 insertions(+), 9 deletions(-) diff --git a/easy-install.py b/easy-install.py index 26d5ab72..33bd56a5 100755 --- a/easy-install.py +++ b/easy-install.py @@ -71,14 +71,21 @@ def get_from_env(dir, file) -> Dict: return env_vars -def write_to_env(wd: str, site: str, db_pass: str, admin_pass: str, email: str) -> None: +def write_to_env( + wd: str, + site: str, + db_pass: str, + admin_pass: str, + email: str, + erpnext_version: str = None, +) -> None: site_name = site or "" example_env = get_from_env(wd, "example.env") + erpnext_version = erpnext_version or example_env['ERPNEXT_VERSION'] with open(os.path.join(wd, ".env"), "w") as f: f.writelines( [ - f"FRAPPE_VERSION={example_env['FRAPPE_VERSION']}\n", # Defaults to latest version of Frappe - f"ERPNEXT_VERSION={example_env['ERPNEXT_VERSION']}\n", # defaults to latest version of ERPNext + f"ERPNEXT_VERSION={erpnext_version}\n", # defaults to latest version of ERPNext f"DB_PASSWORD={db_pass}\n", "DB_HOST=db\n", "DB_PORT=3306\n", @@ -107,7 +114,7 @@ def check_repo_exists() -> bool: return os.path.exists(os.path.join(os.getcwd(), "frappe_docker")) -def setup_prod(project: str, sitename: str, email: str) -> None: +def setup_prod(project: str, sitename: str, email: str, version: str = None) -> None: if check_repo_exists(): compose_file_name = os.path.join(os.path.expanduser("~"), f"{project}-compose.yml") docker_repo_path = os.path.join(os.getcwd(), "frappe_docker") @@ -122,7 +129,7 @@ def setup_prod(project: str, sitename: str, email: str) -> None: if not os.path.exists(os.path.join(docker_repo_path, ".env")): admin_pass = generate_pass() db_pass = generate_pass(9) - write_to_env(docker_repo_path, sitename, db_pass, admin_pass, email) + write_to_env(docker_repo_path, sitename, db_pass, admin_pass, email, version) cprint( "\nA .env file is generated with basic configs. Please edit it to fit to your needs \n", level=3, @@ -150,8 +157,6 @@ def setup_prod(project: str, sitename: str, email: str) -> None: "overrides/compose.redis.yaml", # "-f", "overrides/compose.noproxy.yaml", TODO: Add support for local proxying without HTTPs "-f", - "overrides/compose.erpnext.yaml", - "-f", "overrides/compose.https.yaml", "--env-file", ".env", @@ -202,6 +207,7 @@ def setup_prod(project: str, sitename: str, email: str) -> None: "bench", "new-site", sitename, + "--no-mariadb-socket", "--db-root-password", db_pass, "--admin-password", @@ -220,7 +226,7 @@ def setup_prod(project: str, sitename: str, email: str) -> None: else: install_docker() clone_frappe_docker_repo() - setup_prod(project, sitename, email) # Recursive + setup_prod(project, sitename, email, version) # Recursive def setup_dev_instance(project: str): @@ -306,6 +312,7 @@ if __name__ == "__main__": parser.add_argument( "--email", help="Add email for the SSL.", required="--prod" in sys.argv ) + parser.add_argument("-v", "--version", help="ERPNext version to install, defaults to latest stable") args = parser.parse_args() if args.dev: cprint("\nSetting Up Development Instance\n", level=2) @@ -317,6 +324,6 @@ if __name__ == "__main__": if "example.com" in args.email: cprint("Emails with example.com not acceptable", level=1) sys.exit(1) - setup_prod(args.project, args.sitename, args.email) + setup_prod(args.project, args.sitename, args.email, args.version) else: parser.print_help() From e58a56e2473b9b72ac3f6cb77db2fc19831b2238 Mon Sep 17 00:00:00 2001 From: trs998 Date: Fri, 20 Jan 2023 17:37:38 +0000 Subject: [PATCH 3/7] docs: Added --email argument to install script (#1417) The install script requires the --email parameter, so added to example command line --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index a5b9db56..e523672c 100755 --- a/README.md +++ b/README.md @@ -87,7 +87,7 @@ Download the Easy Install script and execute it: ```sh $ wget https://raw.githubusercontent.com/frappe/bench/develop/easy-install.py -$ python3 easy-install.py --prod +$ python3 easy-install.py --prod --email your@email.tld ``` This script will install docker on your system and will fetch the required containers, setup bench and a default ERPNext instance. From db165d1f9b0b10ca39f39d407737bd4f515d7d83 Mon Sep 17 00:00:00 2001 From: Gavin D'souza Date: Tue, 24 Jan 2023 15:21:24 +0530 Subject: [PATCH 4/7] fix: Setup chdir patch earlier Setup monkey patching before any other bench code decides to chdir --- bench/cli.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bench/cli.py b/bench/cli.py index 140ea662..7f262407 100755 --- a/bench/cli.py +++ b/bench/cli.py @@ -60,6 +60,7 @@ def execute_cmd(check_for_update=True, command: str = None, logger: Logger = Non def cli(): + setup_clear_cache() global from_command_line, bench_config, is_envvar_warn_set, verbose from_command_line = True @@ -75,7 +76,6 @@ def cli(): change_working_directory() logger = setup_logging() logger.info(command) - setup_clear_cache() bench_config = get_config(".") From 3f9360bc42ceacadced5b8e0d94be71383701090 Mon Sep 17 00:00:00 2001 From: Gavin D'souza Date: Tue, 24 Jan 2023 15:26:11 +0530 Subject: [PATCH 5/7] chore: Drop dead deepsource conf --- .deepsource.toml | 16 ---------------- 1 file changed, 16 deletions(-) delete mode 100644 .deepsource.toml diff --git a/.deepsource.toml b/.deepsource.toml deleted file mode 100644 index 90b9b9bb..00000000 --- a/.deepsource.toml +++ /dev/null @@ -1,16 +0,0 @@ -version = 1 - -exclude_patterns = [ - ".*" -] - -test_patterns = [ - "bench/tests/**" -] - -[[analyzers]] -name = "python" -enabled = true -dependency_file_paths = [ - "requirements.txt" -] \ No newline at end of file From 044d646ec5b64acf95133d56cd255c642159750c Mon Sep 17 00:00:00 2001 From: Gavin D'souza Date: Tue, 24 Jan 2023 15:26:32 +0530 Subject: [PATCH 6/7] style: Pre-commit linters --- easy-install.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/easy-install.py b/easy-install.py index 33bd56a5..e81fb318 100755 --- a/easy-install.py +++ b/easy-install.py @@ -81,7 +81,7 @@ def write_to_env( ) -> None: site_name = site or "" example_env = get_from_env(wd, "example.env") - erpnext_version = erpnext_version or example_env['ERPNEXT_VERSION'] + erpnext_version = erpnext_version or example_env["ERPNEXT_VERSION"] with open(os.path.join(wd, ".env"), "w") as f: f.writelines( [ @@ -312,7 +312,9 @@ if __name__ == "__main__": parser.add_argument( "--email", help="Add email for the SSL.", required="--prod" in sys.argv ) - parser.add_argument("-v", "--version", help="ERPNext version to install, defaults to latest stable") + parser.add_argument( + "-v", "--version", help="ERPNext version to install, defaults to latest stable" + ) args = parser.parse_args() if args.dev: cprint("\nSetting Up Development Instance\n", level=2) From dd77fd87fde8f303e006ad0c57986a12325ccb88 Mon Sep 17 00:00:00 2001 From: gavin Date: Mon, 30 Jan 2023 16:44:29 +0530 Subject: [PATCH 7/7] build: Bump GitPython 2.1.x => 3.1.x (#1423) --- pyproject.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pyproject.toml b/pyproject.toml index 2d535b1d..d1011ff1 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -20,7 +20,7 @@ classifiers = [ ] dependencies = [ "Click>=7.0", - "GitPython~=2.1.15", + "GitPython~=3.1.30", "honcho", "Jinja2~=3.0.3", "python-crontab~=2.6.0",