-
Notifications
You must be signed in to change notification settings - Fork 22
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
getrmpytools: reinstalling the hard way #57
Open
rafie
wants to merge
13
commits into
master
Choose a base branch
from
rafi-pytools1
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
13 commits
Select commit
Hold shift + click to select a range
b658b90
Experimental vesion of getrmpytools
rafie 38ef2c5
getrmpytools: reinstalling the hard way
rafie 2fc2edc
Merge branch 'rafi-pytools1' of ssh://github.com/RedisLabsModules/rea…
rafie 29a4ac0
fixes 1
rafie fe349cd
fixes 2
rafie 8899d8a
fixes 3
rafie a0fdbdc
fixes 1
rafie cba6194
Merge branch 'rafi-pytools1' of github.com:RedisLabsModules/readies i…
rafie 6691238
fixes 5
rafie 0521dee
fixes 6
rafie a37d558
fixes 7
rafie 97e3f57
fixes 8
rafie 4fadfc8
Merge remote-tracking branch 'origin/master' into rafi-pytools1
rafie File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -58,13 +58,54 @@ 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/[email protected]") | ||
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") | ||
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/[email protected]") | ||
self.pip_install("--no-cache-dir --ignore-installed git+https://github.com/redisfab/[email protected]") | ||
|
||
def uninstall(self, package, pack_dirs=[]): | ||
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 | ||
self.pip_uninstall(package) # this does more damage than good | ||
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))) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. shutil.rmtree(rm_d) |
||
print("cd -") | ||
|
||
#---------------------------------------------------------------------------------------------- | ||
|
||
|
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'd use os.walk, but this works.