Skip to content
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

Add the possibility to uninstall conda environments that are not in u… #3750

Merged
merged 3 commits into from Mar 30, 2017

Conversation

Projects
None yet
5 participants
@mvdbeek
Copy link
Member

commented Mar 14, 2017

…se by Galaxy.

@mvdbeek mvdbeek added this to the 17.05 milestone Mar 14, 2017

@mvdbeek mvdbeek changed the title [WIP] Add the possibility to uninstall conda environments that are not in u… Add the possibility to uninstall conda environments that are not in u… Mar 19, 2017

@mvdbeek mvdbeek added status/review and removed status/WIP labels Mar 19, 2017

@mvdbeek

This comment has been minimized.

Copy link
Member Author

commented Mar 19, 2017

Alright, this is working pretty well for me (saved me a couple of GB), I'd appreciate a review!

unused_dependencies = []
for resolver in self._dependency_resolvers:
if hasattr(resolver, 'unused_dependency_paths'):
unused_dependencies.extend(resolver.unused_dependency_paths(self.toolbox_requirements_status))

This comment has been minimized.

Copy link
@nsoranzo

nsoranzo Mar 19, 2017

Member

You can save self.toolbox_requirements_status to a variable before the for loop.

envs_to_remove = set(envs)
for resolver in self._dependency_resolvers:
if hasattr(resolver, 'unused_dependency_paths') and hasattr(resolver, 'uninstall_environments'):
unused_dependencies = resolver.unused_dependency_paths(self.toolbox_requirements_status)

This comment has been minimized.

Copy link
@nsoranzo

nsoranzo Mar 19, 2017

Member

Same as above.

can_remove = envs_to_remove & set(unused_dependencies)
exit_code = resolver.uninstall_environments(can_remove)
if exit_code == 0:
envs_to_remove = envs_to_remove.difference(can_remove)

This comment has been minimized.

Copy link
@nsoranzo

nsoranzo Mar 19, 2017

Member

Should this method return something?

@jmchilton

This comment has been minimized.

Copy link
Member

commented Mar 28, 2017

Seems like a solid idea to me and the implementation looks good! Thanks for your continued work on this GUI @mvdbeek - this is quite exciting and most appreciated. 👍

@dannon

This comment has been minimized.

Copy link
Member

commented Mar 30, 2017

Looks nice, and it worked to clean up a couple things for me!

@dannon dannon merged commit 3d2833f into galaxyproject:dev Mar 30, 2017

5 checks passed

api test Build finished. 263 tests run, 0 skipped, 0 failed.
Details
continuous-integration/travis-ci/pr The Travis CI build passed
Details
framework test Build finished. 140 tests run, 0 skipped, 0 failed.
Details
integration test Build finished. 25 tests run, 0 skipped, 0 failed.
Details
toolshed test Build finished. 580 tests run, 0 skipped, 0 failed.
Details

@mvdbeek mvdbeek deleted the mvdbeek:remove_unused_envs branch Jun 12, 2018

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.