From b658b903080ad1a91669e576a8b7cbce1d58a4ab Mon Sep 17 00:00:00 2001 From: rafie Date: Tue, 24 Aug 2021 20:44:32 +0300 Subject: [PATCH 01/10] Experimental vesion of getrmpytools --- bin/getrmpytools | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/bin/getrmpytools b/bin/getrmpytools index e415962..b680b11 100755 --- a/bin/getrmpytools +++ b/bin/getrmpytools @@ -62,8 +62,8 @@ class RMPyToolsSetup(paella.Setup): # redis-py-cluster should be installed from git due to redis-py dependency # self.pip_install("--no-cache-dir git+https://github.com/Grokzen/redis-py-cluster.git@master") self.pip_install("--no-cache-dir --ignore-installed git+https://github.com/redisfab/redis-py.git@3.5") - self.pip_install("--no-cache-dir --ignore-installed redis-py-cluster") - self.pip_install("--no-cache-dir --ignore-installed git+https://github.com/RedisLabsModules/RLTest.git@master") + self.pip_install("--no-cache-dir --ignore-installed git+https://github.com/redisfab/redis-py-cluster@rafi-conn-args1") + self.pip_install("--no-cache-dir --ignore-installed git+https://github.com/RedisLabsModules/RLTest.git@rafi-redispy2") self.pip_install("--no-cache-dir --ignore-installed git+https://github.com/RedisLabs/RAMP@master") #---------------------------------------------------------------------------------------------- From 38ef2c598a2a2fe381ddf68c837bab730319a5c1 Mon Sep 17 00:00:00 2001 From: rafie Date: Thu, 26 Aug 2021 14:32:47 +0300 Subject: [PATCH 02/10] getrmpytools: reinstalling the hard way --- bin/getrmpytools | 46 ++++++++++++++++++++++++++++++++++++++++++++-- 1 file changed, 44 insertions(+), 2 deletions(-) diff --git a/bin/getrmpytools b/bin/getrmpytools index e415962..f58caad 100755 --- a/bin/getrmpytools +++ b/bin/getrmpytools @@ -58,7 +58,11 @@ class RMPyToolsSetup(paella.Setup): def common_last(self): self.install("git") if self.reinstall: - self.pip_uninstall("redis redis-py-cluster ramp-packer RLTest") + self.uninstall("redis") + self.uninstall("redis-py-cluster", ["rediscluster", "redis_py_cluster"]) + self.uninstall("ramp-packer", ["RAMP", "ramp_packer"]) + self.uninstall("RLTest", ["RLTest"]) + self.uninstall("click", ["Click"]) # redis-py-cluster should be installed from git due to redis-py dependency # self.pip_install("--no-cache-dir git+https://github.com/Grokzen/redis-py-cluster.git@master") self.pip_install("--no-cache-dir --ignore-installed git+https://github.com/redisfab/redis-py.git@3.5") @@ -66,12 +70,50 @@ class RMPyToolsSetup(paella.Setup): self.pip_install("--no-cache-dir --ignore-installed git+https://github.com/RedisLabsModules/RLTest.git@master") self.pip_install("--no-cache-dir --ignore-installed git+https://github.com/RedisLabs/RAMP@master") + def uninstall(self, package, pack_dirs=[]): + # self.pip_uninstall(package) # this does not damage than good + if package not in pack_dirs: + pack_dirs += [package] + base_dirs = sh("{PYTHON} -m pip list -v | grep '^{PACK}\s' | awk '{{print $3}}'".format(PYTHON=self.python, PACK=package)).strip() + n_base_dirs = len(base_dirs.split()) + if n_base_dirs == 0: + return + if n_base_dirs > 1: + eprint("cannot determine base python installation dir for '{}'".format(package)) + return + base_dir = base_dirs + pack_re_suffixes = ['', + r'\.dist-info', + r'-\d+\.\d+\.\d+', + r'-\d+\.\d+\.\d+\.dist-info', + r'-\d+\.\d+\.\d+\.post\d+', + r'-\d+\.\d+\.\d+\.post\d+\.dist-info', + r'-\d+\.\d+\.\d+\.post\d+', + r'-\d+\.\d+\.\d+\.dev\d+\.dist-info'] + with paella.cwd(base_dir): + print("cd {}".format(base_dir)) + rm_d = [] + for pack_dir in pack_dirs: + try: + dirs = sh("ls -d {DIR}*".format(DIR=pack_dir)) + for d in dirs.split(): + for re_suff in pack_re_suffixes: + re1 = r'^{PACK}{SUFF}$'.format(PACK=pack_dir, SUFF=re_suff) + if paella.match(re1, d): + rm_d += [d] + break + except: + pass + if rm_d != []: + self.run("rm -rf {DIR}".format(DIR=' '.join(rm_d))) + print("cd -") + #---------------------------------------------------------------------------------------------- parser = argparse.ArgumentParser(description='Install RedisLabs Modules Python tools') parser.add_argument('-n', '--nop', action="store_true", help='no operation') parser.add_argument('--no-reinstall', action="store_true", default=False, help='Not not reinstall everything') -parser.add_argument('--reinstall', action="store_true", default=True, help='Reinstall everything (the default behavior)') +parser.add_argument('--reinstall', action="store_true", default=False, help='Reinstall everything (the default behavior)') args = parser.parse_args() try: From 29a4ac0645484719678c83a55e7a139d5e3a6cbe Mon Sep 17 00:00:00 2001 From: rafie Date: Thu, 26 Aug 2021 14:38:18 +0300 Subject: [PATCH 03/10] fixes 1 --- bin/getrmpytools | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/bin/getrmpytools b/bin/getrmpytools index 489b33a..f58caad 100755 --- a/bin/getrmpytools +++ b/bin/getrmpytools @@ -66,8 +66,8 @@ class RMPyToolsSetup(paella.Setup): # redis-py-cluster should be installed from git due to redis-py dependency # self.pip_install("--no-cache-dir git+https://github.com/Grokzen/redis-py-cluster.git@master") self.pip_install("--no-cache-dir --ignore-installed git+https://github.com/redisfab/redis-py.git@3.5") - self.pip_install("--no-cache-dir --ignore-installed git+https://github.com/redisfab/redis-py-cluster@rafi-conn-args1") - self.pip_install("--no-cache-dir --ignore-installed git+https://github.com/RedisLabsModules/RLTest.git@rafi-redispy2") + self.pip_install("--no-cache-dir --ignore-installed redis-py-cluster") + self.pip_install("--no-cache-dir --ignore-installed git+https://github.com/RedisLabsModules/RLTest.git@master") self.pip_install("--no-cache-dir --ignore-installed git+https://github.com/RedisLabs/RAMP@master") def uninstall(self, package, pack_dirs=[]): From fe349cda95cbe43bd9807ac35f10dc38e30ec43d Mon Sep 17 00:00:00 2001 From: rafie Date: Thu, 26 Aug 2021 14:41:38 +0300 Subject: [PATCH 04/10] fixes 2 --- bin/getrmpytools | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bin/getrmpytools b/bin/getrmpytools index f58caad..d16e353 100755 --- a/bin/getrmpytools +++ b/bin/getrmpytools @@ -71,7 +71,7 @@ class RMPyToolsSetup(paella.Setup): self.pip_install("--no-cache-dir --ignore-installed git+https://github.com/RedisLabs/RAMP@master") def uninstall(self, package, pack_dirs=[]): - # self.pip_uninstall(package) # this does not damage than good + # self.pip_uninstall(package) # this does more damage than good if package not in pack_dirs: pack_dirs += [package] base_dirs = sh("{PYTHON} -m pip list -v | grep '^{PACK}\s' | awk '{{print $3}}'".format(PYTHON=self.python, PACK=package)).strip() From 8899d8ad157d553ebed378bfe40e04c0b61daceb Mon Sep 17 00:00:00 2001 From: rafie Date: Thu, 26 Aug 2021 14:42:54 +0300 Subject: [PATCH 05/10] fixes 3 --- bin/getrmpytools | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bin/getrmpytools b/bin/getrmpytools index d16e353..1879499 100755 --- a/bin/getrmpytools +++ b/bin/getrmpytools @@ -98,7 +98,7 @@ class RMPyToolsSetup(paella.Setup): dirs = sh("ls -d {DIR}*".format(DIR=pack_dir)) for d in dirs.split(): for re_suff in pack_re_suffixes: - re1 = r'^{PACK}{SUFF}$'.format(PACK=pack_dir, SUFF=re_suff) + re1 = r'^{DIR}{SUFF}$'.format(DIR=pack_dir, SUFF=re_suff) if paella.match(re1, d): rm_d += [d] break From a0fdbdc92c23d39824d15c17831df2dcb675dfcc Mon Sep 17 00:00:00 2001 From: rafie Date: Mon, 30 Aug 2021 19:26:30 +0300 Subject: [PATCH 06/10] fixes 1 --- bin/getrmpytools | 46 ++++++++++++++++++++++++++++++++++++++++++++-- 1 file changed, 44 insertions(+), 2 deletions(-) diff --git a/bin/getrmpytools b/bin/getrmpytools index b680b11..1633c5d 100755 --- a/bin/getrmpytools +++ b/bin/getrmpytools @@ -58,7 +58,11 @@ class RMPyToolsSetup(paella.Setup): def common_last(self): self.install("git") if self.reinstall: - self.pip_uninstall("redis redis-py-cluster ramp-packer RLTest") + self.uninstall("redis") + self.uninstall("redis-py-cluster", ["rediscluster", "redis_py_cluster"]) + self.uninstall("ramp-packer", ["RAMP", "ramp_packer"]) + self.uninstall("RLTest", ["RLTest"]) + self.uninstall("click", ["Click"]) # redis-py-cluster should be installed from git due to redis-py dependency # self.pip_install("--no-cache-dir git+https://github.com/Grokzen/redis-py-cluster.git@master") self.pip_install("--no-cache-dir --ignore-installed git+https://github.com/redisfab/redis-py.git@3.5") @@ -66,12 +70,50 @@ class RMPyToolsSetup(paella.Setup): self.pip_install("--no-cache-dir --ignore-installed git+https://github.com/RedisLabsModules/RLTest.git@rafi-redispy2") self.pip_install("--no-cache-dir --ignore-installed git+https://github.com/RedisLabs/RAMP@master") + def uninstall(self, package, pack_dirs=[]): + # self.pip_uninstall(package) # this does more damage than good + if package not in pack_dirs: + pack_dirs += [package] + base_dirs = sh("{PYTHON} -m pip list -v | grep '^{PACK}\s' | awk '{{print $3}}'".format(PYTHON=self.python, PACK=package)).strip() + n_base_dirs = len(base_dirs.split()) + if n_base_dirs == 0: + return + if n_base_dirs > 1: + eprint("cannot determine base python installation dir for '{}'".format(package)) + return + base_dir = base_dirs + pack_re_suffixes = ['', + r'\.dist-info', + r'-\d+\.\d+\.\d+', + r'-\d+\.\d+\.\d+\.dist-info', + r'-\d+\.\d+\.\d+\.post\d+', + r'-\d+\.\d+\.\d+\.post\d+\.dist-info', + r'-\d+\.\d+\.\d+\.post\d+', + r'-\d+\.\d+\.\d+\.dev\d+\.dist-info'] + with paella.cwd(base_dir): + print("cd {}".format(base_dir)) + rm_d = [] + for pack_dir in pack_dirs: + try: + dirs = sh("ls -d {DIR}*".format(DIR=pack_dir)) + for d in dirs.split(): + for re_suff in pack_re_suffixes: + re1 = r'^{DIR}{SUFF}$'.format(DIR=pack_dir, SUFF=re_suff) + if paella.match(re1, d): + rm_d += [d] + break + except: + pass + if rm_d != []: + self.run("rm -rf {DIR}".format(DIR=' '.join(rm_d))) + print("cd -") + #---------------------------------------------------------------------------------------------- parser = argparse.ArgumentParser(description='Install RedisLabs Modules Python tools') parser.add_argument('-n', '--nop', action="store_true", help='no operation') parser.add_argument('--no-reinstall', action="store_true", default=False, help='Not not reinstall everything') -parser.add_argument('--reinstall', action="store_true", default=True, help='Reinstall everything (the default behavior)') +parser.add_argument('--reinstall', action="store_true", default=False, help='Reinstall everything') args = parser.parse_args() try: From 6691238e99ae60bf778aa5a89e23a447bcc9eca5 Mon Sep 17 00:00:00 2001 From: rafie Date: Mon, 30 Aug 2021 19:35:44 +0300 Subject: [PATCH 07/10] fixes 5 --- bin/getrmpytools | 4 ---- 1 file changed, 4 deletions(-) diff --git a/bin/getrmpytools b/bin/getrmpytools index a01d31a..1633c5d 100755 --- a/bin/getrmpytools +++ b/bin/getrmpytools @@ -113,11 +113,7 @@ class RMPyToolsSetup(paella.Setup): parser = argparse.ArgumentParser(description='Install RedisLabs Modules Python tools') parser.add_argument('-n', '--nop', action="store_true", help='no operation') parser.add_argument('--no-reinstall', action="store_true", default=False, help='Not not reinstall everything') -<<<<<<< HEAD parser.add_argument('--reinstall', action="store_true", default=False, help='Reinstall everything') -======= -parser.add_argument('--reinstall', action="store_true", default=False, help='Reinstall everything (the default behavior)') ->>>>>>> 8899d8ad157d553ebed378bfe40e04c0b61daceb args = parser.parse_args() try: From 0521deed1731fd7916a451ee16c46ef8a0e266ec Mon Sep 17 00:00:00 2001 From: rafie Date: Tue, 31 Aug 2021 02:08:17 +0300 Subject: [PATCH 08/10] fixes 6 --- bin/getrmpytools | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/bin/getrmpytools b/bin/getrmpytools index 1633c5d..dbb0e9e 100755 --- a/bin/getrmpytools +++ b/bin/getrmpytools @@ -61,7 +61,7 @@ class RMPyToolsSetup(paella.Setup): self.uninstall("redis") self.uninstall("redis-py-cluster", ["rediscluster", "redis_py_cluster"]) self.uninstall("ramp-packer", ["RAMP", "ramp_packer"]) - self.uninstall("RLTest", ["RLTest"]) + self.uninstall("rltest", ["RLTest"]) self.uninstall("click", ["Click"]) # redis-py-cluster should be installed from git due to redis-py dependency # self.pip_install("--no-cache-dir git+https://github.com/Grokzen/redis-py-cluster.git@master") @@ -71,7 +71,6 @@ class RMPyToolsSetup(paella.Setup): self.pip_install("--no-cache-dir --ignore-installed git+https://github.com/RedisLabs/RAMP@master") def uninstall(self, package, pack_dirs=[]): - # self.pip_uninstall(package) # this does more damage than good if package not in pack_dirs: pack_dirs += [package] base_dirs = sh("{PYTHON} -m pip list -v | grep '^{PACK}\s' | awk '{{print $3}}'".format(PYTHON=self.python, PACK=package)).strip() @@ -82,6 +81,7 @@ class RMPyToolsSetup(paella.Setup): eprint("cannot determine base python installation dir for '{}'".format(package)) return base_dir = base_dirs + self.pip_uninstall(package) # this does more damage than good pack_re_suffixes = ['', r'\.dist-info', r'-\d+\.\d+\.\d+', From a37d558dacb85b6d05e2dd97f4deb753aa7ce644 Mon Sep 17 00:00:00 2001 From: rafie Date: Tue, 31 Aug 2021 03:35:31 +0300 Subject: [PATCH 09/10] fixes 7 --- bin/getrmpytools | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/bin/getrmpytools b/bin/getrmpytools index dbb0e9e..eddd1fa 100755 --- a/bin/getrmpytools +++ b/bin/getrmpytools @@ -64,11 +64,10 @@ class RMPyToolsSetup(paella.Setup): self.uninstall("rltest", ["RLTest"]) self.uninstall("click", ["Click"]) # redis-py-cluster should be installed from git due to redis-py dependency - # self.pip_install("--no-cache-dir git+https://github.com/Grokzen/redis-py-cluster.git@master") - self.pip_install("--no-cache-dir --ignore-installed git+https://github.com/redisfab/redis-py.git@3.5") - self.pip_install("--no-cache-dir --ignore-installed git+https://github.com/redisfab/redis-py-cluster@rafi-conn-args1") - self.pip_install("--no-cache-dir --ignore-installed git+https://github.com/RedisLabsModules/RLTest.git@rafi-redispy2") self.pip_install("--no-cache-dir --ignore-installed git+https://github.com/RedisLabs/RAMP@master") + self.pip_install("--no-cache-dir --ignore-installed git+https://github.com/RedisLabsModules/RLTest.git@rafi-redispy2") + self.pip_install("--no-cache-dir --ignore-installed git+https://github.com/redisfab/redis-py-cluster@rafi-conn-args1") + self.pip_install("--no-cache-dir --ignore-installed git+https://github.com/redisfab/redis-py.git@3.5") def uninstall(self, package, pack_dirs=[]): if package not in pack_dirs: From 97e3f57008d3b6bb3b6fcae7eaa1fa3ccf56eacd Mon Sep 17 00:00:00 2001 From: rafie Date: Thu, 2 Sep 2021 15:33:23 +0300 Subject: [PATCH 10/10] fixes 8 --- bin/getrmpytools | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bin/getrmpytools b/bin/getrmpytools index eddd1fa..2e2faa2 100755 --- a/bin/getrmpytools +++ b/bin/getrmpytools @@ -66,7 +66,7 @@ class RMPyToolsSetup(paella.Setup): # redis-py-cluster should be installed from git due to redis-py dependency self.pip_install("--no-cache-dir --ignore-installed git+https://github.com/RedisLabs/RAMP@master") self.pip_install("--no-cache-dir --ignore-installed git+https://github.com/RedisLabsModules/RLTest.git@rafi-redispy2") - self.pip_install("--no-cache-dir --ignore-installed git+https://github.com/redisfab/redis-py-cluster@rafi-conn-args1") + self.pip_install("--no-cache-dir --ignore-installed git+https://github.com/redisfab/redis-py-cluster@2.1") self.pip_install("--no-cache-dir --ignore-installed git+https://github.com/redisfab/redis-py.git@3.5") def uninstall(self, package, pack_dirs=[]):