1 new commit in galaxy-central:
https://bitbucket.org/galaxy/galaxy-central/commits/40a7ef4efb22/
changeset: 40a7ef4efb22
user: greg
date: 2013-02-17 18:46:13
summary: Fix tool shed functional test that was broken in commit 8852:d04aa3ad6132.
affected #: 2 files
diff -r 64b4ef5e2cc8e18a2872eaeb64fa46f50ae7f814 -r 40a7ef4efb22afdc6bde4bce4e75d691e4ac7a7f test/tool_shed/base/twilltestcase.py
--- a/test/tool_shed/base/twilltestcase.py
+++ b/test/tool_shed/base/twilltestcase.py
@@ -903,28 +903,58 @@
self.reset_installed_repository_metadata( installed_repository )
new_metadata = installed_repository.metadata
assert metadata == new_metadata, 'Metadata for installed repository %s differs after metadata reset.' % name
- def verify_installed_repository_data_table_entries( self, data_tables=[] ):
- data_table = util.parse_xml( self.shed_tool_data_table_conf )
+ def verify_installed_repository_data_table_entries( self, required_data_table_entries ):
+ # The value of the received required_data_table_entries will be something like: [ 'sam_fa_indexes' ]
+ data_tables = util.parse_xml( self.shed_tool_data_table_conf )
found = False
+ # With the tool shed, the "path" attribute that is hard-coded into the tool_data_tble_conf.xml
+ # file is ignored. This is because the tool shed requires the directory location to which this
+ # path points to be empty except when a specific tool is loaded. The default location for this
+ # directory configured for the tool shed is <Galaxy root>/shed-tool-data. When a tool is loaded
+ # in the tool shed, all contained .loc.sample files are copied to this directory and the
+ # ToolDataTableManager parses and loads the files in the same way that Galaxy does with a very
+ # important exception. When the tool shed loads a tool and parses and loads the copied ,loc.sample
+ # files, the ToolDataTableManager is already instantiated, and so it's add_new_entries_from_config_file()
+ # method is called and the tool_data_path parameter is used to over-ride the hard-coded "tool-data"
+ # directory that Galaxy always uses.
+ #
# Tool data table xml structure:
# <tables>
- # <!-- Locations of all fasta files under genome directory -->
- # <table name="all_fasta" comment_char="#">
- # <columns>value, dbkey, name, path</columns>
- # <file path="tool-data/all_fasta.loc" />
+ # <table comment_char="#" name="sam_fa_indexes">
+ # <columns>line_type, value, path</columns>
+ # <file path="tool-data/sam_fa_indices.loc" />
# </table>
# </tables>
- for table_elem in data_table.findall( 'table' ):
- for data_table in data_tables:
- if 'name' in table_elem.attrib and table_elem.attrib[ 'name' ] == data_table:
+ for table_elem in data_tables.findall( 'table' ):
+ # The value of table_elem will be something like: <table comment_char="#" name="sam_fa_indexes">
+ for required_data_table_entry in required_data_table_entries:
+ # The value of required_data_table_entry will be something like: 'sam_fa_indexes'
+ if 'name' in table_elem.attrib and table_elem.attrib[ 'name' ] == required_data_table_entry:
+ found = True
+ # We're processing something like: sam_fa_indexes
file_elem = table_elem.find( 'file' )
+ # We have something like: <file path="tool-data/sam_fa_indices.loc" />
+ # The "path" attribute of the "file" tag is the location that Galaxy always uses because the
+ # Galaxy ToolDataTableManager was implemented in such a way that the hard-coded path is used
+ # rather than allowing the location to be a configurable setting like the tool shed requires.
file_path = file_elem.get( 'path', None )
- full_path = os.path.join( self.tool_data_path, file_path )
- assert file_path is not None, 'No file path configured for this data table.'
- assert os.path.exists( full_path ), 'Tool data table file %s not found.' % full_path
- found = True
+ # The value of file_path will be something like: "tool-data/all_fasta.loc"
+ assert file_path is not None, 'The "path" attribute is missing for the %s entry.' % name
+ # The following test is probably not necesary, but the tool-data directory should exist!
+ galaxy_tool_data_dir, loc_file_name = os.path.split( file_path )
+ assert galaxy_tool_data_dir is not None, 'The hard-coded Galaxy tool-data directory is missing for the %s entry.' % name
+ assert os.path.exists( galaxy_tool_data_dir ), 'The Galaxy tool-data directory does not exist.'
+ # Make sure the loc_file_name was correctly copied into the configured directory location.
+ configured_file_location = os.path.join( self.tool_data_path, loc_file_name )
+ assert os.path.isfile( configured_file_location ), 'The expected copied file "%s" is missing.' % configured_file_location
+ # We've found the value of the required_data_table_entry in data_tables, which is the parsed
+ # shed_tool_data_table_conf.xml, so all is well!
break
- assert found, 'No entry for %s in %s.' % ( data_table, self.shed_tool_data_table_conf )
+ if found:
+ break
+ # We better have an entry like: <table comment_char="#" name="sam_fa_indexes"> in our parsed data_tables
+ # or we know that the repository was not correctly installed!
+ assert found, 'No entry for %s in %s.' % ( required_data_table_entry, self.shed_tool_data_table_conf )
def verify_repository_reviews( self, repository, reviewer=None, strings_displayed=[], strings_not_displayed=[] ):
changeset_revision = self.get_repository_tip( repository )
# Verify that the currently logged in user has a repository review for the specified repository, reviewer, and changeset revision.
diff -r 64b4ef5e2cc8e18a2872eaeb64fa46f50ae7f814 -r 40a7ef4efb22afdc6bde4bce4e75d691e4ac7a7f test/tool_shed/functional/test_1010_install_repository_with_tool_dependencies.py
--- a/test/tool_shed/functional/test_1010_install_repository_with_tool_dependencies.py
+++ b/test/tool_shed/functional/test_1010_install_repository_with_tool_dependencies.py
@@ -127,5 +127,5 @@
self.verify_installed_repository_metadata_unchanged( repository_name, common.test_user_1_name )
def test_0025_verify_sample_files( self ):
'''Verify that the installed repository populated shed_tool_data_table.xml and the sample files.'''
- self.verify_installed_repository_data_table_entries( data_tables=[ 'sam_fa_indexes' ] )
+ self.verify_installed_repository_data_table_entries( required_data_table_entries=[ 'sam_fa_indexes' ] )
Repository URL: https://bitbucket.org/galaxy/galaxy-central/
--
This is a commit notification from bitbucket.org. You are receiving
this because you have the service enabled, addressing the recipient of
this email.
1 new commit in galaxy-central:
https://bitbucket.org/galaxy/galaxy-central/commits/a41446bf66fd/
changeset: a41446bf66fd
user: greg
date: 2013-02-16 22:20:33
summary: Fix for handling a complex repository dependency defintiion and a bit of code cleanup.
affected #: 1 file
diff -r 2fc2d5ef636913bdb29c4f9ecea42e440a2c326a -r a41446bf66fda81772b6fe7d02f921a4955f7ce9 lib/galaxy/util/shed_util_common.py
--- a/lib/galaxy/util/shed_util_common.py
+++ b/lib/galaxy/util/shed_util_common.py
@@ -1429,8 +1429,8 @@
# We have a complex repository dependency. If the retruned value of repository_dependency_is_valid is True, the tool
# dependency definition will be set as invalid. This is currently the only case where a tool dependency definition is
# considered invalid.
- repository_dependencies_tup, repository_dependency_is_valid, error_message = handle_repository_elem( app=app,
- repository_elem=sub_elem )
+ repository_dependency_tup, repository_dependency_is_valid, error_message = \
+ handle_repository_elem( app=app, repository_elem=sub_elem )
if requirements_dict:
dependency_key = '%s/%s' % ( package_name, package_version )
if repository_dependency_is_valid:
@@ -1490,19 +1490,6 @@
If the combination of name, version and type of each element is defined in the <requirement> tag for at least one tool in the repository,
then update the received metadata_dict with information from the parsed tool_dependencies_config.
"""
- """
- "{"orphan_tool_dependencies":
- {"bwa/0.5.9":
- {"name": "bwa",
- "readme": "\\nCompiling BWA requires zlib and libpthread to be present on your system.\\n ",
- "type": "package", "version": "0.5.9"}},
- "tool_dependencies":
- {"bwa/0.5.9":
- {"name": "bwa",
- "readme": "\\nCompiling BWA requires zlib and libpthread to be present on your system.\\n ",
- "type": "package",
- "version": "0.5.9"}}}"
- """
error_message = ''
if original_repository_metadata:
# Keep a copy of the original tool dependencies dictionary and the list of tool dictionaries in the metadata.
@@ -1538,7 +1525,8 @@
# We have an invalid complex repository dependency, so mark the tool dependency as invalid.
tool_dependency_is_valid = False
# Append the error message to the invalid repository dependency tuple.
- repository_dependency_tup.append( message )
+ toolshed, name, owner, changeset_revision = repository_dependency_tup
+ repository_dependency_tup = ( toolshed, name, owner, changeset_revision, message )
invalid_repository_dependency_tups.append( repository_dependency_tup )
error_message = '%s %s' % ( error_message, message )
elif elem.tag == 'set_environment':
Repository URL: https://bitbucket.org/galaxy/galaxy-central/
--
This is a commit notification from bitbucket.org. You are receiving
this because you have the service enabled, addressing the recipient of
this email.
2 new commits in galaxy-central:
https://bitbucket.org/galaxy/galaxy-central/commits/ef882ec18f1c/
changeset: ef882ec18f1c
user: jmchilton
date: 2013-02-15 22:58:30
summary: Fix to allow multiple input tool parameters in conditionals and repeats.
affected #: 1 file
diff -r ec4da708e45175610a33d16fcfc68732e425f54f -r ef882ec18f1c6c779796cde62ca035c826197bc9 lib/galaxy/tools/actions/__init__.py
--- a/lib/galaxy/tools/actions/__init__.py
+++ b/lib/galaxy/tools/actions/__init__.py
@@ -76,10 +76,10 @@
else:
raise Exception, 'A path for explicit datatype conversion has not been found: %s --/--> %s' % ( input_datasets[ prefix + input.name + str( i + 1 ) ].extension, conversion_extensions )
if parent:
- parent[input.name] = input_datasets[ prefix + input.name + str( i + 1 ) ]
+ parent[input.name][i] = input_datasets[ prefix + input.name + str( i + 1 ) ]
for conversion_name, conversion_data in conversions:
#allow explicit conversion to be stored in job_parameter table
- parent[ conversion_name ] = conversion_data.id #a more robust way to determine JSONable value is desired
+ parent[ conversion_name ][i] = conversion_data.id #a more robust way to determine JSONable value is desired
else:
param_values[input.name][i] = input_datasets[ prefix + input.name + str( i + 1 ) ]
for conversion_name, conversion_data in conversions:
https://bitbucket.org/galaxy/galaxy-central/commits/2fc2d5ef6369/
changeset: 2fc2d5ef6369
user: dannon
date: 2013-02-15 23:18:46
summary: Merged in jmchilton/galaxy-central-multi-input-tool-fixes-2 (pull request #125)
Fix to allow multiple input tool parameters in conditionals and repeats.
affected #: 1 file
diff -r 8e93ca10b0e2523ba78a02bfb36e371db5f17e0a -r 2fc2d5ef636913bdb29c4f9ecea42e440a2c326a lib/galaxy/tools/actions/__init__.py
--- a/lib/galaxy/tools/actions/__init__.py
+++ b/lib/galaxy/tools/actions/__init__.py
@@ -76,10 +76,10 @@
else:
raise Exception, 'A path for explicit datatype conversion has not been found: %s --/--> %s' % ( input_datasets[ prefix + input.name + str( i + 1 ) ].extension, conversion_extensions )
if parent:
- parent[input.name] = input_datasets[ prefix + input.name + str( i + 1 ) ]
+ parent[input.name][i] = input_datasets[ prefix + input.name + str( i + 1 ) ]
for conversion_name, conversion_data in conversions:
#allow explicit conversion to be stored in job_parameter table
- parent[ conversion_name ] = conversion_data.id #a more robust way to determine JSONable value is desired
+ parent[ conversion_name ][i] = conversion_data.id #a more robust way to determine JSONable value is desired
else:
param_values[input.name][i] = input_datasets[ prefix + input.name + str( i + 1 ) ]
for conversion_name, conversion_data in conversions:
Repository URL: https://bitbucket.org/galaxy/galaxy-central/
--
This is a commit notification from bitbucket.org. You are receiving
this because you have the service enabled, addressing the recipient of
this email.
1 new commit in galaxy-central:
https://bitbucket.org/galaxy/galaxy-central/commits/8e430a612aee/
changeset: 8e430a612aee
user: dan
date: 2013-02-15 20:04:47
summary: Only write out a new shed_data_manager_conf if the file has changed.
affected #: 1 file
diff -r d07c457ee2692868a5ab99b4d663a220abf8ac73 -r 8e430a612aee6bb14fe373ae9e67d80ba84723d9 lib/galaxy/util/shed_util.py
--- a/lib/galaxy/util/shed_util.py
+++ b/lib/galaxy/util/shed_util.py
@@ -1188,6 +1188,7 @@
if repo_data_manager_conf_filename is None:
log.debug( "No data_manager_conf.xml file has been defined." )
return rval
+ data_manager_config_has_changes = False
relative_repo_data_manager_dir = os.path.join( shed_config_dict.get( 'tool_path', '' ), relative_install_dir )
repo_data_manager_conf_filename = os.path.join( relative_repo_data_manager_dir, repo_data_manager_conf_filename )
tree = util.parse_xml( repo_data_manager_conf_filename )
@@ -1236,8 +1237,10 @@
else:
log.warning( "Encountered unexpected element '%s':\n%s" % ( elem.tag, util.xml_to_string( elem ) ) )
config_elems.append( elem )
- # Persist the altered shed_tool_config file.
- suc.data_manager_config_elems_to_xml_file( app, config_elems, shed_data_manager_conf_filename )
+ data_manager_config_has_changes = True
+ # Persist the altered shed_data_manager_config file.
+ if data_manager_config_has_changes:
+ suc.data_manager_config_elems_to_xml_file( app, config_elems, shed_data_manager_conf_filename )
return rval
def is_in_repo_info_dicts( repo_info_dict, repo_info_dicts ):
Repository URL: https://bitbucket.org/galaxy/galaxy-central/
--
This is a commit notification from bitbucket.org. You are receiving
this because you have the service enabled, addressing the recipient of
this email.
1 new commit in galaxy-central:
https://bitbucket.org/galaxy/galaxy-central/commits/d07c457ee269/
changeset: d07c457ee269
user: dan
date: 2013-02-15 19:57:08
summary: Only write out a new shed_data_manager_conf if the file has changed.
affected #: 1 file
diff -r e882cfa616ec6a51ac75d7d7779d2aa7f2e516f8 -r d07c457ee2692868a5ab99b4d663a220abf8ac73 lib/galaxy/util/shed_util.py
--- a/lib/galaxy/util/shed_util.py
+++ b/lib/galaxy/util/shed_util.py
@@ -1527,14 +1527,18 @@
root = tree.getroot()
assert root.tag == 'data_managers', 'The file provided (%s) for removing data managers from is not a valid data manager xml file.' % ( shed_data_manager_conf_filename )
guids = [ data_manager_dict.get( 'guid' ) for data_manager_dict in metadata_dict.get( 'data_manager', {} ).get( 'data_managers', {} ).itervalues() if 'guid' in data_manager_dict ]
+ data_manager_config_has_changes = False
config_elems = []
for elem in root:
if elem.tag != 'data_manager' or elem.get( 'guid', None ) not in guids:
config_elems.append( elem )
+ else:
+ data_manager_config_has_changes = True
#remove data managers from in memory
app.data_managers.remove_manager( guids )
# Persist the altered shed_data_manager_config file.
- suc.data_manager_config_elems_to_xml_file( app, config_elems, shed_data_manager_conf_filename )
+ if data_manager_config_has_changes:
+ suc.data_manager_config_elems_to_xml_file( app, config_elems, shed_data_manager_conf_filename )
def remove_from_shed_tool_config( trans, shed_tool_conf_dict, guids_to_remove ):
# A tool shed repository is being uninstalled so change the shed_tool_conf file. Parse the config file to generate the entire list
# of config_elems instead of using the in-memory list since it will be a subset of the entire list if one or more repositories have
Repository URL: https://bitbucket.org/galaxy/galaxy-central/
--
This is a commit notification from bitbucket.org. You are receiving
this because you have the service enabled, addressing the recipient of
this email.
1 new commit in galaxy-central:
https://bitbucket.org/galaxy/galaxy-central/commits/e882cfa616ec/
changeset: e882cfa616ec
user: dan
date: 2013-02-15 19:49:47
summary: Fix for reinstalling a Tool Shed Repository that contains tools, but none of them are added to the tool panel.
affected #: 1 file
diff -r 2664d904641abdc1ed6a2f972eb5aeefa8f93703 -r e882cfa616ec6a51ac75d7d7779d2aa7f2e516f8 lib/galaxy/util/shed_util.py
--- a/lib/galaxy/util/shed_util.py
+++ b/lib/galaxy/util/shed_util.py
@@ -1058,30 +1058,32 @@
tool_section = None
tool_panel_section_key = None
if 'tools' in metadata:
- if 'tool_panel_section' in metadata:
- tool_panel_dict = metadata[ 'tool_panel_section' ]
- if not tool_panel_dict:
+ # This forces everything to be loaded into the same section (or no section) in the tool panel.
+ if no_changes_checked:
+ if 'tool_panel_section' in metadata:
+ tool_panel_dict = metadata[ 'tool_panel_section' ]
+ if not tool_panel_dict:
+ tool_panel_dict = generate_tool_panel_dict_for_new_install( metadata[ 'tools' ] )
+ else:
tool_panel_dict = generate_tool_panel_dict_for_new_install( metadata[ 'tools' ] )
- else:
- tool_panel_dict = generate_tool_panel_dict_for_new_install( metadata[ 'tools' ] )
- # This forces everything to be loaded into the same section (or no section) in the tool panel.
- tool_section_dicts = tool_panel_dict[ tool_panel_dict.keys()[ 0 ] ]
- tool_section_dict = tool_section_dicts[ 0 ]
- original_section_id = tool_section_dict[ 'id' ]
- original_section_name = tool_section_dict[ 'name' ]
- if no_changes_checked:
- if original_section_id:
- tool_panel_section_key = 'section_%s' % str( original_section_id )
- if tool_panel_section_key in trans.app.toolbox.tool_panel:
- tool_section = trans.app.toolbox.tool_panel[ tool_panel_section_key ]
- else:
- # The section in which the tool was originally loaded used to be in the tool panel, but no longer is.
- elem = Element( 'section' )
- elem.attrib[ 'name' ] = original_section_name
- elem.attrib[ 'id' ] = original_section_id
- elem.attrib[ 'version' ] = ''
- tool_section = galaxy.tools.ToolSection( elem )
- trans.app.toolbox.tool_panel[ tool_panel_section_key ] = tool_section
+ if tool_panel_dict:
+ #tool_panel_dict is empty when tools exist but are not installed into a tool panel
+ tool_section_dicts = tool_panel_dict[ tool_panel_dict.keys()[ 0 ] ]
+ tool_section_dict = tool_section_dicts[ 0 ]
+ original_section_id = tool_section_dict[ 'id' ]
+ original_section_name = tool_section_dict[ 'name' ]
+ if original_section_id:
+ tool_panel_section_key = 'section_%s' % str( original_section_id )
+ if tool_panel_section_key in trans.app.toolbox.tool_panel:
+ tool_section = trans.app.toolbox.tool_panel[ tool_panel_section_key ]
+ else:
+ # The section in which the tool was originally loaded used to be in the tool panel, but no longer is.
+ elem = Element( 'section' )
+ elem.attrib[ 'name' ] = original_section_name
+ elem.attrib[ 'id' ] = original_section_id
+ elem.attrib[ 'version' ] = ''
+ tool_section = galaxy.tools.ToolSection( elem )
+ trans.app.toolbox.tool_panel[ tool_panel_section_key ] = tool_section
else:
# The user elected to change the tool panel section to contain the tools.
if new_tool_panel_section:
Repository URL: https://bitbucket.org/galaxy/galaxy-central/
--
This is a commit notification from bitbucket.org. You are receiving
this because you have the service enabled, addressing the recipient of
this email.