Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
def _repos(self, **kwds):
return shed.build_effective_repositories(self.temp_directory, **kwds)
type=click.Choice(shed.CURRENT_CATEGORIES)
)
@options.shed_repo_options()
@options.force_option()
@command_function
def cli(ctx, path, **kwds):
"""Bootstrap a new Tool Shed configuration (.shed.yml) file.
This file is used by other ``planemo`` commands such as ``shed_lint``,
``shed_create``, ``shed_upload``, and ``shed_diff`` to manage repositories
in a Galaxy Tool Shed.
"""
exit_code = shed.shed_init(ctx, path, **kwds)
sys.exit(exit_code)
the repository doesn't define complete metadata in a ``.shed.yml``.
"""
# In a little bit of cheating, we're defining this variable here to collect
# a "report" on the shed_update command
collected_data = {
'results': {
'total': 0,
'errors': 0,
'failures': 0,
'skips': 0,
},
'suitename': 'update',
'tests': [],
}
shed_context = shed.get_shed_context(ctx, **kwds)
def update(realized_repository):
collected_data['results']['total'] += 1
skip_upload = kwds["skip_upload"]
skip_metadata = kwds["skip_metadata"]
upload_ret_code = 0
upload_ok = True
captured_io = {}
if not skip_upload:
with captured_io_for_xunit(kwds, captured_io):
upload_ret_code = shed.upload_repository(
ctx, realized_repository, **kwds
)
upload_ok = not upload_ret_code
def cli(ctx, path, **kwds):
"""Bootstrap a new Tool Shed configuration (.shed.yml) file.
This file is used by other ``planemo`` commands such as ``shed_lint``,
``shed_create``, ``shed_upload``, and ``shed_diff`` to manage repositories
in a Galaxy Tool Shed.
"""
exit_code = shed.shed_init(ctx, path, **kwds)
sys.exit(exit_code)
def cli(ctx, paths, **kwds):
"""Launch Galaxy with Tool Shed dependencies.
This command will start a Galaxy instance configured to target the
specified shed, find published artifacts (tools and dependencies)
corresponding to command-line arguments and ``.shed.yml`` file(s),
install these artifacts, and serve a Galaxy instances that can be
logged into and explored interactively.
"""
kwds['galaxy_skip_client_build'] = False
install_args_list = shed.install_arg_lists(ctx, paths, **kwds)
with shed_serve(ctx, install_args_list, **kwds) as config:
io.info("Galaxy running with tools installed at %s" % config.galaxy_url)
sleep_for_serve()
repo_result.update({
'errorType': 'FailedUpdate',
'errorMessage': message,
})
collected_data['tests'].append(repo_result)
error(message)
return upload_ret_code
exit = 0
metadata_ok = True
repository_destination_label = "repository '%s' on the %s" % (realized_repository.name, shed_context.label)
if not skip_metadata:
repo_id = shed.handle_force_create(realized_repository, ctx, shed_context, **kwds)
# failing to create the repo, give up
if repo_id is None:
exit = shed.report_non_existent_repository(realized_repository)
metadata_ok = False
error("Failed to update metadata for %s." % repository_destination_label)
else:
metadata_ok = realized_repository.update(ctx, shed_context, repo_id)
if metadata_ok:
info("Repository metadata updated successfully for %s." % repository_destination_label)
else:
info("Skipping metadata update for %s" % repository_destination_label)
if metadata_ok and upload_ok:
pass
elif upload_ok:
collected_data['results']['skips'] += 1
repo_result.update({
'errorType': 'FailedMetadata',
'errorMessage': 'Failed to update repository metadata',