diff --git a/lib/galaxy/tools/deps/resolvers/__init__.py b/lib/galaxy/tools/deps/resolvers/__init__.py index cd5fce07c0f..f5f57800cc9 100644 --- a/lib/galaxy/tools/deps/resolvers/__init__.py +++ b/lib/galaxy/tools/deps/resolvers/__init__.py @@ -13,6 +13,7 @@ class DependencyResolver(Dictifiable, object): # because the repository install context is used in dependency resolution # so the same requirement tags in different tools will have very different # resolution. + disabled = False resolves_simple_dependencies = True __metaclass__ = ABCMeta diff --git a/lib/galaxy/tools/deps/resolvers/conda.py b/lib/galaxy/tools/deps/resolvers/conda.py index 9c9ec6cad2a..5b01a4db6ba 100644 --- a/lib/galaxy/tools/deps/resolvers/conda.py +++ b/lib/galaxy/tools/deps/resolvers/conda.py @@ -89,9 +89,14 @@ class CondaDependencyResolver(DependencyResolver, ListableDependencyResolver, In auto_install = _string_as_bool(get_option("auto_install")) copy_dependencies = _string_as_bool(get_option("copy_dependencies")) - if auto_init and not os.path.exists(conda_context.conda_prefix): - if install_conda(conda_context): - raise Exception("Conda installation requested and failed.") + if not os.path.exists(conda_context.conda_prefix): + if auto_init: + if install_conda(conda_context): + self.disabled = True + log.warning("Conda installation requested and failed.") + else: + self.disabled = True + log.warning("Conda not installed and auto-installation disabled.") self.conda_context = conda_context self.auto_install = auto_install diff --git a/lib/galaxy/tools/deps/views.py b/lib/galaxy/tools/deps/views.py index 99f28141f3b..9d8e045cdf7 100644 --- a/lib/galaxy/tools/deps/views.py +++ b/lib/galaxy/tools/deps/views.py @@ -121,9 +121,9 @@ class DependencyResolversView(object): @property def installable_resolvers(self): """ - List index for all resolvers that have the 'install_dependency' attribute + List index for all active resolvers that have the 'install_dependency' attribute """ - return [index for index, resolver in enumerate(self._dependency_resolvers) if hasattr(resolver, "install_dependency")] + return [index for index, resolver in enumerate(self._dependency_resolvers) if hasattr(resolver, "install_dependency") and not resolver.disabled ] def get_requirements_status(self, requested_requirements): result = [] diff --git a/lib/galaxy/webapps/galaxy/controllers/admin_toolshed.py b/lib/galaxy/webapps/galaxy/controllers/admin_toolshed.py index 99e22af10cd..c312c3a1951 100644 --- a/lib/galaxy/webapps/galaxy/controllers/admin_toolshed.py +++ b/lib/galaxy/webapps/galaxy/controllers/admin_toolshed.py @@ -692,8 +692,8 @@ class AdminToolshed( AdminGalaxy ): encoded_updated_metadata=encoded_updated_metadata, encoded_relative_install_dir=encoded_relative_install_dir, encoded_tool_dependencies_dict=encoded_tool_dependencies_dict, - install_tool_dependencies_check_box=install_tool_dependencies_check_box, install_resolver_dependencies_check_box=install_resolver_dependencies_check_box, + install_tool_dependencies_check_box=install_tool_dependencies_check_box, tool_dependencies_dict=tool_dependencies_dict, message=message, status=status ) @@ -738,11 +738,11 @@ class AdminToolshed( AdminGalaxy ): reinstalling = util.string_as_bool( kwd.get( 'reinstalling', False ) ) encoded_kwd = kwd[ 'encoded_kwd' ] decoded_kwd = encoding_util.tool_shed_decode( encoded_kwd ) - install_tool_dependencies = CheckboxField.is_checked( decoded_kwd.get( 'install_tool_dependencies', '' ) ) install_resolver_dependencies = CheckboxField.is_checked( decoded_kwd.get( 'install_resolver_dependencies', '' ) ) + install_tool_dependencies = CheckboxField.is_checked( decoded_kwd.get( 'install_tool_dependencies', '' ) ) tsr_ids = decoded_kwd[ 'tool_shed_repository_ids' ] - decoded_kwd['install_tool_dependencies'] = install_tool_dependencies decoded_kwd['install_resolver_dependencies'] = install_resolver_dependencies + decoded_kwd['install_tool_dependencies'] = install_tool_dependencies try: tool_shed_repositories = irm.install_repositories( tsr_ids=tsr_ids, @@ -1099,7 +1099,7 @@ class AdminToolshed( AdminGalaxy ): install_tool_dependencies = CheckboxField.is_checked( install_tool_dependencies ) else: install_tool_dependencies = False - install_repository_dependencies = CheckboxField.is_checked( install_resolver_dependencies ) + install_resolver_dependencies = CheckboxField.is_checked( install_resolver_dependencies ) tool_path = suc.get_tool_path_by_shed_tool_conf_filename( trans.app, shed_tool_conf ) installation_dict = dict( install_repository_dependencies=install_repository_dependencies, new_tool_panel_section_label=new_tool_panel_section_label, @@ -1283,6 +1283,7 @@ class AdminToolshed( AdminGalaxy ): includes_tools_for_display_in_tool_panel=includes_tools_for_display_in_tool_panel, includes_tool_dependencies=includes_tool_dependencies, install_tool_dependencies_check_box=install_tool_dependencies_check_box, + install_resolver_dependencies_check_box=install_resolver_dependencies_check_box, has_repository_dependencies=has_repository_dependencies, install_repository_dependencies_check_box=install_repository_dependencies_check_box, new_tool_panel_section_label=new_tool_panel_section_label, diff --git a/lib/tool_shed/galaxy_install/repair_repository_manager.py b/lib/tool_shed/galaxy_install/repair_repository_manager.py index e59c0c7fbed..20f298a2291 100644 --- a/lib/tool_shed/galaxy_install/repair_repository_manager.py +++ b/lib/tool_shed/galaxy_install/repair_repository_manager.py @@ -194,6 +194,7 @@ class RepairRepositoryManager(): shed_tool_conf, tool_path, install_tool_dependencies=True, + install_resolver_dependencies=False, # Assuming repairs are only necessary toolshed packages reinstalling=True ) if repository.status in [ self.app.install_model.ToolShedRepository.installation_status.ERROR ]: repair_dict = add_repair_dict_entry( repository.name, repository.error_message ) diff --git a/templates/admin/tool_shed_repository/common.mako b/templates/admin/tool_shed_repository/common.mako index 7ced584503d..5c332660950 100644 --- a/templates/admin/tool_shed_repository/common.mako +++ b/templates/admin/tool_shed_repository/common.mako @@ -110,6 +110,7 @@

