Revert mako hack to always display install_tool_dependency button

- Add resolver checkbox
 - Add possibility to disable resolvers if initialization failed
This commit is contained in:
Marius van den Beek
2016-07-22 22:01:38 +02:00
parent 33b83e5c70
commit 4ed151a771
8 changed files with 37 additions and 25 deletions
@@ -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
+8 -3
View File
@@ -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
+2 -2
View File
@@ -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 = []
@@ -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,
@@ -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 )
@@ -110,6 +110,7 @@
</p>
</div>
</div>
%if install_resolver_dependencies_check_box:
<div class="form-row">
<label>Install resolvable dependencies (Currently conda-only) ?</label>
${install_resolver_dependencies_check_box.get_html()}
@@ -117,9 +118,10 @@
Un-check to skip automatic installation of tool dependencies.
</div>
</div>
%endif
<div style="clear: both"></div>
%if repository_dependencies_root_folder or missing_repository_dependencies_root_folder:
%if repository_dependencies_check_box is not None:
%if repository_dependencies_check_box:
<div class="form-row">
%if export:
<label>Export repository dependencies?</label>
@@ -159,19 +161,20 @@
%endif
%endif
%if tool_dependencies_root_folder or missing_tool_dependencies_root_folder:
<div class="form-row">
<label>Handle tool dependencies?</label>
<% disabled = trans.app.config.tool_dependency_dir is None %>
${install_tool_dependencies_check_box.get_html( disabled=disabled )}
<div class="toolParamHelp" style="clear: both;">
%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
</div>
</div>
<div style="clear: both"></div>
%if install_tool_dependencies_check_box is not None:
<div class="form-row">
<label>Handle tool dependencies?</label>
<% disabled = trans.app.config.tool_dependency_dir is None %>
${install_tool_dependencies_check_box.get_html( disabled=disabled )}
<div class="toolParamHelp" style="clear: both;">
%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
</div>
<div style="clear: both"></div>
%endif
%if tool_dependencies_root_folder:
<div class="form-row">
<p/>
@@ -34,7 +34,7 @@ ${render_tool_shed_repository_actions( repository, metadata=metadata, changeset_
<div class="toolFormBody">
<form name="export_repository" id="export_repository" action="${h.url_for( controller='repository', action='export', repository_id=trans.security.encode_id( repository.id ), changeset_revision=changeset_revision )}" method="post" >
%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 )}
<div style="clear: both"></div>
%else:
No repository dependencies are defined for revision <b>${revision_label}</b> of this repository, so click <b>Export</b> to export the selected revision.
+2 -1
View File
@@ -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 )