galaxy-commits
Threads by month
- ----- 2026 -----
- July
- June
- May
- April
- March
- February
- January
- ----- 2025 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2024 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2023 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2022 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2021 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2020 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2019 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2018 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2017 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2016 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2015 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2014 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2013 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2012 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2011 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2010 -----
- December
- November
- October
- September
- August
- July
- June
- May
- 15302 discussions
commit/galaxy-central: Dave Bouvier: Define a CSS class that applies to all tool test results subfolders.
by commits-noreply@bitbucket.org 29 Jul '13
by commits-noreply@bitbucket.org 29 Jul '13
29 Jul '13
1 new commit in galaxy-central:
https://bitbucket.org/galaxy/galaxy-central/commits/65a1a1a16552/
Changeset: 65a1a1a16552
User: Dave Bouvier
Date: 2013-07-29 21:25:08
Summary: Define a CSS class that applies to all tool test results subfolders.
Affected #: 1 file
diff -r 5ad8db7ff74881f13420f9e0b6f171d4f2acfd99 -r 65a1a1a1655224d8bf1a8e32dde0e70f11f2d5ca templates/webapps/tool_shed/repository/common.mako
--- a/templates/webapps/tool_shed/repository/common.mako
+++ b/templates/webapps/tool_shed/repository/common.mako
@@ -445,18 +445,8 @@
parent="${parent}"
%endif
id="libraryItem-${encoded_id}">
- <style type="text/css">
- #failed_test_table{ table-layout:fixed;
- width:100%;
- overflow-wrap:normal;
- overflow:hidden;
- border:0px;
- word-break:keep-all;
- word-wrap:break-word;
- line-break:strict; }
- </style><td style="padding-left: ${pad+20}px;">
- <table id="failed_test_table">
+ <table id="failed_test_table" class="tool_test_results"><tr><td bgcolor="#FFFFCC"><b>Tool id:</b> ${failed_test.tool_id | h}</td></tr><tr><td><b>Tool version:</b> ${failed_test.tool_id | h}</td></tr><tr><td><b>Test:</b> ${failed_test.test_id | h}</td></tr>
@@ -573,18 +563,8 @@
parent="${parent}"
%endif
id="libraryItem-${encoded_id}">
- <style type="text/css">
- #missing_table{ table-layout:fixed;
- width:100%;
- overflow-wrap:normal;
- overflow:hidden;
- border:0px;
- word-break:keep-all;
- word-wrap:break-word;
- line-break:strict; }
- </style><td style="padding-left: ${pad+20}px;">
- <table id="missing_table">
+ <table id="missing_table" class="tool_test_results"><tr><td bgcolor="#FFFFCC"><b>Tool id:</b> ${missing_test_component.tool_id | h}</td></tr><tr><td><b>Tool version:</b> ${missing_test_component.tool_version | h}</td></tr><tr><td><b>Tool guid:</b> ${missing_test_component.tool_guid | h}</td></tr>
@@ -703,6 +683,19 @@
%></%def>
+<%def name="render_tool_test_results_css()">
+ <style type="text/css">
+ table.tool_test_results{ table-layout:fixed;
+ width:100%;
+ overflow-wrap:normal;
+ overflow:hidden;
+ border:0px;
+ word-break:keep-all;
+ word-wrap:break-word;
+ line-break:strict; }
+ </style>
+</%def>
+
<%def name="render_tool_dependency_installation_error( installation_error, pad, parent, row_counter, row_is_header=False )"><% encoded_id = trans.security.encode_id( installation_error.id ) %><tr class="datasetRow"
@@ -710,18 +703,8 @@
parent="${parent}"
%endif
id="libraryItem-${encoded_id}">
- <style type="text/css">
- #td_install_error_table{ table-layout:fixed;
- width:100%;
- overflow-wrap:normal;
- overflow:hidden;
- border:0px;
- word-break:keep-all;
- word-wrap:break-word;
- line-break:strict; }
- </style><td style="padding-left: ${pad+20}px;">
- <table id="td_install_error_table">
+ <table id="td_install_error_table" class="tool_test_results"><tr bgcolor="#FFFFCC"><th>Type</th><th>Name</th><th>Version</th></tr>
@@ -748,18 +731,8 @@
parent="${parent}"
%endif
id="libraryItem-${encoded_id}">
- <style type="text/css">
- #rd_install_error_table{ table-layout:fixed;
- width:100%;
- overflow-wrap:normal;
- overflow:hidden;
- border:0px;
- word-break:keep-all;
- word-wrap:break-word;
- line-break:strict; }
- </style><td style="padding-left: ${pad+20}px;">
- <table id="rd_install_error_table">
+ <table id="rd_install_error_table" class="tool_test_results">
%if not is_current_repository:
<tr bgcolor="#FFFFCC"><th>Tool shed</th><th>Name</th><th>Owner</th><th>Changeset revision</th>
@@ -789,18 +762,8 @@
parent="${parent}"
%endif
id="libraryItem-${encoded_id}">
- <style type="text/css">
- #not_tested_table{ table-layout:fixed;
- width:100%;
- overflow-wrap:normal;
- overflow:hidden;
- border:0px;
- word-break:keep-all;
- word-wrap:break-word;
- line-break:strict; }
- </style><td style="padding-left: ${pad+20}px;">
- <table id="not_tested_table">
+ <table id="not_tested_table" class="tool_test_results"><tr><td>${not_tested.reason | h}</td></tr></table></td>
@@ -818,18 +781,8 @@
parent="${parent}"
%endif
id="libraryItem-${encoded_id}">
- <style type="text/css">
- #passed_tests_table{ table-layout:fixed;
- width:100%;
- overflow-wrap:normal;
- overflow:hidden;
- border:0px;
- word-break:keep-all;
- word-wrap:break-word;
- line-break:strict; }
- </style><td style="padding-left: ${pad+20}px;">
- <table id="passed_tests_table">
+ <table id="passed_tests_table" class="tool_test_results"><tr><td bgcolor="#FFFFCC"><b>Tool id:</b> ${passed_test.tool_id | h}</td></tr><tr><td><b>Tool version:</b> ${passed_test.tool_id | h}</td></tr><tr><td><b>Test:</b> ${passed_test.test_id | h}</td></tr>
@@ -1206,6 +1159,7 @@
</div>
%endif
%if tool_test_results_root_folder:
+ ${render_tool_test_results_css()}
<p/><div class="toolForm"><div class="toolFormTitle">Automated tool test results</div>
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
0
commit/galaxy-central: Dave Bouvier: When checking tool shed repositories for functional tests and test data, explicitly filter out metadata records that have been specified not to be tested by the repository owner.
by commits-noreply@bitbucket.org 29 Jul '13
by commits-noreply@bitbucket.org 29 Jul '13
29 Jul '13
1 new commit in galaxy-central:
https://bitbucket.org/galaxy/galaxy-central/commits/5ad8db7ff748/
Changeset: 5ad8db7ff748
User: Dave Bouvier
Date: 2013-07-29 19:50:55
Summary: When checking tool shed repositories for functional tests and test data, explicitly filter out metadata records that have been specified not to be tested by the repository owner.
Affected #: 1 file
diff -r fe04978dadac9974ab1954ab2091539e58caf3e4 -r 5ad8db7ff74881f13420f9e0b6f171d4f2acfd99 lib/tool_shed/scripts/check_repositories_for_functional_tests.py
--- a/lib/tool_shed/scripts/check_repositories_for_functional_tests.py
+++ b/lib/tool_shed/scripts/check_repositories_for_functional_tests.py
@@ -24,7 +24,7 @@
import galaxy.webapps.tool_shed.config as tool_shed_config
import galaxy.webapps.tool_shed.model.mapping
import sqlalchemy as sa
-from galaxy.model.orm import and_, not_
+from galaxy.model.orm import and_, not_, select
from galaxy.util.json import from_json_string, to_json_string
from galaxy.web import url_for
from galaxy.tools import parameters
@@ -200,6 +200,7 @@
}
'''
start = time.time()
+ skip_metadata_ids = []
checked_repository_ids = []
tool_count = 0
has_tests = 0
@@ -208,13 +209,16 @@
valid_revisions = 0
invalid_revisions = 0
records_checked = 0
+ # Do not check metadata records that have an entry in the skip_tool_tests table, since they won't be tested anyway.
+ skip_metadata_ids = select( [ app.model.SkipToolTest.table.c.repository_metadata_id ] )
# Get the list of metadata records to check for functional tests and test data. Limit this to records that have not been flagged do_not_test,
# since there's no need to check them again if they won't be tested anyway. Also filter out changeset revisions that are not downloadable,
# because it's redundant to test a revision that a user can't install.
for metadata_record in app.sa_session.query( app.model.RepositoryMetadata ) \
.filter( and_( app.model.RepositoryMetadata.table.c.downloadable == True,
app.model.RepositoryMetadata.table.c.includes_tools == True,
- app.model.RepositoryMetadata.table.c.do_not_test == False ) ):
+ app.model.RepositoryMetadata.table.c.do_not_test == False,
+ not_( app.model.RepositoryMetadata.table.c.id.in_( skip_metadata_ids ) ) ) ):
records_checked += 1
# Initialize the repository_status dict with the test environment, but leave the test_errors empty.
repository_status = {}
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
0
commit/galaxy-central: Dave Bouvier: Do not truncate tool test input dataset names, as Galaxy no longer displays them truncated.
by commits-noreply@bitbucket.org 29 Jul '13
by commits-noreply@bitbucket.org 29 Jul '13
29 Jul '13
1 new commit in galaxy-central:
https://bitbucket.org/galaxy/galaxy-central/commits/fe04978dadac/
Changeset: fe04978dadac
User: Dave Bouvier
Date: 2013-07-29 18:01:24
Summary: Do not truncate tool test input dataset names, as Galaxy no longer displays them truncated.
Affected #: 1 file
diff -r e19301cc51b90667ae829c6f9a61571f50906494 -r fe04978dadac9974ab1954ab2091539e58caf3e4 test/base/twilltestcase.py
--- a/test/base/twilltestcase.py
+++ b/test/base/twilltestcase.py
@@ -1191,13 +1191,7 @@
# This loop gets the filename/label for the selected values.
item_labels = [ item.attrs[ 'label' ] for item in control.get_items() if item.selected ]
for value in kwd[ control.name ]:
- # Galaxy truncates long file names in the dataset_collector in galaxy/tools/parameters/basic.py.
- # This (and other places where this is done) should be refactored to use the HDA id.
- if len( value ) > 30 and control.is_of_kind( 'singlelist' ):
- field_value = '%s..%s' % ( value[:17], value[-11:] )
- else:
- field_value = value
- if field_value not in control.value and True not in [ field_value in item_label for item_label in item_labels ]:
+ if value not in control.value and True not in [ value in item_label for item_label in item_labels ]:
changed = True
break
if changed:
@@ -1205,11 +1199,7 @@
control.clear()
# kwd[control.name] should be a singlelist
for elem in kwd[ control.name ]:
- if len( elem ) > 30 and control.is_of_kind( 'singlelist' ):
- elem_name = '%s..%s' % ( elem[:17], elem[-11:] )
- else:
- elem_name = elem
- tc.fv( f.name, control.name, str( elem_name ) )
+ tc.fv( f.name, control.name, str( elem ) )
# Create a new submit control, allows form to refresh, instead of going to next page
control = ClientForm.SubmitControl( 'SubmitControl', '___refresh_grouping___', {'name':'refresh_grouping'} )
control.add_to_form( f )
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
0
commit/galaxy-central: greg: Fix import in the tool shed's commit_util.
by commits-noreply@bitbucket.org 26 Jul '13
by commits-noreply@bitbucket.org 26 Jul '13
26 Jul '13
1 new commit in galaxy-central:
https://bitbucket.org/galaxy/galaxy-central/commits/e19301cc51b9/
Changeset: e19301cc51b9
User: greg
Date: 2013-07-26 15:10:23
Summary: Fix import in the tool shed's commit_util.
Affected #: 1 file
diff -r c55f7d1dc3a1e18b8f1b6e20157cc209caa647dd -r e19301cc51b90667ae829c6f9a61571f50906494 lib/tool_shed/util/commit_util.py
--- a/lib/tool_shed/util/commit_util.py
+++ b/lib/tool_shed/util/commit_util.py
@@ -1,4 +1,5 @@
import cStringIO
+import gzip
import logging
import os
import pkg_resources
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
0
commit/galaxy-central: jgoecks: Change ToolInput to ToolParameter in JavaScript tools implementation to match language used in model.
by commits-noreply@bitbucket.org 25 Jul '13
by commits-noreply@bitbucket.org 25 Jul '13
25 Jul '13
1 new commit in galaxy-central:
https://bitbucket.org/galaxy/galaxy-central/commits/c55f7d1dc3a1/
Changeset: c55f7d1dc3a1
User: jgoecks
Date: 2013-07-25 18:56:30
Summary: Change ToolInput to ToolParameter in JavaScript tools implementation to match language used in model.
Affected #: 1 file
diff -r a5a6c75e9af7098b4a4b35b917d49b8cc5abad43 -r c55f7d1dc3a1e18b8f1b6e20157cc209caa647dd static/scripts/mvc/tools.js
--- a/static/scripts/mvc/tools.js
+++ b/static/scripts/mvc/tools.js
@@ -33,9 +33,9 @@
});
/**
- * A tool input.
+ * A tool parameter.
*/
-var ToolInput = Backbone.RelationalModel.extend({
+var ToolParameter = Backbone.RelationalModel.extend({
defaults: {
name: null,
label: null,
@@ -49,7 +49,7 @@
},
copy: function() {
- return new ToolInput(this.toJSON());
+ return new ToolParameter(this.toJSON());
},
/**
@@ -88,7 +88,7 @@
{
type: Backbone.HasMany,
key: 'inputs',
- relatedModel: ToolInput,
+ relatedModel: ToolParameter,
reverseRelation: {
key: 'tool',
includeInJSON: false
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
0
commit/galaxy-central: Dave Bouvier: Fix for installing a repository with a complex tool dependency where the dependent repository's tool dependency definition does not define any set_environment actions.
by commits-noreply@bitbucket.org 25 Jul '13
by commits-noreply@bitbucket.org 25 Jul '13
25 Jul '13
1 new commit in galaxy-central:
https://bitbucket.org/galaxy/galaxy-central/commits/a5a6c75e9af7/
Changeset: a5a6c75e9af7
User: Dave Bouvier
Date: 2013-07-25 17:37:13
Summary: Fix for installing a repository with a complex tool dependency where the dependent repository's tool dependency definition does not define any set_environment actions.
Affected #: 1 file
diff -r 8059779d2a6ca853d43c5831fc7cfb70b65d6e55 -r a5a6c75e9af7098b4a4b35b917d49b8cc5abad43 lib/tool_shed/galaxy_install/tool_dependencies/install_util.py
--- a/lib/tool_shed/galaxy_install/tool_dependencies/install_util.py
+++ b/lib/tool_shed/galaxy_install/tool_dependencies/install_util.py
@@ -193,9 +193,9 @@
else:
action_dict[ 'environment_variable' ] = env_var_dicts
actions.append( ( 'set_environment', action_dict ) )
- return tool_dependency, actions
else:
raise NotImplementedError( 'Only install version 1.0 is currently supported (i.e., change your tag to be <install version="1.0">).' )
+ return tool_dependency, actions
return None, actions
def install_and_build_package_via_fabric( app, tool_dependency, actions_dict ):
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
0
commit/galaxy-central: greg: A bit of refactoring of the tool shed's repository controller.
by commits-noreply@bitbucket.org 25 Jul '13
by commits-noreply@bitbucket.org 25 Jul '13
25 Jul '13
1 new commit in galaxy-central:
https://bitbucket.org/galaxy/galaxy-central/commits/8059779d2a6c/
Changeset: 8059779d2a6c
User: greg
Date: 2013-07-25 17:01:18
Summary: A bit of refactoring of the tool shed's repository controller.
Affected #: 6 files
diff -r 2abd0819d354d3d11182297c7206408d299f0d16 -r 8059779d2a6ca853d43c5831fc7cfb70b65d6e55 lib/galaxy/webapps/tool_shed/controllers/repository.py
--- a/lib/galaxy/webapps/tool_shed/controllers/repository.py
+++ b/lib/galaxy/webapps/tool_shed/controllers/repository.py
@@ -1,7 +1,5 @@
-import ConfigParser
import logging
import os
-import re
import string
import tempfile
from time import gmtime
@@ -11,22 +9,21 @@
from galaxy import util
from galaxy import web
from galaxy.util.odict import odict
-from galaxy.util.expressions import ExpressionContext
from galaxy.web.base.controller import BaseUIController
from galaxy.web.form_builder import CheckboxField
-from galaxy.web.form_builder import build_select_field
from galaxy.webapps.tool_shed import model
from galaxy.webapps.tool_shed.model import directory_hash_id
from galaxy.web.framework.helpers import grids
from galaxy.util import json
from galaxy.model.orm import and_
-from galaxy.model.orm import or_
import tool_shed.util.shed_util_common as suc
from tool_shed.util import encoding_util
from tool_shed.util import metadata_util
from tool_shed.util import readme_util
from tool_shed.util import repository_dependency_util
+from tool_shed.util import repository_maintenance_util
from tool_shed.util import review_util
+from tool_shed.util import search_util
from tool_shed.util import tool_dependency_util
from tool_shed.util import tool_util
from tool_shed.util import workflow_util
@@ -48,7 +45,6 @@
log = logging.getLogger( __name__ )
-VALID_REPOSITORYNAME_RE = re.compile( "^[a-z0-9\_]+$" )
malicious_error = " This changeset cannot be downloaded because it potentially produces malicious behavior or contains inappropriate content."
malicious_error_can_push = " Correct this changeset as soon as possible, it potentially produces malicious behavior or contains inappropriate content."
@@ -142,7 +138,7 @@
return trans.response.send_redirect( web.url_for( controller='repository',
action='view_or_manage_repository',
**kwd ) )
- selected_changeset_revision, repository = self.__get_repository_from_refresh_on_change( trans, **kwd )
+ selected_changeset_revision, repository = suc.get_repository_from_refresh_on_change( trans, **kwd )
if repository:
return trans.response.send_redirect( web.url_for( controller='repository',
action='browse_repositories',
@@ -168,7 +164,7 @@
return trans.response.send_redirect( web.url_for( controller='repository',
action='deprecate',
**kwd ) )
- selected_changeset_revision, repository = self.__get_repository_from_refresh_on_change( trans, **kwd )
+ selected_changeset_revision, repository = suc.get_repository_from_refresh_on_change( trans, **kwd )
if repository:
return trans.response.send_redirect( web.url_for( controller='repository',
action='browse_repositories',
@@ -390,7 +386,7 @@
kwd[ 'message' ] = 'You must be logged in to set email alerts.'
kwd[ 'status' ] = 'error'
del kwd[ 'operation' ]
- selected_changeset_revision, repository = self.__get_repository_from_refresh_on_change( trans, **kwd )
+ selected_changeset_revision, repository = suc.get_repository_from_refresh_on_change( trans, **kwd )
if repository:
return trans.response.send_redirect( web.url_for( controller='repository',
action='browse_repositories',
@@ -421,7 +417,7 @@
kwd[ 'user_id' ] = trans.security.encode_id( repository.user.id )
else:
# The user selected a repository revision which results in a refresh_on_change.
- selected_changeset_revision, repository = self.__get_repository_from_refresh_on_change( trans, **kwd )
+ selected_changeset_revision, repository = suc.get_repository_from_refresh_on_change( trans, **kwd )
if repository:
return trans.response.send_redirect( web.url_for( controller='repository',
action='view_or_manage_repository',
@@ -449,7 +445,7 @@
return trans.response.send_redirect( web.url_for( controller='repository',
action='deprecate',
**kwd ) )
- selected_changeset_revision, repository = self.__get_repository_from_refresh_on_change( trans, **kwd )
+ selected_changeset_revision, repository = suc.get_repository_from_refresh_on_change( trans, **kwd )
if repository:
return trans.response.send_redirect( web.url_for( controller='repository',
action='browse_repositories',
@@ -478,7 +474,7 @@
self.repositories_by_user_grid.title = "Repositories owned by %s" % user.username
kwd[ 'user_id' ] = user_id
return self.repositories_by_user_grid( trans, **kwd )
- selected_changeset_revision, repository = self.__get_repository_from_refresh_on_change( trans, **kwd )
+ selected_changeset_revision, repository = suc.get_repository_from_refresh_on_change( trans, **kwd )
if repository:
# The user selected a repository revision which results in a refresh_on_change.
return trans.response.send_redirect( web.url_for( controller='repository',
@@ -796,7 +792,7 @@
category_id = kwd.get( 'id', None )
category = suc.get_category( trans, category_id )
kwd[ 'f-Category.name' ] = category.name
- selected_changeset_revision, repository = self.__get_repository_from_refresh_on_change( trans, **kwd )
+ selected_changeset_revision, repository = suc.get_repository_from_refresh_on_change( trans, **kwd )
if repository:
return trans.response.send_redirect( web.url_for( controller='repository',
action='preview_tools_in_changeset',
@@ -811,28 +807,6 @@
async_compatible=False ) ]
return self.valid_repository_grid( trans, **kwd )
- def __build_allow_push_select_field( self, trans, current_push_list, selected_value='none' ):
- options = []
- for user in trans.sa_session.query( trans.model.User ):
- if user.username not in current_push_list:
- options.append( user )
- return build_select_field( trans,
- objs=options,
- label_attr='username',
- select_field_name='allow_push',
- selected_value=selected_value,
- refresh_on_change=False,
- multiple=True )
-
- def __change_repository_name_in_hgrc_file( self, hgrc_file, new_name ):
- config = ConfigParser.ConfigParser()
- config.read( hgrc_file )
- config.read( hgrc_file )
- config.set( 'web', 'name', new_name )
- new_file = open( hgrc_file, 'wb' )
- config.write( new_file )
- new_file.close()
-
@web.expose
def check_for_updates( self, trans, **kwd ):
"""Handle a request from a local Galaxy instance."""
@@ -929,24 +903,6 @@
# Do all we can to eliminate spam.
return trans.show_error_message( "You must be logged in to contact the owner of a repository." )
- def __create_hgrc_file( self, trans, repository ):
- # At this point, an entry for the repository is required to be in the hgweb.config file so we can call repository.repo_path( trans.app ).
- # Since we support both http and https, we set push_ssl to False to override the default (which is True) in the mercurial api. The hg
- # purge extension purges all files and directories not being tracked by mercurial in the current repository. It'll remove unknown files
- # and empty directories. This is not currently used because it is not supported in the mercurial API.
- repo = hg.repository( suc.get_configured_ui(), path=repository.repo_path( trans.app ) )
- fp = repo.opener( 'hgrc', 'wb' )
- fp.write( '[paths]\n' )
- fp.write( 'default = .\n' )
- fp.write( 'default-push = .\n' )
- fp.write( '[web]\n' )
- fp.write( 'allow_push = %s\n' % repository.user.username )
- fp.write( 'name = %s\n' % repository.name )
- fp.write( 'push_ssl = false\n' )
- fp.write( '[extensions]\n' )
- fp.write( 'hgext.purge=' )
- fp.close()
-
@web.expose
def create_repository( self, trans, **kwd ):
message = kwd.get( 'message', '' )
@@ -968,7 +924,7 @@
repository_type = kwd.get( 'repository_type', rt_util.UNRESTRICTED )
if kwd.get( 'create_repository_button', False ):
error = False
- message = self.__validate_repository_name( name, trans.user )
+ message = repository_maintenance_util.validate_repository_name( name, trans.user )
if message:
error = True
if not description:
@@ -1002,7 +958,7 @@
lhs = "repos/%s/%s" % ( repository.user.username, repository.name )
trans.app.hgweb_config_manager.add_entry( lhs, repository_path )
# Create a .hg/hgrc file for the local repository
- self.__create_hgrc_file( trans, repository )
+ repository_maintenance_util.create_hgrc_file( trans, repository )
flush_needed = False
if category_ids:
# Create category associations
@@ -1061,7 +1017,7 @@
repository, tool, message = tool_util.load_tool_from_changeset_revision( trans, repository_id, changeset_revision, tool_config )
if message:
status = 'error'
- tool_state = self.__new_state( trans, tool, invalid=False )
+ tool_state = tool_util.new_state( trans, tool, invalid=False )
metadata = self.get_metadata( trans, repository_id, changeset_revision )
try:
return trans.fill_template( "/webapps/tool_shed/repository/tool_form.mako",
@@ -1176,7 +1132,11 @@
match_tuples = []
ok = True
if tool_ids or tool_names or tool_versions:
- ok, match_tuples = self.__search_repository_metadata( trans, exact_matches_checked, tool_ids=tool_ids, tool_names=tool_names, tool_versions=tool_versions )
+ ok, match_tuples = search_util.search_repository_metadata( trans,
+ exact_matches_checked,
+ tool_ids=tool_ids,
+ tool_names=tool_names,
+ tool_versions=tool_versions )
if ok:
kwd[ 'match_tuples' ] = match_tuples
# Render the list view
@@ -1195,7 +1155,7 @@
return self.install_matched_repository_grid( trans, **kwd )
else:
kwd[ 'message' ] = "tool id: <b>%s</b><br/>tool name: <b>%s</b><br/>tool version: <b>%s</b><br/>exact matches only: <b>%s</b>" % \
- ( self.__stringify( tool_ids ), self.__stringify( tool_names ), self.__stringify( tool_versions ), str( exact_matches_checked ) )
+ ( common_util.stringify( tool_ids ), common_util.stringify( tool_names ), common_util.stringify( tool_versions ), str( exact_matches_checked ) )
self.matched_repository_grid.title = "Repositories with matching tools"
return self.matched_repository_grid( trans, **kwd )
else:
@@ -1203,9 +1163,9 @@
status = "error"
exact_matches_check_box = CheckboxField( 'exact_matches', checked=exact_matches_checked )
return trans.fill_template( '/webapps/tool_shed/repository/find_tools.mako',
- tool_id=self.__stringify( tool_ids ),
- tool_name=self.__stringify( tool_names ),
- tool_version=self.__stringify( tool_versions ),
+ tool_id=common_util.stringify( tool_ids ),
+ tool_name=common_util.stringify( tool_names ),
+ tool_version=common_util.stringify( tool_versions ),
exact_matches_check_box=exact_matches_check_box,
message=message,
status=status )
@@ -1259,9 +1219,9 @@
match_tuples = []
ok = True
if workflow_names:
- ok, match_tuples = self.__search_repository_metadata( trans, exact_matches_checked, workflow_names=workflow_names )
+ ok, match_tuples = search_util.search_repository_metadata( trans, exact_matches_checked, workflow_names=workflow_names )
else:
- ok, match_tuples = self.__search_repository_metadata( trans, exact_matches_checked, workflow_names=[], all_workflows=True )
+ ok, match_tuples = search_util.search_repository_metadata( trans, exact_matches_checked, workflow_names=[], all_workflows=True )
if ok:
kwd[ 'match_tuples' ] = match_tuples
if trans.webapp.name == 'galaxy':
@@ -1279,7 +1239,7 @@
return self.install_matched_repository_grid( trans, **kwd )
else:
kwd[ 'message' ] = "workflow name: <b>%s</b><br/>exact matches only: <b>%s</b>" % \
- ( self.__stringify( workflow_names ), str( exact_matches_checked ) )
+ ( common_util.stringify( workflow_names ), str( exact_matches_checked ) )
self.matched_repository_grid.title = "Repositories with matching workflows"
return self.matched_repository_grid( trans, **kwd )
else:
@@ -1290,7 +1250,7 @@
workflow_names = []
exact_matches_check_box = CheckboxField( 'exact_matches', checked=exact_matches_checked )
return trans.fill_template( '/webapps/tool_shed/repository/find_workflows.mako',
- workflow_name=self.__stringify( workflow_names ),
+ workflow_name=common_util.stringify( workflow_names ),
exact_matches_check_box=exact_matches_check_box,
message=message,
status=status )
@@ -1559,23 +1519,6 @@
return encoding_util.tool_shed_encode( repository_dependencies )
return ''
- def __get_repository_from_refresh_on_change( self, trans, **kwd ):
- # The changeset_revision_select_field in several grids performs a refresh_on_change which sends in request parameters like
- # changeset_revison_1, changeset_revision_2, etc. One of the many select fields on the grid performed the refresh_on_change,
- # so we loop through all of the received values to see which value is not the repository tip. If we find it, we know the
- # refresh_on_change occurred and we have the necessary repository id and change set revision to pass on.
- repository_id = None
- v = None
- for k, v in kwd.items():
- changeset_revision_str = 'changeset_revision_'
- if k.startswith( changeset_revision_str ):
- repository_id = trans.security.encode_id( int( k.lstrip( changeset_revision_str ) ) )
- repository = suc.get_repository_in_tool_shed( trans, repository_id )
- if repository.tip( trans.app ) != v:
- return v, repository
- # This should never be reached - raise an exception?
- return v, None
-
@web.json
def get_repository_information( self, trans, repository_ids, changeset_revisions, **kwd ):
"""
@@ -1792,53 +1735,6 @@
status = kwd.get( 'status', 'done' )
return trans.fill_template( '/webapps/tool_shed/repository/help.mako', message=message, status=status, **kwd )
- def __in_tool_dict( self, tool_dict, exact_matches_checked, tool_id=None, tool_name=None, tool_version=None ):
- found = False
- if tool_id and not tool_name and not tool_version:
- tool_dict_tool_id = tool_dict[ 'id' ].lower()
- found = ( tool_id == tool_dict_tool_id ) or \
- ( not exact_matches_checked and tool_dict_tool_id.find( tool_id ) >= 0 )
- elif tool_name and not tool_id and not tool_version:
- tool_dict_tool_name = tool_dict[ 'name' ].lower()
- found = ( tool_name == tool_dict_tool_name ) or \
- ( not exact_matches_checked and tool_dict_tool_name.find( tool_name ) >= 0 )
- elif tool_version and not tool_id and not tool_name:
- tool_dict_tool_version = tool_dict[ 'version' ].lower()
- found = ( tool_version == tool_dict_tool_version ) or \
- ( not exact_matches_checked and tool_dict_tool_version.find( tool_version ) >= 0 )
- elif tool_id and tool_name and not tool_version:
- tool_dict_tool_id = tool_dict[ 'id' ].lower()
- tool_dict_tool_name = tool_dict[ 'name' ].lower()
- found = ( tool_id == tool_dict_tool_id and tool_name == tool_dict_tool_name ) or \
- ( not exact_matches_checked and tool_dict_tool_id.find( tool_id ) >= 0 and tool_dict_tool_name.find( tool_name ) >= 0 )
- elif tool_id and tool_version and not tool_name:
- tool_dict_tool_id = tool_dict[ 'id' ].lower()
- tool_dict_tool_version = tool_dict[ 'version' ].lower()
- found = ( tool_id == tool_dict_tool_id and tool_version == tool_dict_tool_version ) or \
- ( not exact_matches_checked and tool_dict_tool_id.find( tool_id ) >= 0 and tool_dict_tool_version.find( tool_version ) >= 0 )
- elif tool_version and tool_name and not tool_id:
- tool_dict_tool_version = tool_dict[ 'version' ].lower()
- tool_dict_tool_name = tool_dict[ 'name' ].lower()
- found = ( tool_version == tool_dict_tool_version and tool_name == tool_dict_tool_name ) or \
- ( not exact_matches_checked and tool_dict_tool_version.find( tool_version ) >= 0 and tool_dict_tool_name.find( tool_name ) >= 0 )
- elif tool_version and tool_name and tool_id:
- tool_dict_tool_version = tool_dict[ 'version' ].lower()
- tool_dict_tool_name = tool_dict[ 'name' ].lower()
- tool_dict_tool_id = tool_dict[ 'id' ].lower()
- found = ( tool_version == tool_dict_tool_version and \
- tool_name == tool_dict_tool_name and \
- tool_id == tool_dict_tool_id ) or \
- ( not exact_matches_checked and \
- tool_dict_tool_version.find( tool_version ) >= 0 and \
- tool_dict_tool_name.find( tool_name ) >= 0 and \
- tool_dict_tool_id.find( tool_id ) >= 0 )
- return found
-
- def __in_workflow_dict( self, workflow_dict, exact_matches_checked, workflow_name ):
- workflow_dict_workflow_name = workflow_dict[ 'name' ].lower()
- return ( workflow_name == workflow_dict_workflow_name ) or \
- ( not exact_matches_checked and workflow_dict_workflow_name.find( workflow_name ) >= 0 )
-
@web.expose
def index( self, trans, **kwd ):
message = kwd.get( 'message', '' )
@@ -1908,7 +1804,7 @@
status = kwd.get( 'status', 'error' )
render_repository_actions_for = kwd.get( 'render_repository_actions_for', 'tool_shed' )
repository, tool, error_message = tool_util.load_tool_from_changeset_revision( trans, repository_id, changeset_revision, tool_config )
- tool_state = self.__new_state( trans, tool, invalid=True )
+ tool_state = tool_util.new_state( trans, tool, invalid=True )
invalid_file_tups = []
if tool:
invalid_file_tups = tool_util.check_tool_input_params( trans.app,
@@ -1946,16 +1842,6 @@
message=message,
status='error' ) )
- def __make_same_length( self, list1, list2 ):
- # If either list is 1 item, we'll append to it until its length is the same as the other.
- if len( list1 ) == 1:
- for i in range( 1, len( list2 ) ):
- list1.append( list1[ 0 ] )
- elif len( list2 ) == 1:
- for i in range( 1, len( list1 ) ):
- list2.append( list2[ 0 ] )
- return list1, list2
-
@web.expose
@web.require_login( "manage email alerts" )
def manage_email_alerts( self, trans, **kwd ):
@@ -2035,7 +1921,7 @@
repository.long_description = long_description
flush_needed = True
if repository.times_downloaded == 0 and repo_name != repository.name:
- message = self.__validate_repository_name( repo_name, user )
+ message = repository_maintenance_util.validate_repository_name( repo_name, user )
if message:
error = True
else:
@@ -2045,7 +1931,7 @@
trans.app.hgweb_config_manager.change_entry( old_lhs, new_lhs, repo_dir )
# Change the entry in the repository's hgrc file.
hgrc_file = os.path.join( repo_dir, '.hg', 'hgrc' )
- self.__change_repository_name_in_hgrc_file( hgrc_file, repo_name )
+ repository_maintenance_util.change_repository_name_in_hgrc_file( hgrc_file, repo_name )
repository.name = repo_name
flush_needed = True
elif repository.times_downloaded != 0 and repo_name != repository.name:
@@ -2130,7 +2016,7 @@
current_allow_push_list = current_allow_push.split( ',' )
else:
current_allow_push_list = []
- allow_push_select_field = self.__build_allow_push_select_field( trans, current_allow_push_list )
+ allow_push_select_field = repository_maintenance_util.build_allow_push_select_field( trans, current_allow_push_list )
checked = alerts_checked or user.email in email_alerts
alerts_check_box = CheckboxField( 'alerts', checked=checked )
changeset_revision_select_field = grids_util.build_changeset_revision_select_field( trans,
@@ -2248,28 +2134,6 @@
self.email_alerts_repository_grid.title = "Set email alerts for repository changes"
return self.email_alerts_repository_grid( trans, **kwd )
- def __new_state( self, trans, tool, invalid=False ):
- """
- Create a new `DefaultToolState` for this tool. It will not be initialized
- with default values for inputs.
-
- Only inputs on the first page will be initialized unless `all_pages` is
- True, in which case all inputs regardless of page are initialized.
- """
- state = galaxy.tools.DefaultToolState()
- state.inputs = {}
- if invalid:
- # We're attempting to display a tool in the tool shed that has been determined to have errors of some kind.
- return state
- inputs = tool.inputs_by_page[ 0 ]
- context = ExpressionContext( state.inputs, parent=None )
- for input in inputs.itervalues():
- try:
- state.inputs[ input.name ] = input.get_initial_value( trans, context )
- except:
- state.inputs[ input.name ] = []
- return state
-
@web.json
def open_folder( self, trans, folder_path ):
# Avoid caching
@@ -2420,106 +2284,6 @@
message=message,
status=status )
- def __search_ids_names( self, tool_dict, exact_matches_checked, match_tuples, repository_metadata, tool_ids, tool_names ):
- for i, tool_id in enumerate( tool_ids ):
- tool_name = tool_names[ i ]
- if self.__in_tool_dict( tool_dict, exact_matches_checked, tool_id=tool_id, tool_name=tool_name ):
- match_tuples.append( ( repository_metadata.repository_id, repository_metadata.changeset_revision ) )
- return match_tuples
-
- def __search_ids_versions( self, tool_dict, exact_matches_checked, match_tuples, repository_metadata, tool_ids, tool_versions ):
- for i, tool_id in enumerate( tool_ids ):
- tool_version = tool_versions[ i ]
- if self.__in_tool_dict( tool_dict, exact_matches_checked, tool_id=tool_id, tool_version=tool_version ):
- match_tuples.append( ( repository_metadata.repository_id, repository_metadata.changeset_revision ) )
- return match_tuples
-
- def __search_names_versions( self, tool_dict, exact_matches_checked, match_tuples, repository_metadata, tool_names, tool_versions ):
- for i, tool_name in enumerate( tool_names ):
- tool_version = tool_versions[ i ]
- if self.__in_tool_dict( tool_dict, exact_matches_checked, tool_name=tool_name, tool_version=tool_version ):
- match_tuples.append( ( repository_metadata.repository_id, repository_metadata.changeset_revision ) )
- return match_tuples
-
- def __search_repository_metadata( self, trans, exact_matches_checked, tool_ids='', tool_names='', tool_versions='', workflow_names='', all_workflows=False ):
- match_tuples = []
- ok = True
- if tool_ids or tool_names or tool_versions:
- for repository_metadata in trans.sa_session.query( trans.model.RepositoryMetadata ) \
- .filter( trans.model.RepositoryMetadata.table.c.includes_tools == True ) \
- .join( trans.model.Repository ) \
- .filter( and_( trans.model.Repository.table.c.deleted == False,
- trans.model.Repository.table.c.deprecated == False ) ):
- metadata = repository_metadata.metadata
- if metadata:
- tools = metadata.get( 'tools', [] )
- for tool_dict in tools:
- if tool_ids and not tool_names and not tool_versions:
- for tool_id in tool_ids:
- if self.__in_tool_dict( tool_dict, exact_matches_checked, tool_id=tool_id ):
- match_tuples.append( ( repository_metadata.repository_id, repository_metadata.changeset_revision ) )
- elif tool_names and not tool_ids and not tool_versions:
- for tool_name in tool_names:
- if self.__in_tool_dict( tool_dict, exact_matches_checked, tool_name=tool_name ):
- match_tuples.append( ( repository_metadata.repository_id, repository_metadata.changeset_revision ) )
- elif tool_versions and not tool_ids and not tool_names:
- for tool_version in tool_versions:
- if self.__in_tool_dict( tool_dict, exact_matches_checked, tool_version=tool_version ):
- match_tuples.append( ( repository_metadata.repository_id, repository_metadata.changeset_revision ) )
- elif tool_ids and tool_names and not tool_versions:
- if len( tool_ids ) == len( tool_names ):
- match_tuples = self.__search_ids_names( tool_dict, exact_matches_checked, match_tuples, repository_metadata, tool_ids, tool_names )
- elif len( tool_ids ) == 1 or len( tool_names ) == 1:
- tool_ids, tool_names = self.__make_same_length( tool_ids, tool_names )
- match_tuples = self.__search_ids_names( tool_dict, exact_matches_checked, match_tuples, repository_metadata, tool_ids, tool_names )
- else:
- ok = False
- elif tool_ids and tool_versions and not tool_names:
- if len( tool_ids ) == len( tool_versions ):
- match_tuples = self.__search_ids_versions( tool_dict, exact_matches_checked, match_tuples, repository_metadata, tool_ids, tool_versions )
- elif len( tool_ids ) == 1 or len( tool_versions ) == 1:
- tool_ids, tool_versions = self.__make_same_length( tool_ids, tool_versions )
- match_tuples = self.__search_ids_versions( tool_dict, exact_matches_checked, match_tuples, repository_metadata, tool_ids, tool_versions )
- else:
- ok = False
- elif tool_versions and tool_names and not tool_ids:
- if len( tool_versions ) == len( tool_names ):
- match_tuples = self.__search_names_versions( tool_dict, exact_matches_checked, match_tuples, repository_metadata, tool_names, tool_versions )
- elif len( tool_versions ) == 1 or len( tool_names ) == 1:
- tool_versions, tool_names = self.__make_same_length( tool_versions, tool_names )
- match_tuples = self.__search_names_versions( tool_dict, exact_matches_checked, match_tuples, repository_metadata, tool_names, tool_versions )
- else:
- ok = False
- elif tool_versions and tool_names and tool_ids:
- if len( tool_versions ) == len( tool_names ) and len( tool_names ) == len( tool_ids ):
- for i, tool_version in enumerate( tool_versions ):
- tool_name = tool_names[ i ]
- tool_id = tool_ids[ i ]
- if self.__in_tool_dict( tool_dict, exact_matches_checked, tool_id=tool_id, tool_name=tool_name, tool_version=tool_version ):
- match_tuples.append( ( repository_metadata.repository_id, repository_metadata.changeset_revision ) )
- else:
- ok = False
- elif workflow_names or all_workflows:
- for repository_metadata in trans.sa_session.query( trans.model.RepositoryMetadata ) \
- .filter( trans.model.RepositoryMetadata.table.c.includes_workflows == True ) \
- .join( trans.model.Repository ) \
- .filter( and_( trans.model.Repository.table.c.deleted == False,
- trans.model.Repository.table.c.deprecated == False ) ):
- metadata = repository_metadata.metadata
- if metadata:
- # metadata[ 'workflows' ] is a list of tuples where each contained tuple is
- # [ <relative path to the .ga file in the repository>, <exported workflow dict> ]
- if workflow_names:
- workflow_tups = metadata.get( 'workflows', [] )
- workflows = [ workflow_tup[1] for workflow_tup in workflow_tups ]
- for workflow_dict in workflows:
- for workflow_name in workflow_names:
- if self.__in_workflow_dict( workflow_dict, exact_matches_checked, workflow_name ):
- match_tuples.append( ( repository_metadata.repository_id, repository_metadata.changeset_revision ) )
- elif all_workflows:
- match_tuples.append( ( repository_metadata.repository_id, repository_metadata.changeset_revision ) )
- return ok, match_tuples
-
@web.expose
def select_files_to_delete( self, trans, id, **kwd ):
message = kwd.get( 'message', '' )
@@ -2772,11 +2536,6 @@
action='sharable_owner',
owner=owner ) )
- def __stringify( self, list ):
- if list:
- return ','.join( list )
- return ''
-
@web.expose
def updated_changeset_revisions( self, trans, **kwd ):
"""
@@ -2806,24 +2565,6 @@
return changeset_hashes_str
return ''
- def __validate_repository_name( self, name, user ):
- # Repository names must be unique for each user, must be at least four characters
- # in length and must contain only lower-case letters, numbers, and the '_' character.
- if name in [ 'None', None, '' ]:
- return 'Enter the required repository name.'
- if name in [ 'repos' ]:
- return "The term <b>%s</b> is a reserved word in the tool shed, so it cannot be used as a repository name." % name
- for repository in user.active_repositories:
- if repository.name == name:
- return "You already have a repository named <b>%s</b>, so choose a different name." % name
- if len( name ) < 4:
- return "Repository names must be at least 4 characters in length."
- if len( name ) > 80:
- return "Repository names cannot be more than 80 characters in length."
- if not( VALID_REPOSITORYNAME_RE.match( name ) ):
- return "Repository names must contain only lower-case letters, numbers and underscore <b>_</b>."
- return ''
-
@web.expose
def view_changelog( self, trans, id, **kwd ):
message = kwd.get( 'message', '' )
diff -r 2abd0819d354d3d11182297c7206408d299f0d16 -r 8059779d2a6ca853d43c5831fc7cfb70b65d6e55 lib/galaxy/webapps/tool_shed/util/common_util.py
--- a/lib/galaxy/webapps/tool_shed/util/common_util.py
+++ b/lib/galaxy/webapps/tool_shed/util/common_util.py
@@ -25,3 +25,8 @@
trans.sa_session.add( item_rating )
trans.sa_session.flush()
return item_rating
+
+def stringify( list ):
+ if list:
+ return ','.join( list )
+ return ''
diff -r 2abd0819d354d3d11182297c7206408d299f0d16 -r 8059779d2a6ca853d43c5831fc7cfb70b65d6e55 lib/tool_shed/util/repository_maintenance_util.py
--- /dev/null
+++ b/lib/tool_shed/util/repository_maintenance_util.py
@@ -0,0 +1,75 @@
+import ConfigParser
+import logging
+import re
+import tool_shed.util.shed_util_common as suc
+from galaxy.web.form_builder import build_select_field
+
+from galaxy import eggs
+eggs.require('mercurial')
+
+from mercurial import commands
+from mercurial import hg
+from mercurial import patch
+from mercurial import ui
+
+log = logging.getLogger( __name__ )
+
+VALID_REPOSITORYNAME_RE = re.compile( "^[a-z0-9\_]+$" )
+
+def build_allow_push_select_field( trans, current_push_list, selected_value='none' ):
+ options = []
+ for user in trans.sa_session.query( trans.model.User ):
+ if user.username not in current_push_list:
+ options.append( user )
+ return build_select_field( trans,
+ objs=options,
+ label_attr='username',
+ select_field_name='allow_push',
+ selected_value=selected_value,
+ refresh_on_change=False,
+ multiple=True )
+
+def change_repository_name_in_hgrc_file( hgrc_file, new_name ):
+ config = ConfigParser.ConfigParser()
+ config.read( hgrc_file )
+ config.read( hgrc_file )
+ config.set( 'web', 'name', new_name )
+ new_file = open( hgrc_file, 'wb' )
+ config.write( new_file )
+ new_file.close()
+
+def create_hgrc_file( trans, repository ):
+ # At this point, an entry for the repository is required to be in the hgweb.config file so we can call repository.repo_path( trans.app ).
+ # Since we support both http and https, we set push_ssl to False to override the default (which is True) in the mercurial api. The hg
+ # purge extension purges all files and directories not being tracked by mercurial in the current repository. It'll remove unknown files
+ # and empty directories. This is not currently used because it is not supported in the mercurial API.
+ repo = hg.repository( suc.get_configured_ui(), path=repository.repo_path( trans.app ) )
+ fp = repo.opener( 'hgrc', 'wb' )
+ fp.write( '[paths]\n' )
+ fp.write( 'default = .\n' )
+ fp.write( 'default-push = .\n' )
+ fp.write( '[web]\n' )
+ fp.write( 'allow_push = %s\n' % repository.user.username )
+ fp.write( 'name = %s\n' % repository.name )
+ fp.write( 'push_ssl = false\n' )
+ fp.write( '[extensions]\n' )
+ fp.write( 'hgext.purge=' )
+ fp.close()
+
+def validate_repository_name( name, user ):
+ # Repository names must be unique for each user, must be at least four characters
+ # in length and must contain only lower-case letters, numbers, and the '_' character.
+ if name in [ 'None', None, '' ]:
+ return 'Enter the required repository name.'
+ if name in [ 'repos' ]:
+ return "The term <b>%s</b> is a reserved word in the tool shed, so it cannot be used as a repository name." % name
+ for repository in user.active_repositories:
+ if repository.name == name:
+ return "You already have a repository named <b>%s</b>, so choose a different name." % name
+ if len( name ) < 4:
+ return "Repository names must be at least 4 characters in length."
+ if len( name ) > 80:
+ return "Repository names cannot be more than 80 characters in length."
+ if not( VALID_REPOSITORYNAME_RE.match( name ) ):
+ return "Repository names must contain only lower-case letters, numbers and underscore <b>_</b>."
+ return ''
diff -r 2abd0819d354d3d11182297c7206408d299f0d16 -r 8059779d2a6ca853d43c5831fc7cfb70b65d6e55 lib/tool_shed/util/search_util.py
--- /dev/null
+++ b/lib/tool_shed/util/search_util.py
@@ -0,0 +1,161 @@
+import logging
+from galaxy.model.orm import and_
+
+log = logging.getLogger( __name__ )
+
+def in_tool_dict( tool_dict, exact_matches_checked, tool_id=None, tool_name=None, tool_version=None ):
+ found = False
+ if tool_id and not tool_name and not tool_version:
+ tool_dict_tool_id = tool_dict[ 'id' ].lower()
+ found = ( tool_id == tool_dict_tool_id ) or \
+ ( not exact_matches_checked and tool_dict_tool_id.find( tool_id ) >= 0 )
+ elif tool_name and not tool_id and not tool_version:
+ tool_dict_tool_name = tool_dict[ 'name' ].lower()
+ found = ( tool_name == tool_dict_tool_name ) or \
+ ( not exact_matches_checked and tool_dict_tool_name.find( tool_name ) >= 0 )
+ elif tool_version and not tool_id and not tool_name:
+ tool_dict_tool_version = tool_dict[ 'version' ].lower()
+ found = ( tool_version == tool_dict_tool_version ) or \
+ ( not exact_matches_checked and tool_dict_tool_version.find( tool_version ) >= 0 )
+ elif tool_id and tool_name and not tool_version:
+ tool_dict_tool_id = tool_dict[ 'id' ].lower()
+ tool_dict_tool_name = tool_dict[ 'name' ].lower()
+ found = ( tool_id == tool_dict_tool_id and tool_name == tool_dict_tool_name ) or \
+ ( not exact_matches_checked and tool_dict_tool_id.find( tool_id ) >= 0 and tool_dict_tool_name.find( tool_name ) >= 0 )
+ elif tool_id and tool_version and not tool_name:
+ tool_dict_tool_id = tool_dict[ 'id' ].lower()
+ tool_dict_tool_version = tool_dict[ 'version' ].lower()
+ found = ( tool_id == tool_dict_tool_id and tool_version == tool_dict_tool_version ) or \
+ ( not exact_matches_checked and tool_dict_tool_id.find( tool_id ) >= 0 and tool_dict_tool_version.find( tool_version ) >= 0 )
+ elif tool_version and tool_name and not tool_id:
+ tool_dict_tool_version = tool_dict[ 'version' ].lower()
+ tool_dict_tool_name = tool_dict[ 'name' ].lower()
+ found = ( tool_version == tool_dict_tool_version and tool_name == tool_dict_tool_name ) or \
+ ( not exact_matches_checked and tool_dict_tool_version.find( tool_version ) >= 0 and tool_dict_tool_name.find( tool_name ) >= 0 )
+ elif tool_version and tool_name and tool_id:
+ tool_dict_tool_version = tool_dict[ 'version' ].lower()
+ tool_dict_tool_name = tool_dict[ 'name' ].lower()
+ tool_dict_tool_id = tool_dict[ 'id' ].lower()
+ found = ( tool_version == tool_dict_tool_version and \
+ tool_name == tool_dict_tool_name and \
+ tool_id == tool_dict_tool_id ) or \
+ ( not exact_matches_checked and \
+ tool_dict_tool_version.find( tool_version ) >= 0 and \
+ tool_dict_tool_name.find( tool_name ) >= 0 and \
+ tool_dict_tool_id.find( tool_id ) >= 0 )
+ return found
+
+def in_workflow_dict( workflow_dict, exact_matches_checked, workflow_name ):
+ workflow_dict_workflow_name = workflow_dict[ 'name' ].lower()
+ return ( workflow_name == workflow_dict_workflow_name ) or \
+ ( not exact_matches_checked and workflow_dict_workflow_name.find( workflow_name ) >= 0 )
+
+def make_same_length( list1, list2 ):
+ # If either list is 1 item, we'll append to it until its length is the same as the other.
+ if len( list1 ) == 1:
+ for i in range( 1, len( list2 ) ):
+ list1.append( list1[ 0 ] )
+ elif len( list2 ) == 1:
+ for i in range( 1, len( list1 ) ):
+ list2.append( list2[ 0 ] )
+ return list1, list2
+
+def search_ids_names( tool_dict, exact_matches_checked, match_tuples, repository_metadata, tool_ids, tool_names ):
+ for i, tool_id in enumerate( tool_ids ):
+ tool_name = tool_names[ i ]
+ if in_tool_dict( tool_dict, exact_matches_checked, tool_id=tool_id, tool_name=tool_name ):
+ match_tuples.append( ( repository_metadata.repository_id, repository_metadata.changeset_revision ) )
+ return match_tuples
+
+def search_ids_versions( tool_dict, exact_matches_checked, match_tuples, repository_metadata, tool_ids, tool_versions ):
+ for i, tool_id in enumerate( tool_ids ):
+ tool_version = tool_versions[ i ]
+ if in_tool_dict( tool_dict, exact_matches_checked, tool_id=tool_id, tool_version=tool_version ):
+ match_tuples.append( ( repository_metadata.repository_id, repository_metadata.changeset_revision ) )
+ return match_tuples
+
+def search_names_versions( tool_dict, exact_matches_checked, match_tuples, repository_metadata, tool_names, tool_versions ):
+ for i, tool_name in enumerate( tool_names ):
+ tool_version = tool_versions[ i ]
+ if in_tool_dict( tool_dict, exact_matches_checked, tool_name=tool_name, tool_version=tool_version ):
+ match_tuples.append( ( repository_metadata.repository_id, repository_metadata.changeset_revision ) )
+ return match_tuples
+
+def search_repository_metadata( trans, exact_matches_checked, tool_ids='', tool_names='', tool_versions='', workflow_names='', all_workflows=False ):
+ match_tuples = []
+ ok = True
+ if tool_ids or tool_names or tool_versions:
+ for repository_metadata in trans.sa_session.query( trans.model.RepositoryMetadata ) \
+ .filter( trans.model.RepositoryMetadata.table.c.includes_tools == True ) \
+ .join( trans.model.Repository ) \
+ .filter( and_( trans.model.Repository.table.c.deleted == False,
+ trans.model.Repository.table.c.deprecated == False ) ):
+ metadata = repository_metadata.metadata
+ if metadata:
+ tools = metadata.get( 'tools', [] )
+ for tool_dict in tools:
+ if tool_ids and not tool_names and not tool_versions:
+ for tool_id in tool_ids:
+ if in_tool_dict( tool_dict, exact_matches_checked, tool_id=tool_id ):
+ match_tuples.append( ( repository_metadata.repository_id, repository_metadata.changeset_revision ) )
+ elif tool_names and not tool_ids and not tool_versions:
+ for tool_name in tool_names:
+ if in_tool_dict( tool_dict, exact_matches_checked, tool_name=tool_name ):
+ match_tuples.append( ( repository_metadata.repository_id, repository_metadata.changeset_revision ) )
+ elif tool_versions and not tool_ids and not tool_names:
+ for tool_version in tool_versions:
+ if in_tool_dict( tool_dict, exact_matches_checked, tool_version=tool_version ):
+ match_tuples.append( ( repository_metadata.repository_id, repository_metadata.changeset_revision ) )
+ elif tool_ids and tool_names and not tool_versions:
+ if len( tool_ids ) == len( tool_names ):
+ match_tuples = search_ids_names( tool_dict, exact_matches_checked, match_tuples, repository_metadata, tool_ids, tool_names )
+ elif len( tool_ids ) == 1 or len( tool_names ) == 1:
+ tool_ids, tool_names = make_same_length( tool_ids, tool_names )
+ match_tuples = search_ids_names( tool_dict, exact_matches_checked, match_tuples, repository_metadata, tool_ids, tool_names )
+ else:
+ ok = False
+ elif tool_ids and tool_versions and not tool_names:
+ if len( tool_ids ) == len( tool_versions ):
+ match_tuples = search_ids_versions( tool_dict, exact_matches_checked, match_tuples, repository_metadata, tool_ids, tool_versions )
+ elif len( tool_ids ) == 1 or len( tool_versions ) == 1:
+ tool_ids, tool_versions = make_same_length( tool_ids, tool_versions )
+ match_tuples = search_ids_versions( tool_dict, exact_matches_checked, match_tuples, repository_metadata, tool_ids, tool_versions )
+ else:
+ ok = False
+ elif tool_versions and tool_names and not tool_ids:
+ if len( tool_versions ) == len( tool_names ):
+ match_tuples = search_names_versions( tool_dict, exact_matches_checked, match_tuples, repository_metadata, tool_names, tool_versions )
+ elif len( tool_versions ) == 1 or len( tool_names ) == 1:
+ tool_versions, tool_names = make_same_length( tool_versions, tool_names )
+ match_tuples = search_names_versions( tool_dict, exact_matches_checked, match_tuples, repository_metadata, tool_names, tool_versions )
+ else:
+ ok = False
+ elif tool_versions and tool_names and tool_ids:
+ if len( tool_versions ) == len( tool_names ) and len( tool_names ) == len( tool_ids ):
+ for i, tool_version in enumerate( tool_versions ):
+ tool_name = tool_names[ i ]
+ tool_id = tool_ids[ i ]
+ if in_tool_dict( tool_dict, exact_matches_checked, tool_id=tool_id, tool_name=tool_name, tool_version=tool_version ):
+ match_tuples.append( ( repository_metadata.repository_id, repository_metadata.changeset_revision ) )
+ else:
+ ok = False
+ elif workflow_names or all_workflows:
+ for repository_metadata in trans.sa_session.query( trans.model.RepositoryMetadata ) \
+ .filter( trans.model.RepositoryMetadata.table.c.includes_workflows == True ) \
+ .join( trans.model.Repository ) \
+ .filter( and_( trans.model.Repository.table.c.deleted == False,
+ trans.model.Repository.table.c.deprecated == False ) ):
+ metadata = repository_metadata.metadata
+ if metadata:
+ # metadata[ 'workflows' ] is a list of tuples where each contained tuple is
+ # [ <relative path to the .ga file in the repository>, <exported workflow dict> ]
+ if workflow_names:
+ workflow_tups = metadata.get( 'workflows', [] )
+ workflows = [ workflow_tup[1] for workflow_tup in workflow_tups ]
+ for workflow_dict in workflows:
+ for workflow_name in workflow_names:
+ if in_workflow_dict( workflow_dict, exact_matches_checked, workflow_name ):
+ match_tuples.append( ( repository_metadata.repository_id, repository_metadata.changeset_revision ) )
+ elif all_workflows:
+ match_tuples.append( ( repository_metadata.repository_id, repository_metadata.changeset_revision ) )
+ return ok, match_tuples
diff -r 2abd0819d354d3d11182297c7206408d299f0d16 -r 8059779d2a6ca853d43c5831fc7cfb70b65d6e55 lib/tool_shed/util/shed_util_common.py
--- a/lib/tool_shed/util/shed_util_common.py
+++ b/lib/tool_shed/util/shed_util_common.py
@@ -804,6 +804,23 @@
contents.sort()
return contents
+def get_repository_from_refresh_on_change( trans, **kwd ):
+ # The changeset_revision_select_field in several grids performs a refresh_on_change which sends in request parameters like
+ # changeset_revison_1, changeset_revision_2, etc. One of the many select fields on the grid performed the refresh_on_change,
+ # so we loop through all of the received values to see which value is not the repository tip. If we find it, we know the
+ # refresh_on_change occurred and we have the necessary repository id and change set revision to pass on.
+ repository_id = None
+ v = None
+ for k, v in kwd.items():
+ changeset_revision_str = 'changeset_revision_'
+ if k.startswith( changeset_revision_str ):
+ repository_id = trans.security.encode_id( int( k.lstrip( changeset_revision_str ) ) )
+ repository = suc.get_repository_in_tool_shed( trans, repository_id )
+ if repository.tip( trans.app ) != v:
+ return v, repository
+ # This should never be reached - raise an exception?
+ return v, None
+
def get_repository_in_tool_shed( trans, id ):
"""Get a repository on the tool shed side from the database via id."""
return trans.sa_session.query( trans.model.Repository ).get( trans.security.decode_id( id ) )
diff -r 2abd0819d354d3d11182297c7206408d299f0d16 -r 8059779d2a6ca853d43c5831fc7cfb70b65d6e55 lib/tool_shed/util/tool_util.py
--- a/lib/tool_shed/util/tool_util.py
+++ b/lib/tool_shed/util/tool_util.py
@@ -11,6 +11,7 @@
from galaxy.tools import parameters
from galaxy.tools.parameters import dynamic_options
from galaxy.tools.search import ToolBoxSearch
+from galaxy.util.expressions import ExpressionContext
from galaxy.web.form_builder import SelectField
from tool_shed.util import xml_util
from galaxy.tools.actions.upload import UploadToolAction
@@ -890,6 +891,22 @@
pass
return tool, message
+def new_state( trans, tool, invalid=False ):
+ """Create a new `DefaultToolState` for the received tool. Only inputs on the first page will be initialized."""
+ state = galaxy.tools.DefaultToolState()
+ state.inputs = {}
+ if invalid:
+ # We're attempting to display a tool in the tool shed that has been determined to have errors, so is invalid.
+ return state
+ inputs = tool.inputs_by_page[ 0 ]
+ context = ExpressionContext( state.inputs, parent=None )
+ for input in inputs.itervalues():
+ try:
+ state.inputs[ input.name ] = input.get_initial_value( trans, context )
+ except:
+ state.inputs[ input.name ] = []
+ return state
+
def panel_entry_per_tool( tool_section_dict ):
# Return True if tool_section_dict looks like this.
# {<Tool guid> : [{ tool_config : <tool_config_file>, id: <ToolSection id>, version : <ToolSection version>, name : <TooSection name>}]}
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
0
commit/galaxy-central: greg: Add the ability to display tool form components that are inside conditionals for tools contained in repositories in the tool shed. Also fix tool shed functional tests I recently broke sue to messing with rendering readme files in tool shed repositories.
by commits-noreply@bitbucket.org 24 Jul '13
by commits-noreply@bitbucket.org 24 Jul '13
24 Jul '13
1 new commit in galaxy-central:
https://bitbucket.org/galaxy/galaxy-central/commits/2abd0819d354/
Changeset: 2abd0819d354
User: greg
Date: 2013-07-24 22:36:52
Summary: Add the ability to display tool form components that are inside conditionals for tools contained in repositories in the tool shed. Also fix tool shed functional tests I recently broke sue to messing with rendering readme files in tool shed repositories.
Affected #: 3 files
diff -r ab4582614f70e35bb1023f73d4d2dc409225bc21 -r 2abd0819d354d3d11182297c7206408d299f0d16 lib/galaxy/webapps/tool_shed/controllers/repository.py
--- a/lib/galaxy/webapps/tool_shed/controllers/repository.py
+++ b/lib/galaxy/webapps/tool_shed/controllers/repository.py
@@ -11,6 +11,7 @@
from galaxy import util
from galaxy import web
from galaxy.util.odict import odict
+from galaxy.util.expressions import ExpressionContext
from galaxy.web.base.controller import BaseUIController
from galaxy.web.form_builder import CheckboxField
from galaxy.web.form_builder import build_select_field
@@ -1060,7 +1061,7 @@
repository, tool, message = tool_util.load_tool_from_changeset_revision( trans, repository_id, changeset_revision, tool_config )
if message:
status = 'error'
- tool_state = self.__new_state( trans )
+ tool_state = self.__new_state( trans, tool, invalid=False )
metadata = self.get_metadata( trans, repository_id, changeset_revision )
try:
return trans.fill_template( "/webapps/tool_shed/repository/tool_form.mako",
@@ -1907,7 +1908,7 @@
status = kwd.get( 'status', 'error' )
render_repository_actions_for = kwd.get( 'render_repository_actions_for', 'tool_shed' )
repository, tool, error_message = tool_util.load_tool_from_changeset_revision( trans, repository_id, changeset_revision, tool_config )
- tool_state = self.__new_state( trans )
+ tool_state = self.__new_state( trans, tool, invalid=True )
invalid_file_tups = []
if tool:
invalid_file_tups = tool_util.check_tool_input_params( trans.app,
@@ -2247,7 +2248,7 @@
self.email_alerts_repository_grid.title = "Set email alerts for repository changes"
return self.email_alerts_repository_grid( trans, **kwd )
- def __new_state( self, trans, all_pages=False ):
+ def __new_state( self, trans, tool, invalid=False ):
"""
Create a new `DefaultToolState` for this tool. It will not be initialized
with default values for inputs.
@@ -2257,6 +2258,16 @@
"""
state = galaxy.tools.DefaultToolState()
state.inputs = {}
+ if invalid:
+ # We're attempting to display a tool in the tool shed that has been determined to have errors of some kind.
+ return state
+ inputs = tool.inputs_by_page[ 0 ]
+ context = ExpressionContext( state.inputs, parent=None )
+ for input in inputs.itervalues():
+ try:
+ state.inputs[ input.name ] = input.get_initial_value( trans, context )
+ except:
+ state.inputs[ input.name ] = []
return state
@web.json
diff -r ab4582614f70e35bb1023f73d4d2dc409225bc21 -r 2abd0819d354d3d11182297c7206408d299f0d16 templates/webapps/tool_shed/repository/tool_form.mako
--- a/templates/webapps/tool_shed/repository/tool_form.mako
+++ b/templates/webapps/tool_shed/repository/tool_form.mako
@@ -35,8 +35,11 @@
%elif input.type == "conditional":
%if tool_state.items():
<%
- group_state = tool_state[input.name][0]
- current_case = group_state['__current_case__']
+ try:
+ group_state = tool_state[ input.name ][ 0 ]
+ except Exception, e:
+ group_state = tool_state[ input.name ]
+ current_case = group_state[ '__current_case__' ]
group_prefix = prefix + input.name + "|"
%>
%if input.value_ref_in_group:
@@ -120,7 +123,7 @@
<div class="toolFormBody"><form id="tool_form" name="tool_form" action="" method="get"><input type="hidden" name="tool_state" value="${util.object_to_string( tool_state.encode( tool, app ) )}">
- ${do_inputs( tool.inputs_by_page[ tool_state.page ], tool_state.inputs, "" )}
+ ${do_inputs( tool.inputs_by_page[ tool_state.page ], tool_state.inputs, "" )}
</form></div></div>
diff -r ab4582614f70e35bb1023f73d4d2dc409225bc21 -r 2abd0819d354d3d11182297c7206408d299f0d16 test/tool_shed/functional/test_0000_basic_repository_features.py
--- a/test/tool_shed/functional/test_0000_basic_repository_features.py
+++ b/test/tool_shed/functional/test_0000_basic_repository_features.py
@@ -151,7 +151,7 @@
commit_message="Uploaded filtering.txt",
strings_displayed=[],
strings_not_displayed=[] )
- self.display_manage_repository_page( repository, strings_displayed=[ 'Readme file for filtering 1.1.0' ] )
+ self.display_manage_repository_page( repository, strings_displayed=[ 'Readme file for filtering 1.1.0' ] )
def test_0055_upload_filtering_test_data( self ):
'''Upload filtering test data.'''
@@ -219,19 +219,19 @@
commit_message="Uploaded readme.txt",
strings_displayed=[],
strings_not_displayed=[] )
- self.display_manage_repository_page( repository, strings_displayed=[ 'This is a readme file.' ] )
+ self.display_manage_repository_page( repository, strings_displayed=[ 'This is a readme file.' ] )
# Verify that there is a different readme file for each metadata revision.
metadata_revisions = self.get_repository_metadata_revisions( repository )
self.display_manage_repository_page( repository,
- strings_displayed=[ 'Readme file for filtering 1.1.0',
- 'This is a readme file.' ] )
+ strings_displayed=[ 'Readme file for filtering 1.1.0',
+ 'This is a readme file.' ] )
def test_0075_delete_readme_txt_file( self ):
'''Delete the readme.txt file.'''
repository = test_db_util.get_repository_by_name_and_owner( repository_name, common.test_user_1_name )
self.delete_files_from_repository( repository, filenames=[ 'readme.txt' ] )
self.check_count_of_metadata_revisions_associated_with_repository( repository, metadata_count=2 )
- self.display_manage_repository_page( repository, strings_displayed=[ 'Readme file for filtering 1.1.0' ] )
+ self.display_manage_repository_page( repository, strings_displayed=[ 'Readme file for filtering 1.1.0' ] )
def test_0080_search_for_valid_filter_tool( self ):
'''Search for the filtering tool by tool ID, name, and version.'''
@@ -335,7 +335,7 @@
commit_message="Uploaded new readme.txt with invalid ascii characters.",
strings_displayed=[],
strings_not_displayed=[] )
- self.display_manage_repository_page( repository, strings_displayed=[ 'These characters should not' ] )
+ self.display_manage_repository_page( repository, strings_displayed=[ 'These characters should not' ] )
def test_0130_verify_handling_of_invalid_characters( self ):
'''Load the above changeset in the change log and confirm that there is no server error displayed.'''
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
0
commit/galaxy-central: Dave Bouvier: Tool shed functional tests for repairing an installed repository.
by commits-noreply@bitbucket.org 24 Jul '13
by commits-noreply@bitbucket.org 24 Jul '13
24 Jul '13
1 new commit in galaxy-central:
https://bitbucket.org/galaxy/galaxy-central/commits/ab4582614f70/
Changeset: ab4582614f70
User: Dave Bouvier
Date: 2013-07-24 21:19:38
Summary: Tool shed functional tests for repairing an installed repository.
Affected #: 2 files
diff -r b42dfe74e237ea7f9c77059e427db92d9859bc67 -r ab4582614f70e35bb1023f73d4d2dc409225bc21 test/tool_shed/base/twilltestcase.py
--- a/test/tool_shed/base/twilltestcase.py
+++ b/test/tool_shed/base/twilltestcase.py
@@ -984,6 +984,12 @@
self.visit_url( url )
self.check_for_strings( [ 'All repository metadata has been reset.' ] )
+ def repair_installed_repository( self, repository ):
+ repository_id = self.security.encode_id( repository.id )
+ url = '/admin_toolshed/repair_repository?id=%s' % repository_id
+ self.visit_galaxy_url( url )
+ self.submit_form( 'repair_repository', 'repair_repository_button' )
+
def review_repository( self, repository, review_contents_dict, user=None, changeset_revision=None ):
strings_displayed = []
strings_not_displayed = []
diff -r b42dfe74e237ea7f9c77059e427db92d9859bc67 -r ab4582614f70e35bb1023f73d4d2dc409225bc21 test/tool_shed/functional/test_1430_repair_installed_repository.py
--- /dev/null
+++ b/test/tool_shed/functional/test_1430_repair_installed_repository.py
@@ -0,0 +1,180 @@
+from tool_shed.base.twilltestcase import ShedTwillTestCase, common, os
+import tool_shed.base.test_db_util as test_db_util
+
+import logging
+log = logging.getLogger( __name__ )
+
+category_name = 'Test 1430 Repair installed repository'
+category_description = 'Test script 1430 for repairing an installed repository.'
+filter_repository_name = 'filter_1430'
+column_repository_name = 'column_1430'
+filter_repository_description = "Galaxy's filter tool for test 1430"
+column_repository_description = 'Add a value as a new column'
+filter_repository_long_description = '%s: %s' % ( filter_repository_name, filter_repository_description )
+column_repository_long_description = '%s: %s' % ( column_repository_name, column_repository_description )
+
+'''
+In the Tool Shed:
+
+1) Create and populate the filter_1430 repository
+
+2) Create and populate the column_1430 repository
+
+3) Upload a repository_dependencies.xml file to the column_1430 repository that creates a repository dependency on the filter_1430 repository.
+
+In Galaxy:
+
+1) Install the column_1430 repository, making sure to check the checkbox to Handle repository dependencies so that the filter
+ repository is also installed. Make sure to install the repositories in a specified section of the tool panel.
+
+2) Uninstall the filter_1430 repository.
+
+3) Repair the column_1430 repository.
+
+4) Make sure the filter_1430 repository is reinstalled and the tool is loaded into the tool panel in the same section specified in step 1.
+'''
+
+class TestRepairRepository( ShedTwillTestCase ):
+ '''Test repairing an installed repository.'''
+
+ def test_0000_initiate_users_and_category( self ):
+ """Create necessary user accounts and login as an admin user."""
+ self.logout()
+ self.login( email=common.admin_email, username=common.admin_username )
+ admin_user = test_db_util.get_user( common.admin_email )
+ assert admin_user is not None, 'Problem retrieving user with email %s from the database' % common.admin_email
+ admin_user_private_role = test_db_util.get_private_role( admin_user )
+ self.create_category( name=category_name, description=category_description )
+ self.logout()
+ self.login( email=common.test_user_2_email, username=common.test_user_2_name )
+ test_user_2 = test_db_util.get_user( common.test_user_2_email )
+ assert test_user_2 is not None, 'Problem retrieving user with email %s from the database' % common.test_user_2_email
+ test_user_2_private_role = test_db_util.get_private_role( test_user_2 )
+ self.logout()
+ self.login( email=common.test_user_1_email, username=common.test_user_1_name )
+ test_user_1 = test_db_util.get_user( common.test_user_1_email )
+ assert test_user_1 is not None, 'Problem retrieving user with email %s from the database' % common.test_user_1_email
+ test_user_1_private_role = test_db_util.get_private_role( test_user_1 )
+
+ def test_0005_create_filter_repository( self ):
+ '''Create and populate the filter_1430 repository.'''
+ '''
+ This is step 1 - Create and populate the filter_1430 repository.
+
+ This repository will be depended on by the column_1430 repository.
+ '''
+ category = test_db_util.get_category_by_name( category_name )
+ repository = self.get_or_create_repository( name=filter_repository_name,
+ description=filter_repository_description,
+ long_description=filter_repository_long_description,
+ owner=common.test_user_1_name,
+ category_id=self.security.encode_id( category.id ),
+ strings_displayed=[] )
+ self.upload_file( repository,
+ filename='filtering/filtering_1.1.0.tar',
+ filepath=None,
+ valid_tools_only=True,
+ uncompress_file=True,
+ remove_repo_files_not_in_tar=False,
+ commit_message='Populate filter_1430 with version 1.1.0.',
+ strings_displayed=[],
+ strings_not_displayed=[] )
+
+ def test_0010_create_column_repository( self ):
+ '''Create and populate the column_1430 repository.'''
+ '''
+ This is step 2 - Create and populate the column_1430 repository.
+
+ This repository will depend on the filter_1430 repository.
+ '''
+ category = test_db_util.get_category_by_name( category_name )
+ repository = self.get_or_create_repository( name=column_repository_name,
+ description=column_repository_description,
+ long_description=column_repository_long_description,
+ owner=common.test_user_1_name,
+ category_id=self.security.encode_id( category.id ),
+ strings_displayed=[] )
+ self.upload_file( repository,
+ filename='column_maker/column_maker.tar',
+ filepath=None,
+ valid_tools_only=True,
+ uncompress_file=True,
+ remove_repo_files_not_in_tar=False,
+ commit_message='Populate column_1430 with tool definitions.',
+ strings_displayed=[],
+ strings_not_displayed=[] )
+
+ def test_0015_create_repository_dependency( self ):
+ '''Create a dependency on filter_1430.'''
+ '''
+ This is step 3 - Upload a repository_dependencies.xml file to the column_1430 repository that creates a repository
+ dependency on the filter_1430 repository.
+ '''
+ column_repository = test_db_util.get_repository_by_name_and_owner( 'column_1430', common.test_user_1_name )
+ filter_repository = test_db_util.get_repository_by_name_and_owner( 'filter_1430', common.test_user_1_name )
+ tool_shed_url = self.url
+ name = filter_repository.name
+ owner = filter_repository.user.username
+ changeset_revision = self.get_repository_tip( filter_repository )
+ repository_dependency_tuple = ( tool_shed_url, name, owner, changeset_revision )
+ filepath = self.generate_temp_path( '1430_repository_dependency' )
+ self.create_repository_dependency( column_repository, [ repository_dependency_tuple ], filepath=filepath )
+
+ def test_0020_install_column_repository( self ):
+ '''Install the column_1430 repository into Galaxy.'''
+ '''
+ This is step 1 (galaxy side) - Install the column_1430 repository, making sure to check the checkbox to
+ handle repository dependencies so that the filter_1430 repository is also installed. Make sure to install
+ the repositories in a specified section of the tool panel.
+ '''
+ self.galaxy_logout()
+ self.galaxy_login( email=common.admin_email, username=common.admin_username )
+ post_submit_strings_displayed = [ 'column_1430', 'filter_1430' ]
+ self.install_repository( 'column_1430',
+ common.test_user_1_name,
+ category_name,
+ new_tool_panel_section='repair',
+ post_submit_strings_displayed=post_submit_strings_displayed,
+ install_tool_dependencies=False,
+ install_repository_dependencies=True )
+
+ def test_0025_uninstall_filter_repository( self ):
+ '''Uninstall the filter_1430 repository from Galaxy.'''
+ '''
+ This is step 2 - Uninstall the filter_1430 repository.
+ '''
+ installed_repository = test_db_util.get_installed_repository_by_name_owner( 'filter_1430', common.test_user_1_name )
+ self.uninstall_repository( installed_repository, remove_from_disk=True )
+ strings_not_displayed = [ 'filter_1430',
+ "Galaxy's filter tool for test 1430",
+ installed_repository.installed_changeset_revision ]
+ self.display_galaxy_browse_repositories_page( strings_not_displayed=strings_not_displayed )
+
+ def test_0030_repair_column_repository( self ):
+ '''Repair the column_1430 repository.'''
+ '''
+ This is step 3 - Repair the column_1430 repository.
+ '''
+ column_repository = test_db_util.get_installed_repository_by_name_owner( 'column_1430', common.test_user_1_name )
+ self.repair_installed_repository( column_repository )
+
+ def test_0035_verify_tool_panel_section( self ):
+ '''Check the tool panel section after repairing.'''
+ '''
+ This is step 4 - Make sure the filter_1430 repository is reinstalled and the tool is loaded into the tool panel
+ in the same section specified in step 1.
+ '''
+ filter_repository = test_db_util.get_installed_repository_by_name_owner( 'filter_1430', common.test_user_1_name )
+ strings_displayed = [ 'filter_1430',
+ "Galaxy's filter tool for test 1430",
+ filter_repository.installed_changeset_revision ]
+ self.display_galaxy_browse_repositories_page( strings_displayed=strings_displayed )
+ # Uninstall the filter repository again, so that the tool panel section metadata gets populated.
+ self.uninstall_repository( filter_repository, remove_from_disk=True )
+ test_db_util.ga_refresh( filter_repository )
+ tool_panel_section_metadata = filter_repository.metadata[ 'tool_panel_section' ]
+ for tool_id in tool_panel_section_metadata:
+ for panel_section in tool_panel_section_metadata[ tool_id ]:
+ assert panel_section[ 'name' ] == 'repair', 'Tool %s in tool panel section %s after repair, expected %s.' % \
+ ( tool_id, panel_section[ 'name' ], 'repair' )
+
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
0
commit/galaxy-central: Dave Bouvier: Tool shed functional tests for the $ENV[] environment variable inheritance feature.
by commits-noreply@bitbucket.org 24 Jul '13
by commits-noreply@bitbucket.org 24 Jul '13
24 Jul '13
1 new commit in galaxy-central:
https://bitbucket.org/galaxy/galaxy-central/commits/b42dfe74e237/
Changeset: b42dfe74e237
User: Dave Bouvier
Date: 2013-07-24 19:39:47
Summary: Tool shed functional tests for the $ENV[] environment variable inheritance feature.
Affected #: 14 files
diff -r b9bd309b4b72cce4f5bd277cd628b3855934d1f1 -r b42dfe74e237ea7f9c77059e427db92d9859bc67 test/tool_shed/base/twilltestcase.py
--- a/test/tool_shed/base/twilltestcase.py
+++ b/test/tool_shed/base/twilltestcase.py
@@ -578,12 +578,8 @@
return None
def get_env_sh_path( self, tool_dependency_name, tool_dependency_version, repository ):
- env_sh_path = os.path.join( self.galaxy_tool_dependency_dir,
- tool_dependency_name,
- tool_dependency_version,
- repository.owner,
- repository.name,
- repository.installed_changeset_revision,
+ '''Return the absolute path to an installed repository's env.sh file.'''
+ env_sh_path = os.path.join( self.get_tool_dependency_path( tool_dependency_name, tool_dependency_version, repository ),
'env.sh' )
return env_sh_path
@@ -604,6 +600,15 @@
else:
last_review = None
return last_review
+
+ def get_tool_dependency_path( self, tool_dependency_name, tool_dependency_version, repository ):
+ '''Return the absolute path for an installed tool dependency.'''
+ return os.path.join( self.galaxy_tool_dependency_dir,
+ tool_dependency_name,
+ tool_dependency_version,
+ repository.owner,
+ repository.name,
+ repository.installed_changeset_revision )
def get_or_create_repository( self, owner=None, strings_displayed=[], strings_not_displayed=[], **kwd ):
repository = test_db_util.get_repository_by_name_and_owner( kwd[ 'name' ], owner )
diff -r b9bd309b4b72cce4f5bd277cd628b3855934d1f1 -r b42dfe74e237ea7f9c77059e427db92d9859bc67 test/tool_shed/functional/test_1420_tool_dependency_environment_inheritance.py
--- /dev/null
+++ b/test/tool_shed/functional/test_1420_tool_dependency_environment_inheritance.py
@@ -0,0 +1,320 @@
+from tool_shed.base.twilltestcase import ShedTwillTestCase, common, os
+import tool_shed.base.test_db_util as test_db_util
+
+import logging
+log = logging.getLogger( __name__ )
+
+category_name = 'Test 1420 Tool dependency environment variable inheritance'
+category_description = 'Test script 1420 for interpolation of inherited environment variables.'
+package_atlas_repository_name = 'package_atlas_3_10_1420'
+package_bzlib_repository_name = 'package_bzlib_1_0_1420'
+package_boost_repository_name = 'package_boost_1_53_1420'
+package_numpy_repository_name = 'package_numpy_1_7_1420'
+package_rdkit_repository_name = 'package_rdkit_2012_12_1420'
+package_lapack_repository_name = 'package_lapack_3_4_1420'
+package_atlas_repository_description = 'Automatically Tuned Linear Algebra Software'
+package_bzlib_repository_description = 'Contains a tool dependency definition that downloads and compiles version 1.0 of the bzlib library.'
+package_boost_repository_description = 'Contains a tool dependency definition that downloads and compiles version 1.53 of the boost C++ libraries'
+package_numpy_repository_description = 'Contains a tool dependency definition that downloads and compiles version 1.7 of the the python numpy package'
+package_rdkit_repository_description = 'Contains a tool dependency definition that downloads and compiles version 2012-12 of the RDKit cheminformatics and machine-learning package.'
+package_lapack_repository_description = 'Linear Algebra PACKage'
+package_atlas_repository_long_description = '%s: %s' % ( package_atlas_repository_name, package_atlas_repository_description )
+package_bzlib_repository_long_description = '%s: %s' % ( package_bzlib_repository_name, package_bzlib_repository_description )
+package_boost_repository_long_description = '%s: %s' % ( package_boost_repository_name, package_boost_repository_description )
+package_numpy_repository_long_description = '%s: %s' % ( package_numpy_repository_name, package_numpy_repository_description )
+package_rdkit_repository_long_description = '%s: %s' % ( package_rdkit_repository_name, package_rdkit_repository_description )
+package_lapack_repository_long_description = '%s: %s' % ( package_lapack_repository_name, package_lapack_repository_description )
+
+'''
+1. Create repository package_lapack_3_4_1420
+
+2. Create repository package_atlas_3_10_1420
+
+3. Create repository package_bzlib_1_0_1420
+
+4. Create repository package_boost_1_53_1420
+
+5. Create repository package_numpy_1_7_1420
+
+6. Create repository package_rdkit_2012_12_1420
+
+Repository dependency structure should be as follows:
+ Repository package_rdkit_2012_12_1420
+ Repository package_boost_1_53_1420 (prior install required)
+ Repository package_bzlib_1_0_1420 (prior install required)
+ Repository package_numpy_1_7_1420 (prior install required)
+ Repository package_lapack_3_4_1420 (prior install required)
+ Repository package_atlas_3_10_1420 (prior install required)
+
+8. Install package_rdkit_2012_12 into Galaxy.
+
+9. Verify that the env.sh file for package_rdkit_2012_12_1420 also defines the variables inherited from package_numpy_1_7_1420 and package_boost_1_53_1420.
+'''
+
+class TestEnvironmentInheritance( ShedTwillTestCase ):
+ '''Test referencing environment variables that were defined in a separate tool dependency.'''
+
+ def test_0000_initiate_users_and_category( self ):
+ """Create necessary user accounts and login as an admin user."""
+ self.logout()
+ self.login( email=common.admin_email, username=common.admin_username )
+ admin_user = test_db_util.get_user( common.admin_email )
+ assert admin_user is not None, 'Problem retrieving user with email %s from the database' % common.admin_email
+ admin_user_private_role = test_db_util.get_private_role( admin_user )
+ self.create_category( name=category_name, description=category_description )
+ self.logout()
+ self.login( email=common.test_user_2_email, username=common.test_user_2_name )
+ test_user_2 = test_db_util.get_user( common.test_user_2_email )
+ assert test_user_2 is not None, 'Problem retrieving user with email %s from the database' % common.test_user_2_email
+ test_user_2_private_role = test_db_util.get_private_role( test_user_2 )
+ self.logout()
+ self.login( email=common.test_user_1_email, username=common.test_user_1_name )
+ test_user_1 = test_db_util.get_user( common.test_user_1_email )
+ assert test_user_1 is not None, 'Problem retrieving user with email %s from the database' % common.test_user_1_email
+ test_user_1_private_role = test_db_util.get_private_role( test_user_1 )
+
+ def test_0005_create_lapack_repository( self ):
+ '''Create and populate package_lapack_3_4_1420.'''
+ '''
+ This is step 1 - Create repository package_lapack_3_4_1420.
+
+ All tool dependency definitions should download and extract a tarball containing precompiled binaries from the local
+ filesystem and install them into the path specified by $INSTALL_DIR.
+ '''
+ category = test_db_util.get_category_by_name( category_name )
+ repository = self.get_or_create_repository( name=package_lapack_repository_name,
+ description=package_lapack_repository_description,
+ long_description=package_lapack_repository_long_description,
+ owner=common.test_user_1_name,
+ category_id=self.security.encode_id( category.id ),
+ strings_displayed=[] )
+ # Load the original tool dependency definition into memory, then fill in the __PATH__ placeholder with the
+ # actual system path where the binary tarball is found.
+ tool_dependency_path = self.generate_temp_path( '1420_tool_dependency', additional_paths=[ 'package_lapack_3_4_1420' ] )
+ precompiled_binary_tarball = self.get_filename( '1420_files/binary_tarballs/lapack.tar' )
+ edited_tool_dependency_filename = self.get_filename( filepath=tool_dependency_path, filename='tool_dependencies.xml' )
+ original_tool_dependency = self.get_filename( '1420_files/package_lapack_3_4_1420/tool_dependencies.xml' )
+ tool_dependency_definition = file( original_tool_dependency, 'r' ).read().replace( '__PATH__', precompiled_binary_tarball )
+ file( edited_tool_dependency_filename, 'w' ).write( tool_dependency_definition )
+ # Upload the edited tool dependency definition to the package_lapack_3_4_1420 repository.
+ self.upload_file( repository,
+ filename='tool_dependencies.xml',
+ filepath=tool_dependency_path,
+ valid_tools_only=True,
+ uncompress_file=False,
+ remove_repo_files_not_in_tar=False,
+ commit_message='Populate package_lapack_3_4_1420 with tool dependency definitions.',
+ strings_displayed=[],
+ strings_not_displayed=[] )
+
+ def test_0010_create_atlas_repository( self ):
+ '''Create and populate package_atlas_3_10_1420.'''
+ '''
+ This is step 1 - Create repository package_atlas_3_10_1420.
+
+ All tool dependency definitions should download and extract a tarball containing precompiled binaries from the local
+ filesystem and install them into the path specified by $INSTALL_DIR.
+ '''
+ category = test_db_util.get_category_by_name( category_name )
+ repository = self.get_or_create_repository( name=package_atlas_repository_name,
+ description=package_atlas_repository_description,
+ long_description=package_atlas_repository_long_description,
+ owner=common.test_user_1_name,
+ category_id=self.security.encode_id( category.id ),
+ strings_displayed=[] )
+ # Load the original tool dependency definition into memory, then fill in the __PATH__ placeholder with the
+ # actual system path where the binary tarball is found.
+ tool_dependency_path = self.generate_temp_path( '1420_tool_dependency', additional_paths=[ 'package_atlas_3_10_1420' ] )
+ precompiled_binary_tarball = self.get_filename( '1420_files/binary_tarballs/atlas.tar' )
+ edited_tool_dependency_filename = self.get_filename( filepath=tool_dependency_path, filename='tool_dependencies.xml' )
+ original_tool_dependency = self.get_filename( '1420_files/package_atlas_3_10_1420/tool_dependencies.xml' )
+ tool_dependency_definition = file( original_tool_dependency, 'r' ).read().replace( '__PATH__', precompiled_binary_tarball )
+ file( edited_tool_dependency_filename, 'w' ).write( tool_dependency_definition )
+ # Upload the edited tool dependency definition to the package_atlas_3_10_1420 repository.
+ self.upload_file( repository,
+ filename='tool_dependencies.xml',
+ filepath=tool_dependency_path,
+ valid_tools_only=True,
+ uncompress_file=False,
+ remove_repo_files_not_in_tar=False,
+ commit_message='Populate package_atlas_3_10_1420 with tool dependency definitions.',
+ strings_displayed=[],
+ strings_not_displayed=[] )
+
+ def test_0015_create_bzlib_repository( self ):
+ '''Create and populate package_bzlib_1_0_1420.'''
+ '''
+ This is step 1 - Create repository package_bzlib_1_0_1420.
+
+ All tool dependency definitions should download and extract a tarball containing precompiled binaries from the local
+ filesystem and install them into the path specified by $INSTALL_DIR.
+ '''
+ category = test_db_util.get_category_by_name( category_name )
+ repository = self.get_or_create_repository( name=package_bzlib_repository_name,
+ description=package_bzlib_repository_description,
+ long_description=package_bzlib_repository_long_description,
+ owner=common.test_user_1_name,
+ category_id=self.security.encode_id( category.id ),
+ strings_displayed=[] )
+ # Load the original tool dependency definition into memory, then fill in the __PATH__ placeholder with the
+ # actual system path where the binary tarball is found.
+ tool_dependency_path = self.generate_temp_path( '1420_tool_dependency', additional_paths=[ 'package_bzlib_1_0_1420' ] )
+ precompiled_binary_tarball = self.get_filename( '1420_files/binary_tarballs/bzlib.tar' )
+ edited_tool_dependency_filename = self.get_filename( filepath=tool_dependency_path, filename='tool_dependencies.xml' )
+ original_tool_dependency = self.get_filename( '1420_files/package_bzlib_1_0_1420/tool_dependencies.xml' )
+ tool_dependency_definition = file( original_tool_dependency, 'r' ).read().replace( '__PATH__', precompiled_binary_tarball )
+ file( edited_tool_dependency_filename, 'w' ).write( tool_dependency_definition )
+ # Upload the edited tool dependency definition to the package_bzlib_1_0_1420 repository.
+ self.upload_file( repository,
+ filename='tool_dependencies.xml',
+ filepath=tool_dependency_path,
+ valid_tools_only=True,
+ uncompress_file=False,
+ remove_repo_files_not_in_tar=False,
+ commit_message='Populate package_bzlib_1_0_1420 with tool dependency definitions.',
+ strings_displayed=[],
+ strings_not_displayed=[] )
+
+ def test_0020_create_boost_repository( self ):
+ '''Create and populate package_boost_1_53_1420.'''
+ '''
+ This is step 1 - Create repository package_boost_1_53_1420.
+
+ All tool dependency definitions should download and extract a tarball containing precompiled binaries from the local
+ filesystem and install them into the path specified by $INSTALL_DIR.
+ '''
+ category = test_db_util.get_category_by_name( category_name )
+ repository = self.get_or_create_repository( name=package_boost_repository_name,
+ description=package_boost_repository_description,
+ long_description=package_boost_repository_long_description,
+ owner=common.test_user_1_name,
+ category_id=self.security.encode_id( category.id ),
+ strings_displayed=[] )
+ # Load the original tool dependency definition into memory, then fill in the __PATH__ placeholder with the
+ # actual system path where the binary tarball is found.
+ tool_dependency_path = self.generate_temp_path( '1420_tool_dependency', additional_paths=[ 'package_boost_1_53_1420' ] )
+ precompiled_binary_tarball = self.get_filename( '1420_files/binary_tarballs/boost.tar' )
+ edited_tool_dependency_filename = self.get_filename( filepath=tool_dependency_path, filename='tool_dependencies.xml' )
+ original_tool_dependency = self.get_filename( '1420_files/package_boost_1_53_1420/tool_dependencies.xml' )
+ tool_dependency_definition = file( original_tool_dependency, 'r' ).read().replace( '__PATH__', precompiled_binary_tarball )
+ file( edited_tool_dependency_filename, 'w' ).write( tool_dependency_definition )
+ # Upload the edited tool dependency definition to the package_boost_1_53_1420 repository.
+ self.upload_file( repository,
+ filename='tool_dependencies.xml',
+ filepath=tool_dependency_path,
+ valid_tools_only=True,
+ uncompress_file=False,
+ remove_repo_files_not_in_tar=False,
+ commit_message='Populate package_boost_1_53_1420 with tool dependency definitions.',
+ strings_displayed=[],
+ strings_not_displayed=[] )
+
+ def test_0025_create_numpy_repository( self ):
+ '''Create and populate package_numpy_1_7_1420.'''
+ '''
+ This is step 1 - Create repository package_numpy_1_7_1420.
+
+ All tool dependency definitions should download and extract a tarball containing precompiled binaries from the local
+ filesystem and install them into the path specified by $INSTALL_DIR.
+ '''
+ category = test_db_util.get_category_by_name( category_name )
+ repository = self.get_or_create_repository( name=package_numpy_repository_name,
+ description=package_numpy_repository_description,
+ long_description=package_numpy_repository_long_description,
+ owner=common.test_user_1_name,
+ category_id=self.security.encode_id( category.id ),
+ strings_displayed=[] )
+ # Load the original tool dependency definition into memory, then fill in the __PATH__ placeholder with the
+ # actual system path where the binary tarball is found.
+ tool_dependency_path = self.generate_temp_path( '1420_tool_dependency', additional_paths=[ 'package_numpy_1_7_1420' ] )
+ precompiled_binary_tarball = self.get_filename( '1420_files/binary_tarballs/numpy.tar' )
+ edited_tool_dependency_filename = self.get_filename( filepath=tool_dependency_path, filename='tool_dependencies.xml' )
+ original_tool_dependency = self.get_filename( '1420_files/package_numpy_1_7_1420/tool_dependencies.xml' )
+ tool_dependency_definition = file( original_tool_dependency, 'r' ).read().replace( '__PATH__', precompiled_binary_tarball )
+ file( edited_tool_dependency_filename, 'w' ).write( tool_dependency_definition )
+ # Upload the edited tool dependency definition to the package_numpy_1_7_1420 repository.
+ self.upload_file( repository,
+ filename='tool_dependencies.xml',
+ filepath=tool_dependency_path,
+ valid_tools_only=True,
+ uncompress_file=False,
+ remove_repo_files_not_in_tar=False,
+ commit_message='Populate package_numpy_1_7_1420 with tool dependency definitions.',
+ strings_displayed=[],
+ strings_not_displayed=[] )
+
+ def test_0030_create_rdkit_repository( self ):
+ '''Create and populate package_rdkit_2012_12_1420.'''
+ '''
+ This is step 1 - Create repository package_rdkit_2012_12_1420.
+
+ All tool dependency definitions should download and extract a tarball containing precompiled binaries from the local
+ filesystem and install them into the path specified by $INSTALL_DIR.
+ '''
+ category = test_db_util.get_category_by_name( category_name )
+ repository = self.get_or_create_repository( name=package_rdkit_repository_name,
+ description=package_rdkit_repository_description,
+ long_description=package_rdkit_repository_long_description,
+ owner=common.test_user_1_name,
+ category_id=self.security.encode_id( category.id ),
+ strings_displayed=[] )
+ # Load the original tool dependency definition into memory, then fill in the __PATH__ placeholder with the
+ # actual system path where the binary tarball is found.
+ tool_dependency_path = self.generate_temp_path( '1420_tool_dependency', additional_paths=[ 'package_rdkit_2012_12_1420' ] )
+ precompiled_binary_tarball = self.get_filename( '1420_files/binary_tarballs/rdkit.tar' )
+ edited_tool_dependency_filename = self.get_filename( filepath=tool_dependency_path, filename='tool_dependencies.xml' )
+ original_tool_dependency = self.get_filename( '1420_files/package_rdkit_2012_12_1420/tool_dependencies.xml' )
+ tool_dependency_definition = file( original_tool_dependency, 'r' ).read().replace( '__PATH__', precompiled_binary_tarball )
+ file( edited_tool_dependency_filename, 'w' ).write( tool_dependency_definition )
+ # Upload the edited tool dependency definition to the package_rdkit_2012_12_1420 repository.
+ self.upload_file( repository,
+ filename='tool_dependencies.xml',
+ filepath=tool_dependency_path,
+ valid_tools_only=True,
+ uncompress_file=False,
+ remove_repo_files_not_in_tar=False,
+ commit_message='Populate package_rdkit_2012_12_1420 with tool dependency definitions.',
+ strings_displayed=[],
+ strings_not_displayed=[] )
+
+ def test_0035_install_rdkit_2012_12_repository( self ):
+ '''Install the package_rdkit_2012_12_1420 repository into Galaxy.'''
+ '''
+ This is step 4 - Install package_rdkit_2012_12_1420 into Galaxy.
+
+ Install package_rdkit_2012_12_1420 with tool dependencies selected to be installed. The result of this should be
+ package_atlas_3_10_1420, package_bzlib_1_0_1420, package_boost_1_53_1420, package_numpy_1_7_1420, package_rdkit_2012_12_1420,
+ and package_lapack_3_4_1420 being installed, and an env.sh generated for package_rdkit_2012_12_1420 that
+ contains environment variables defined in package_boost_1_53_1420 and package_numpy_1_7_1420.
+ '''
+ self.galaxy_logout()
+ self.galaxy_login( email=common.admin_email, username=common.admin_username )
+ post_submit_strings_displayed = [ 'package_rdkit_2012_12_1420', 'package_atlas_3_10_1420', 'package_bzlib_1_0_1420',
+ 'package_numpy_1_7_1420', 'package_lapack_3_4_1420', 'package_boost_1_53_1420' ]
+ self.install_repository( 'package_rdkit_2012_12_1420',
+ common.test_user_1_name,
+ category_name,
+ install_tool_dependencies=True,
+ post_submit_strings_displayed=post_submit_strings_displayed )
+
+ def test_0040_verify_env_sh_contents( self ):
+ '''Check the env.sh file for the appropriate contents.'''
+ '''
+ This is step 5 - Verify that the env.sh file for package_rdkit_2012_12_1420 also defines the variables inherited from package_numpy_1_7_1420
+ and package_boost_1_53_1420. Test for the numpy and boost tool dependency paths.
+ '''
+ package_rdkit_repository = test_db_util.get_installed_repository_by_name_owner( 'package_rdkit_2012_12_1420', common.test_user_1_name )
+ package_numpy_repository = test_db_util.get_installed_repository_by_name_owner( 'package_numpy_1_7_1420', common.test_user_1_name )
+ package_boost_repository = test_db_util.get_installed_repository_by_name_owner( 'package_boost_1_53_1420', common.test_user_1_name )
+ rdkit_env_sh = self.get_env_sh_path( tool_dependency_name='rdkit',
+ tool_dependency_version='2012_12_1',
+ repository=package_rdkit_repository )
+ numpy_tool_dependency_path = self.get_tool_dependency_path( tool_dependency_name='numpy',
+ tool_dependency_version='1.7.1',
+ repository=package_numpy_repository )
+ boost_tool_dependency_path = self.get_tool_dependency_path( tool_dependency_name='boost',
+ tool_dependency_version='1.53.0',
+ repository=package_boost_repository )
+ rdkit_env_file_contents = file( rdkit_env_sh, 'r' ).read()
+ assert numpy_tool_dependency_path in rdkit_env_file_contents, 'Environment file for package_rdkit_2012_12_1420 does not contain numpy path.'
+ assert boost_tool_dependency_path in rdkit_env_file_contents, 'Environment file for package_rdkit_2012_12_1420 does not contain boost path.'
diff -r b9bd309b4b72cce4f5bd277cd628b3855934d1f1 -r b42dfe74e237ea7f9c77059e427db92d9859bc67 test/tool_shed/test_data/1420_files/binary_tarballs/atlas.tar
Binary file test/tool_shed/test_data/1420_files/binary_tarballs/atlas.tar has changed
diff -r b9bd309b4b72cce4f5bd277cd628b3855934d1f1 -r b42dfe74e237ea7f9c77059e427db92d9859bc67 test/tool_shed/test_data/1420_files/binary_tarballs/boost.tar
Binary file test/tool_shed/test_data/1420_files/binary_tarballs/boost.tar has changed
diff -r b9bd309b4b72cce4f5bd277cd628b3855934d1f1 -r b42dfe74e237ea7f9c77059e427db92d9859bc67 test/tool_shed/test_data/1420_files/binary_tarballs/bzlib.tar
Binary file test/tool_shed/test_data/1420_files/binary_tarballs/bzlib.tar has changed
diff -r b9bd309b4b72cce4f5bd277cd628b3855934d1f1 -r b42dfe74e237ea7f9c77059e427db92d9859bc67 test/tool_shed/test_data/1420_files/binary_tarballs/lapack.tar
Binary file test/tool_shed/test_data/1420_files/binary_tarballs/lapack.tar has changed
diff -r b9bd309b4b72cce4f5bd277cd628b3855934d1f1 -r b42dfe74e237ea7f9c77059e427db92d9859bc67 test/tool_shed/test_data/1420_files/binary_tarballs/numpy.tar
Binary file test/tool_shed/test_data/1420_files/binary_tarballs/numpy.tar has changed
diff -r b9bd309b4b72cce4f5bd277cd628b3855934d1f1 -r b42dfe74e237ea7f9c77059e427db92d9859bc67 test/tool_shed/test_data/1420_files/binary_tarballs/rdkit.tar
Binary file test/tool_shed/test_data/1420_files/binary_tarballs/rdkit.tar has changed
diff -r b9bd309b4b72cce4f5bd277cd628b3855934d1f1 -r b42dfe74e237ea7f9c77059e427db92d9859bc67 test/tool_shed/test_data/1420_files/package_atlas_3_10_1420/tool_dependencies.xml
--- /dev/null
+++ b/test/tool_shed/test_data/1420_files/package_atlas_3_10_1420/tool_dependencies.xml
@@ -0,0 +1,22 @@
+<tool_dependency>
+ <package name="atlas" version="3.10.1">
+ <install version="1.0">
+ <actions>
+ <!-- first action is always downloading -->
+ <action type="download_file">file://__PATH__</action>
+ <action type="move_directory_files">
+ <source_directory>.</source_directory>
+ <destination_directory>$INSTALL_DIR</destination_directory>
+ </action>
+ <action type="set_environment">
+ <environment_variable name="ATLAS_LIB_DIR" action="set_to">$INSTALL_DIR/atlas/lib</environment_variable>
+ <environment_variable name="ATLAS_INCLUDE_DIR" action="set_to">$INSTALL_DIR/atlas/include</environment_variable>
+ </action>
+ </actions>
+ </install>
+ <readme>ATLAS_LIB_DIR and ATLAS_INCLUDE_DIR (including libatlas.a) will be exported for later use.
+ During ATLAS library compilation, ATLAS performs code efficiency checks. These checks can only provide optimal results, if "frequency scaling" is disabled on the CPU, and no other load-intense processes are running.
+ Ideally, you should compile on an empty cluster node with CPU frequency scaling disabled (see "cpufreq-selector" or "cpufreq-set").
+ </readme>
+ </package>
+</tool_dependency>
diff -r b9bd309b4b72cce4f5bd277cd628b3855934d1f1 -r b42dfe74e237ea7f9c77059e427db92d9859bc67 test/tool_shed/test_data/1420_files/package_boost_1_53_1420/tool_dependencies.xml
--- /dev/null
+++ b/test/tool_shed/test_data/1420_files/package_boost_1_53_1420/tool_dependencies.xml
@@ -0,0 +1,29 @@
+<?xml version='1.0' encoding='utf-8'?>
+<tool_dependency>
+ <package name="bzlib" version="1.0.6">
+ <repository name="package_bzlib_1_0_1420" owner="user1" prior_installation_required="True" />
+ </package>
+ <package name="boost" version="1.53.0">
+ <install version="1.0">
+ <actions>
+ <action type="download_by_url">file://__PATH__</action>
+
+ <!-- populate the environment variables from the dependend repos -->
+ <action type="set_environment_for_install">
+ <repository name="package_bzlib_1_0_1420" owner="user1">
+ <package name="bzlib" version="1.0.6" />
+ </repository>
+ </action>
+ <action type="move_directory_files">
+ <source_directory>.</source_directory>
+ <destination_directory>$INSTALL_DIR</destination_directory>
+ </action>
+ <action type="set_environment">
+ <environment_variable action="set_to" name="BOOST_ROOT_DIR">$INSTALL_DIR/boost</environment_variable>
+ <environment_variable action="append_to" name="LD_LIBRARY_PATH">$INSTALL_DIR/boost/lib/</environment_variable>
+ </action>
+ </actions>
+ </install>
+ <readme>Compiling boost requires a C++ compiler (typically gcc). You can access the boost root directory through the $BOOST_ROOT_DIR system variable. All modules will be build.</readme>
+ </package>
+</tool_dependency>
diff -r b9bd309b4b72cce4f5bd277cd628b3855934d1f1 -r b42dfe74e237ea7f9c77059e427db92d9859bc67 test/tool_shed/test_data/1420_files/package_bzlib_1_0_1420/tool_dependencies.xml
--- /dev/null
+++ b/test/tool_shed/test_data/1420_files/package_bzlib_1_0_1420/tool_dependencies.xml
@@ -0,0 +1,21 @@
+ <tool_dependency>
+ <package name="bzlib" version="1.0.6">
+ <install version="1.0">
+ <actions>
+ <!-- first action is always downloading -->
+ <action type="download_by_url">file://__PATH__</action>
+ <action type="move_directory_files">
+ <source_directory>.</source_directory>
+ <destination_directory>$INSTALL_DIR</destination_directory>
+ </action>
+ <action type="set_environment">
+ <environment_variable name="PATH" action="prepend_to">$INSTALL_DIR/bzlib/bin</environment_variable>
+ <environment_variable name="BZLIB_LIB_DIR" action="set_to">$INSTALL_DIR/bzlib/lib</environment_variable>
+ <environment_variable name="BZLIB_INCLUDE_DIR" action="set_to">$INSTALL_DIR/bzlib/include</environment_variable>
+ <environment_variable name="BZLIB_SOURCE_DIR" action="set_to">$INSTALL_DIR/bzlib/source</environment_variable>
+ </action>
+ </actions>
+ </install>
+ <readme>Compiling bzlib requires make and a C compiler. You can access bzlib with $BZLIB_LIB_DIR and $BZLIB_INCLUDE_DIR.</readme>
+ </package>
+</tool_dependency>
diff -r b9bd309b4b72cce4f5bd277cd628b3855934d1f1 -r b42dfe74e237ea7f9c77059e427db92d9859bc67 test/tool_shed/test_data/1420_files/package_lapack_3_4_1420/tool_dependencies.xml
--- /dev/null
+++ b/test/tool_shed/test_data/1420_files/package_lapack_3_4_1420/tool_dependencies.xml
@@ -0,0 +1,18 @@
+<tool_dependency>
+ <package name="lapack" version="3.4.2">
+ <install version="1.0">
+ <actions>
+ <!-- first action is always downloading -->
+ <action type="download_by_url">file://__PATH__</action>
+ <action type="move_directory_files">
+ <source_directory>.</source_directory>
+ <destination_directory>$INSTALL_DIR</destination_directory>
+ </action>
+ <action type="set_environment">
+ <environment_variable name="LAPACK_LIB_DIR" action="set_to">$INSTALL_DIR/lapack/lib</environment_variable>
+ </action>
+ </actions>
+ </install>
+ <readme>LAPACK requires gcc and gfortran. LAPACK_LIB_DIR will be set (including liblapack.a and libblas.a). </readme>
+ </package>
+</tool_dependency>
diff -r b9bd309b4b72cce4f5bd277cd628b3855934d1f1 -r b42dfe74e237ea7f9c77059e427db92d9859bc67 test/tool_shed/test_data/1420_files/package_numpy_1_7_1420/tool_dependencies.xml
--- /dev/null
+++ b/test/tool_shed/test_data/1420_files/package_numpy_1_7_1420/tool_dependencies.xml
@@ -0,0 +1,35 @@
+<?xml version='1.0' encoding='utf-8'?>
+<tool_dependency>
+ <package name="lapack" version="3.4.2">
+ <repository name="package_lapack_3_4_1420" owner="user1" prior_installation_required="True" />
+ </package>
+ <package name="atlas" version="3.10.1">
+ <repository name="package_atlas_3_10_1420" owner="user1" prior_installation_required="True" />
+ </package>
+ <package name="numpy" version="1.7.1">
+ <install version="1.0">
+ <actions>
+ <action type="download_by_url">file://__PATH__</action>
+ <action type="set_environment_for_install">
+ <repository name="package_atlas_3_10_1420" owner="user1">
+ <package name="atlas" version="3.10.1" />
+ </repository>
+ <repository name="package_lapack_3_4_1420" owner="user1">
+ <package name="lapack" version="3.4.2" />
+ </repository>
+ </action>
+ <action type="move_directory_files">
+ <source_directory>.</source_directory>
+ <destination_directory>$INSTALL_DIR</destination_directory>
+ </action>
+ <action type="set_environment">
+ <environment_variable action="append_to" name="PYTHONPATH">$INSTALL_DIR/lib/python</environment_variable>
+ <environment_variable action="prepend_to" name="PATH">$INSTALL_DIR/bin</environment_variable>
+ <environment_variable action="set_to" name="PYTHONPATH_NUMPY">$INSTALL_DIR/lib/python</environment_variable>
+ <environment_variable action="set_to" name="PATH_NUMPY">$INSTALL_DIR/bin</environment_variable>
+ </action>
+ </actions>
+ </install>
+ <readme>Compiling numpy requires a C and Fortran compiler (typically gcc and gfortran). The PYTHONPATH for numpy can be accessed through PYTHONPATH_NUMPY and the binaries with PATH_NUMPY.</readme>
+ </package>
+</tool_dependency>
diff -r b9bd309b4b72cce4f5bd277cd628b3855934d1f1 -r b42dfe74e237ea7f9c77059e427db92d9859bc67 test/tool_shed/test_data/1420_files/package_rdkit_2012_12_1420/tool_dependencies.xml
--- /dev/null
+++ b/test/tool_shed/test_data/1420_files/package_rdkit_2012_12_1420/tool_dependencies.xml
@@ -0,0 +1,43 @@
+<?xml version='1.0' encoding='utf-8'?>
+<tool_dependency>
+ <package name="numpy" version="1.7.1">
+ <repository name="package_numpy_1_7_1420" owner="user1" prior_installation_required="True" />
+ </package>
+ <package name="boost" version="1.53.0">
+ <repository name="package_boost_1_53_1420" owner="user1" prior_installation_required="True" />
+ </package>
+
+ <package name="rdkit" version="2012_12_1">
+ <install version="1.0">
+ <actions>
+ <!-- first action is always downloading -->
+ <action type="download_by_url">file://__PATH__</action>
+
+ <!-- populate the environment variables from the dependend repos -->
+ <action type="set_environment_for_install">
+ <repository name="package_numpy_1_7_1420" owner="user1">
+ <package name="numpy" version="1.7.1" />
+ </repository>
+ <repository name="package_boost_1_53_1420" owner="user1">
+ <package name="boost" version="1.53.0" />
+ </repository>
+ </action>
+
+ <!-- PYTHONPATH_NUMPY is set in the numpy package -->
+ <action type="move_directory_files">
+ <source_directory>.</source_directory>
+ <destination_directory>$INSTALL_DIR</destination_directory>
+ </action>
+ <action type="set_environment">
+ <environment_variable action="set_to" name="RDBASE">$INSTALL_DIR/rdkit</environment_variable>
+ <environment_variable action="append_to" name="LD_LIBRARY_PATH">$INSTALL_DIR/rdkit/lib/</environment_variable>
+ <environment_variable action="prepend_to" name="PATH">$INSTALL_DIR/rdkit/bin</environment_variable>
+ <environment_variable action="prepend_to" name="PYTHONPATH">$INSTALL_DIR/rdkit/lib/python2.7/site-packages/</environment_variable>
+ <environment_variable action="prepend_to" name="PYTHONPATH">$ENV[PYTHONPATH_NUMPY]</environment_variable>
+ <environment_variable action="append_to" name="LD_LIBRARY_PATH">$ENV[BOOST_ROOT_DIR]/lib/</environment_variable>
+ </action>
+ </actions>
+ </install>
+ <readme>Compiling rdkit requires cmake, python headers, sqlite3, flex and bison.</readme>
+ </package>
+</tool_dependency>
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
0