+ %if install_resolver_dependencies_check_box:
${install_resolver_dependencies_check_box.get_html()} @@ -117,9 +118,10 @@ Un-check to skip automatic installation of tool dependencies.
+ %endif
%if repository_dependencies_root_folder or missing_repository_dependencies_root_folder: - %if repository_dependencies_check_box is not None: + %if repository_dependencies_check_box:
%if export: @@ -159,19 +161,20 @@ %endif %endif %if tool_dependencies_root_folder or missing_tool_dependencies_root_folder: -
- - <% disabled = trans.app.config.tool_dependency_dir is None %> - ${install_tool_dependencies_check_box.get_html( disabled=disabled )} -
- %if disabled: - Set the tool_dependency_dir configuration value in your Galaxy config to automatically handle tool dependencies. - %else: - Un-check to skip automatic handling of tool dependencies (if any). - %endif -
-
-
+ %if install_tool_dependencies_check_box is not None: +
+ + <% disabled = trans.app.config.tool_dependency_dir is None %> + ${install_tool_dependencies_check_box.get_html( disabled=disabled )} +
+ %if disabled: + Set the tool_dependency_dir configuration value in your Galaxy config to automatically handle tool dependencies. + %else: + Un-check to skip automatic handling of these tool dependencies. + %endif +
+
+ %endif %if tool_dependencies_root_folder:

diff --git a/templates/webapps/tool_shed/repository/export_repository.mako b/templates/webapps/tool_shed/repository/export_repository.mako index 04f9d0fa4d9..0a60ea2b124 100644 --- a/templates/webapps/tool_shed/repository/export_repository.mako +++ b/templates/webapps/tool_shed/repository/export_repository.mako @@ -34,7 +34,7 @@ ${render_tool_shed_repository_actions( repository, metadata=metadata, changeset_

%if containers_dict is not None and export_repository_dependencies_check_box is not None: - ${render_dependencies_section( export_repository_dependencies_check_box, None, containers_dict, revision_label=revision_label, export=True )} + ${render_dependencies_section( None, export_repository_dependencies_check_box, None, containers_dict, revision_label=revision_label, export=True )}
%else: No repository dependencies are defined for revision ${revision_label} of this repository, so click Export to export the selected revision. diff --git a/test/shed_functional/base/twilltestcase.py b/test/shed_functional/base/twilltestcase.py index 9071a3c97ac..6c3b5054e5b 100644 --- a/test/shed_functional/base/twilltestcase.py +++ b/test/shed_functional/base/twilltestcase.py @@ -947,7 +947,7 @@ class ShedTwillTestCase( TwillTestCase ): repository_ids = self.initiate_installation_process() self.wait_for_repository_installation( repository_ids ) - def install_repository( self, name, owner, category_name, install_tool_dependencies=False, + def install_repository( self, name, owner, category_name, install_resolver_dependencies=False, install_tool_dependencies=False, install_repository_dependencies=True, changeset_revision=None, strings_displayed=None, strings_not_displayed=None, preview_strings_displayed=None, post_submit_strings_displayed=None, new_tool_panel_section_label=None, includes_tools_for_display_in_tool_panel=True, @@ -971,6 +971,7 @@ class ShedTwillTestCase( TwillTestCase ): assert form is not None, 'Could not find form select_shed_tool_panel_config or select_tool_panel_section.' kwd = self.set_form_value( form, kwd, 'install_tool_dependencies', install_tool_dependencies ) kwd = self.set_form_value( form, kwd, 'install_repository_dependencies', install_repository_dependencies ) + kwd = self.set_form_value( form, kwd, 'install_resolver_dependencies', install_resolver_dependencies ) kwd = self.set_form_value( form, kwd, 'shed_tool_conf', self.shed_tool_conf ) if new_tool_panel_section_label is not None: kwd = self.set_form_value( form, kwd, 'new_tool_panel_section_label', new_tool_panel_section_label )