File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff 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")
You can’t perform that action at this time.
0 commit comments