Merge pull request #3169 from jmchilton/galaxy-lib-update-3

Bring in updates from galaxy-lib.
This commit is contained in:
Nicola Soranzo
2016-11-14 19:45:58 +00:00
committed by GitHub
25 changed files with 43 additions and 14 deletions
+1
View File
@@ -40,6 +40,7 @@ def _from_dict(entry):
message = entry.get("message")
return (name, ErrorCode(code, message))
error_codes_json = resource_string(__name__, 'error_codes.json').decode("UTF-8")
for entry in loads(error_codes_json):
name, error_code_obj = _from_dict(entry)
+1
View File
@@ -75,6 +75,7 @@ class NullJobInstrumenter(object):
def collect_properties(self, job_id, job_directory):
return {}
NULL_JOB_INSTRUMENTER = NullJobInstrumenter()
+1
View File
@@ -137,4 +137,5 @@ class CollectlCli( object ):
if return_code:
raise Exception( "Problem running collectl command." )
__all__ = ( 'CollectlCli', )
@@ -77,4 +77,5 @@ def get_subsystem( name ):
"""
return SUBSYSTEM_DICT[ name ]
__all__ = ( 'get_subsystem', )
@@ -84,4 +84,5 @@ class CorePlugin( InstrumentPlugin ):
pass
return value
__all__ = ( 'CorePlugin', )
@@ -60,4 +60,5 @@ class CpuInfoPlugin( InstrumentPlugin ):
def __instrument_cpuinfo_path( self, job_directory ):
return self._instrument_file_path( job_directory, "cpuinfo" )
__all__ = ( 'CpuInfoPlugin', )
@@ -69,4 +69,5 @@ class EnvPlugin( InstrumentPlugin ):
def __env_file( self, job_directory ):
return self._instrument_file_path( job_directory, "vars" )
__all__ = ( 'EnvPlugin', )
@@ -62,4 +62,5 @@ class MemInfoPlugin( InstrumentPlugin ):
def __instrument_meminfo_path( self, job_directory ):
return self._instrument_file_path( job_directory, "meminfo" )
__all__ = ( 'MemInfoPlugin', )
+1
View File
@@ -325,6 +325,7 @@ def _rods_strerror( errno ):
irods.__rods_strerror_map[ v ] = name
return irods.__rods_strerror_map.get( errno, 'GALAXY_NO_ERRNO_MAPPING_FOUND' )
if irods is not None:
irods.strerror = _rods_strerror
+1
View File
@@ -48,6 +48,7 @@ def handle_outputs(job_directory=None):
with open(target_path, "w") as f:
f.write(json.dumps(output))
__all__ = (
'handle_outputs',
)
+1
View File
@@ -69,4 +69,5 @@ class SchemaLoader(object):
)
return tool
schema_loader = SchemaLoader()
@@ -120,7 +120,7 @@ class MulledContainerResolver(ContainerResolver):
resolver_type = "mulled"
def __init__(self, app_info=None, namespace="mulled"):
def __init__(self, app_info=None, namespace="biocontainers"):
super(MulledContainerResolver, self).__init__(app_info)
self.namespace = namespace
+1 -1
View File
@@ -210,7 +210,7 @@ class ContainerRegistry(object):
if self.enable_beta_mulled_containers:
default_resolvers.extend([
CachedMulledContainerResolver(self.app_info),
MulledContainerResolver(self.app_info, namespace="mulled"),
MulledContainerResolver(self.app_info, namespace="biocontainers"),
BuildMulledContainerResolver(self.app_info),
])
return default_resolvers
+1
View File
@@ -14,6 +14,7 @@ def arg_parser(argv, globals):
)
return parser
__all__ = (
"arg_parser",
)
+12 -10
View File
@@ -14,6 +14,7 @@ import json
import os
import string
import subprocess
import sys
from sys import platform as _platform
try:
@@ -49,7 +50,7 @@ def get_tests(args, pkg_path):
"""Extract test cases given a recipe's meta.yaml file."""
recipes_dir = args.recipes_dir
tests = ""
tests = []
input_dir = os.path.dirname(os.path.join(recipes_dir, pkg_path))
recipe_meta = MetaData(input_dir)
@@ -59,14 +60,14 @@ def get_tests(args, pkg_path):
if tests_imports or tests_commands:
if tests_commands:
tests = ' && '.join(tests_commands)
elif tests_imports and 'python' in requirements:
tests = ' && '.join('python -c "import %s"' % imp for imp in tests_imports)
tests.append(' && '.join(tests_commands))
if tests_imports and 'python' in requirements:
tests.append(' && '.join('python -c "import %s"' % imp for imp in tests_imports))
elif tests_imports and ('perl' in requirements or 'perl-threaded' in requirements):
tests = ' && '.join('''perl -e "use %s;"''' % imp for imp in tests_imports)
tests = tests.replace('$R ', 'Rscript ')
else:
pass
tests.append(' && '.join('''perl -e "use %s;"''' % imp for imp in tests_imports))
tests = ' && '.join(tests)
tests = tests.replace('$R ', 'Rscript ')
return tests
@@ -146,7 +147,8 @@ def mull_targets(
print(" ".join(involucro_context.build_command(involucro_args)))
if not dry_run:
ensure_installed(involucro_context, True)
involucro_context.exec_command(involucro_args)
return involucro_context.exec_command(involucro_args)
return 0
def context_from_args(args):
@@ -276,7 +278,7 @@ def main(argv=None):
parser.add_argument('--test', help='Provide a test command for the container.')
args = parser.parse_args()
targets = target_str_to_targets(args.targets)
mull_targets(targets, **args_to_mull_targets_kwds(args))
sys.exit(mull_targets(targets, **args_to_mull_targets_kwds(args)))
__all__ = ("main", )
@@ -19,6 +19,7 @@ See recent changes that would be built with:
from __future__ import print_function
import os
import sys
import time
from ._cli import arg_parser
@@ -40,7 +41,8 @@ def _fetch_repo_data(args):
if repo_data is None:
repo_data = "%s-repodata.json" % channel
if not os.path.exists(repo_data):
check_output("wget --quiet https://conda.anaconda.org/%s/linux-64/repodata.json.bz2 -O '%s.bz2' && bzip2 -d '%s.bz2'" % (channel, repo_data, repo_data))
platform_tag = 'osx-64' if sys.platform == 'darwin' else 'linux-64'
check_output("wget --quiet https://conda.anaconda.org/%s/%s/repodata.json.bz2 -O '%s.bz2' && bzip2 -d '%s.bz2'" % (channel, platform_tag, repo_data, repo_data))
return repo_data
+1 -1
View File
@@ -236,4 +236,4 @@ def _string_as_bool( value ):
return str( value ).lower() == "true"
__all__ = ('CondaDependencyResolver', )
__all__ = ('CondaDependencyResolver', 'DEFAULT_ENSURE_CHANNELS')
@@ -179,4 +179,5 @@ class ModuleDependency(Dependency):
def _string_as_bool( value ):
return str( value ).lower() == "true"
__all__ = ('ModuleDependencyResolver', )
@@ -648,6 +648,7 @@ def compare_re_search( value1, value2 ):
# checks pattern=value2 in value1
return bool( re.search( value2, value1 ) )
compare_types = {
'eq': compare_eq,
'neq': compare_neq,
@@ -69,6 +69,7 @@ class DatasetCollectionDescription(object):
self.sort_key = sort_by
self.sort_comp = sort_comp
DEFAULT_DATASET_COLLECTOR_DESCRIPTION = DatasetCollectionDescription(
default_dbkey=LEGACY_DEFAULT_DBKEY,
)
@@ -93,4 +93,5 @@ class ToolShedLineage(ToolLineage):
def get_installed_tool_version( app, tool_id ):
return app.tool_version_cache.tool_version_by_tool_id.get(tool_id, None)
__all__ = ( "ToolShedLineage", )
+1
View File
@@ -151,6 +151,7 @@ def get_toolbox_parser(config_filename):
else:
return XmlToolConfSource(config_filename)
__all__ = (
"get_toolbox_parser",
"ensure_tool_conf_item",
+5
View File
@@ -447,6 +447,7 @@ def pretty_print_json(json_data, is_json_string=False):
json_data = json.loads(json_data)
return json.dumps(json_data, sort_keys=True, indent=4)
# characters that are valid
valid_chars = set(string.ascii_letters + string.digits + " -=_.()/+*^,:?!")
@@ -524,6 +525,7 @@ def sanitize_param( value, valid_characters=valid_chars, character_map=mapped_ch
else:
raise Exception('Unknown parameter type (%s)' % ( type( value ) ))
valid_filename_chars = set( string.ascii_letters + string.digits + '_.' )
invalid_filenames = [ '', '.', '..' ]
@@ -800,6 +802,7 @@ def xml_text(root, name=None):
# No luck, return empty string
return ''
# asbool implementation pulled from PasteDeploy
truthy = frozenset(['true', 'yes', 'on', 'y', 't', '1'])
falsy = frozenset(['false', 'no', 'off', 'n', 'f', '0'])
@@ -1367,6 +1370,7 @@ def safe_str_cmp(a, b):
rv |= ord(x) ^ ord(y)
return rv == 0
galaxy_root_path = os.path.join(__path__[0], "..", "..", "..")
@@ -1523,6 +1527,7 @@ class ExecutionTimer(object):
elapsed = (time.time() - self.begin) * 1000.0
return "(%0.3f ms)" % elapsed
if __name__ == '__main__':
import doctest
doctest.testmod(sys.modules[__name__], verbose=False)
+1
View File
@@ -46,4 +46,5 @@ def is_hashable( value ):
return False
return True
__all__ = ('md5', 'hashlib', 'sha1', 'sha', 'new_secure_hash', 'hmac_new', 'is_hashable')
+2
View File
@@ -487,5 +487,7 @@ def pickle_SafeStringWrapper( safe_object ):
if isinstance( safe_object, CallableSafeStringWrapper ):
cls = CallableSafeStringWrapper
return ( cls, args )
copy_reg.pickle( SafeStringWrapper, pickle_SafeStringWrapper, wrap_with_safe_string )
copy_reg.pickle( CallableSafeStringWrapper, pickle_SafeStringWrapper, wrap_with_safe_string )