Skip to content

Commit cdfed55

Browse files
Fixes uninstall
1 parent 6784304 commit cdfed55

1 file changed

Lines changed: 14 additions & 6 deletions

File tree

wfcommons/wfchef/chef.py

Lines changed: 14 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -228,12 +228,20 @@ def uninstall_recipe(wf_name: str,
228228

229229
with init_file.open("w") as fp:
230230
fp.write(init_str)
231-
# for entry_point in pkg_resources.iter_entry_points('workflow_recipes'):
232-
# if entry_point.module_name == module_name:
233-
# print(f"Uninstalling package: {module_name}")
234-
# proc = subprocess.Popen(["pip", "uninstall", module_name])
235-
# proc.wait()
236-
# return
231+
232+
# Removing the recipe directory
233+
if dst.exists():
234+
subprocess.Popen(["rm", "-rf", str(dst)]).wait()
235+
236+
# Find setup.py, clean it and reinstall it
237+
path_to_setup = this_dir.parent.parent.resolve()
238+
# Check if the setup.py is in the same directory
239+
if path_to_setup.joinpath("setup.py").exists():
240+
subprocess.Popen(["python", "setup.py", "clean", "-all"]).wait()
241+
subprocess.Popen(["python", "setup.py", "sdist", "bdist_wheel"]).wait()
242+
subprocess.Popen(["pip", "install", "."]).wait()
243+
subprocess.Popen(["pip", "cache", "purge"]).wait()
244+
237245
except Exception as e:
238246
traceback.print_exc()
239247
# print(f"Could not find recipe with module name {module_name} installed")

0 commit comments

Comments
 (0)