Merge pull request #99 from jmchilton/travis_enhance_1

TraivsCI: More comprehensive checks for *very* broken stuff.
This commit is contained in:
Dannon Baker
2015-04-09 07:35:08 -04:00
10 changed files with 16 additions and 38 deletions
+5
View File
@@ -2,6 +2,11 @@
set -e
# Run broad range of checks over specific white-listed files, this uses
# the default checks defined in setup.cfg.
while read p; do
flake8 $(eval echo "$p")
done <.ci/pep8_sources.txt
# Look for obviously broken stuff lots more places.
flake8 --select=E901,E902,F821,F822,F823,F831 --exclude lib/galaxy/util/pastescript/serve.py lib/{galaxy,tool_shed} test/{api,unit}
-14
View File
@@ -210,19 +210,5 @@ class PopulatedExternalService( object ):
assert action, 'Action not found: %s' % actions_list
return action
def get_action_links( self ):
rval = []
param_dict = {}
param_dict['fields'] = Bunch( **self.service_instance.form_values.content )
param_dict['item'] = self.item
for item in self.service.items:
if isinstance( item, ExternalServiceParameter ):
param_dict[ item.name ] = item.get_value( param_dict )
elif isinstance( item, ExternalServiceAction ):
rval.append( item.get_action_access_link( self.item, trans, param_dict ) )
elif isinstance( item, ExternalServiceActionsGroup ):
rval.extend( item.populate( self.service_instance, item, param_dict ).get_action_links() )
else:
raise 'unknown item type found'
def __nonzero__( self ):
return self.actions.has_action()
@@ -1432,7 +1432,6 @@ class LibraryCommon( BaseUIController, UsesFormDefinitionsMixin, UsesExtendedMet
message = 'Select at least one dataset from the list of active datasets in your current history'
status = 'error'
upload_option = kwd.get( 'upload_option', 'import_from_history' )
widgets = self._get_populated_widgets( folder )
# Send list of data formats to the upload form so the "extension" select list can be populated dynamically
file_formats = trans.app.datatypes_registry.upload_file_formats
# Send list of genome builds to the form so the "dbkey" select list can be populated dynamically
@@ -1459,7 +1458,7 @@ class LibraryCommon( BaseUIController, UsesFormDefinitionsMixin, UsesExtendedMet
last_used_build=last_used_build,
roles_select_list=roles_select_list,
history=history,
widgets=widgets,
widgets=[],
template_id=template_id,
space_to_tab=space_to_tab,
link_data_only=link_data_only,
@@ -1515,16 +1514,6 @@ class LibraryCommon( BaseUIController, UsesFormDefinitionsMixin, UsesExtendedMet
upload_option_select_list.add_option( option_label, option_value, selected=option_value==upload_option )
return upload_option_select_list
def _get_populated_widgets( self, folder ):
# See if we have any inherited templates.
info_association, inherited = folder.get_info_association( inherited=True )
if info_association and info_association.inheritable:
widgets = folder.get_template_widgets( trans, get_contents=True )
# Retain contents of widget fields when form was submitted via refresh_on_change.
return self.populate_widgets_from_kwd( trans, widgets, **kwd )
else:
return []
@web.expose
def download_dataset_from_folder( self, trans, cntrller, id, library_id=None, **kwd ):
"""Catches the dataset id and displays file contents as directed"""
@@ -2584,8 +2573,8 @@ class LibraryCommon( BaseUIController, UsesFormDefinitionsMixin, UsesExtendedMet
# Deny access if the user is not an admin and does not have the LIBRARY_MANAGE and DATASET_MANAGE_PERMISSIONS permissions.
if not ( is_admin or \
( trans.app.security_agent.can_manage_library_item( current_user_roles, item ) and
trans.app.security_agent.can_manage_dataset( current_user_roles, library_dataset.library_dataset_dataset_association.dataset ) ) ):
message = "You are not authorized to manage permissions on library dataset (%s)." % escape( library_dataset.name )
trans.app.security_agent.can_manage_dataset( current_user_roles, item.library_dataset_dataset_association.dataset ) ) ):
message = "You are not authorized to manage permissions on library dataset (%s)." % escape( item.name )
if cntrller == 'api':
return 403, message
return trans.response.send_redirect( web.url_for( controller='library_common',
@@ -12,6 +12,7 @@ from galaxy import util
from galaxy import web
from galaxy.exceptions import RequestParameterMissingException
from galaxy.exceptions import RequestParameterInvalidException
from galaxy.exceptions import InsufficientPermissionsException
from galaxy.exceptions import ActionInputError
from galaxy.exceptions import ObjectNotFound
from galaxy.exceptions import MalformedId
@@ -46,11 +46,6 @@ class InstallEnvironment( object ):
self.install_dir = install_dir
self.tool_shed_repository_install_dir = tool_shed_repository_install_dir
def __call__( self ):
with settings( warn_only=True, **basic_util.get_env_var_values( self ) ):
with prefix( self.__setup_environment() ):
yield
def add_env_shell_file_paths( self, paths ):
for path in paths:
self.env_shell_file_paths.append( str( path ) )
+1 -1
View File
@@ -25,7 +25,7 @@ def generate_repository_archive_filename( tool_shed_url, name, owner, changeset_
export_repository_dependencies, use_tmp_archive_dir=False ):
tool_shed = remove_protocol_from_tool_shed_url( tool_shed_url )
file_type_str = basic_util.get_file_type_str( changeset_revision, file_type )
if self.export_repository_dependencies:
if export_repository_dependencies:
repositories_archive_filename = '%s_%s_%s_%s_%s' % ( CAPSULE_WITH_DEPENDENCIES_FILENAME,
tool_shed,
name,
+2 -1
View File
@@ -14,7 +14,8 @@ method (they'll have to be created manually, which can be done after the import)
Here is a working example of how to use this script to install a repository from the test tool shed.
./import_capsule.py -a <api key> -u http://localhost:9009 -c capsule_localhost_colon_9009_filter_test1_8923f52d5c6d.tar.gz
"""
import logging
log = logging.getLogger(__name__)
import os
import sys
import argparse
@@ -26,7 +26,7 @@ def main( options ):
response_dict = submit( url, data, api_key=api_key, return_formatted=False )
print response_dict
else:
print "Invalid tool_shed: ", base_tool_shed_url, " name: ", name, " or owner: ", owner, "."
print "Invalid tool_shed: ", base_tool_shed_url, " name: ", options.name, " or owner: ", options.owner, "."
else:
print "An API key for an admin user in the Tool Shed is required to remove entries from the Tool Shed's repository registry."
@@ -11,7 +11,8 @@ usage: reset_metadata_on_repositories.py key <my_writable>
Here is a working example of how to use this script to reset metadata on certain repositories in a specified Tool Shed.
python ./reset_metadata_on_repositories.py -a 22be3b -m True -u http://localhost:9009/
"""
import logging
log = logging.getLogger(__name__)
import argparse
import os
import sys
+1 -1
View File
@@ -17,7 +17,7 @@ STEP_TYPE_ALIASES = {
def yaml_to_workflow(has_yaml):
as_python = yaml.load(has_yaml)
return python_to_workflow(as_path)
return python_to_workflow(as_python)
def python_to_workflow(as_python):