From 3b0bcb7616f8a97e788758cde4ac46c3a1360ee0 Mon Sep 17 00:00:00 2001 From: Gavin D'souza Date: Wed, 5 Jan 2022 16:04:20 +0530 Subject: [PATCH 1/4] fix: Update Click requirement --- requirements.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/requirements.txt b/requirements.txt index e84b98c0..b9cc45c9 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,4 +1,4 @@ -Click +Click>=7.0 GitPython~=2.1.15 honcho Jinja2~=2.11.3 From 5b1b84bc5f8938f48d4bc2c25e64b55c10ac0660 Mon Sep 17 00:00:00 2001 From: saxenabhishek Date: Mon, 31 Jan 2022 19:14:16 +0530 Subject: [PATCH 2/4] fix: use frappe13 in py 3.7 --- bench/tests/test_base.py | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/bench/tests/test_base.py b/bench/tests/test_base.py index 75b1646c..4c5b6889 100644 --- a/bench/tests/test_base.py +++ b/bench/tests/test_base.py @@ -14,10 +14,14 @@ from bench.utils import paths_in_bench, exec_cmd from bench.utils.system import init from bench.bench import Bench -if sys.version_info.major == 2: - FRAPPE_BRANCH = "version-12" -else: - FRAPPE_BRANCH = "develop" +PYTHON_VER = sys.version_info + +FRAPPE_BRANCH = "version-12" +if PYTHON_VER.major == 3: + if PYTHON_VER.minor in [6, 7]: + FRAPPE_BRANCH = "version-13" + else: + FRAPPE_BRANCH = "develop" class TestBenchBase(unittest.TestCase): def setUp(self): From c66283dd08e7162fafbe99be8a331e405b6fe679 Mon Sep 17 00:00:00 2001 From: saxenabhishek Date: Sat, 5 Feb 2022 01:49:11 +0530 Subject: [PATCH 3/4] test: `test_switch_to_branch()` which is lower --- bench/tests/test_init.py | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/bench/tests/test_init.py b/bench/tests/test_init.py index 331de422..52c23282 100755 --- a/bench/tests/test_init.py +++ b/bench/tests/test_init.py @@ -151,15 +151,21 @@ class TestBenchInit(TestBenchBase): bench_path = os.path.join(self.benches_path, "test-bench") app_path = os.path.join(bench_path, "apps", "frappe") - successful_switch = not exec_cmd("bench switch-to-branch version-13 frappe --upgrade", cwd=bench_path) + # * chore: change to 14 when avalible + prevoius_branch = "version-13" + if FRAPPE_BRANCH != "develop": + # assuming we follow `version-#` + prevoius_branch = f"version-{int(FRAPPE_BRANCH.split('-')[1]) - 1}" + + successful_switch = not exec_cmd(f"bench switch-to-branch {prevoius_branch} frappe --upgrade", cwd=bench_path) app_branch_after_switch = str(git.Repo(path=app_path).active_branch) if successful_switch: - self.assertEqual("version-13", app_branch_after_switch) + self.assertEqual(prevoius_branch, app_branch_after_switch) - successful_switch = not exec_cmd("bench switch-to-branch develop frappe --upgrade", cwd=bench_path) + successful_switch = not exec_cmd(f"bench switch-to-branch {FRAPPE_BRANCH} frappe --upgrade", cwd=bench_path) app_branch_after_second_switch = str(git.Repo(path=app_path).active_branch) if successful_switch: - self.assertEqual("develop", app_branch_after_second_switch) + self.assertEqual(FRAPPE_BRANCH, app_branch_after_second_switch) if __name__ == '__main__': From d7ad7fd780db99e4e0106d8411b3ee81562f1107 Mon Sep 17 00:00:00 2001 From: Ankush Menat Date: Fri, 18 Feb 2022 11:26:02 +0530 Subject: [PATCH 4/4] chore: bump jinja https://jinja.palletsprojects.com/en/3.0.x/changes/ --- requirements.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/requirements.txt b/requirements.txt index b9cc45c9..68e7c7d3 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,7 +1,7 @@ Click>=7.0 GitPython~=2.1.15 honcho -Jinja2~=2.11.3 +Jinja2~=3.0.3 python-crontab~=2.4.0 requests semantic-version~=2.8.2