tool_shed.metadata package

Submodules

tool_shed.metadata.metadata_generator module

tool_shed.metadata.repository_metadata_manager module

class tool_shed.metadata.repository_metadata_manager.ToolShedMetadataGenerator(trans: ProvidesRepositoriesContext, repository: Repository | None = None, changeset_revision: str | None = None, repository_clone_url: str | None = None, shed_config_dict: Dict[str, Any] | None = None, relative_install_dir=None, repository_files_dir=None, resetting_all_metadata_on_repository=False, updating_installed_repository=False, persist=False, metadata_dict=None, user=None)[source]

Bases: BaseMetadataGenerator

A MetadataGenerator building on ToolShed’s app and repository constructs.

__init__(trans: ProvidesRepositoriesContext, repository: Repository | None = None, changeset_revision: str | None = None, repository_clone_url: str | None = None, shed_config_dict: Dict[str, Any] | None = None, relative_install_dir=None, repository_files_dir=None, resetting_all_metadata_on_repository=False, updating_installed_repository=False, persist=False, metadata_dict=None, user=None)[source]
app: ToolShedApp
repository: Repository | None
repository_clone_url: str | None
invalid_file_tups: List[Tuple[str, str]]
initial_metadata_dict() Dict[str, Any][source]
set_repository(repository, relative_install_dir: str | None = None, changeset_revision: str | None = None)[source]
handle_repository_elem(repository_elem, only_if_compiling_contained_td=False) Tuple[List, bool, str][source]

Process the received repository_elem which is a <repository> tag either from a repository_dependencies.xml file or a tool_dependencies.xml file. If the former, we’re generating repository dependencies metadata for a repository in the Tool Shed. If the latter, we’re generating package dependency metadata within Galaxy or the Tool Shed.

class tool_shed.metadata.repository_metadata_manager.RepositoryMetadataManager(trans: ProvidesRepositoriesContext, repository=None, changeset_revision=None, repository_clone_url=None, shed_config_dict=None, relative_install_dir=None, repository_files_dir=None, resetting_all_metadata_on_repository=False, updating_installed_repository=False, persist=False, metadata_dict=None)[source]

Bases: ToolShedMetadataGenerator

__init__(trans: ProvidesRepositoriesContext, repository=None, changeset_revision=None, repository_clone_url=None, shed_config_dict=None, relative_install_dir=None, repository_files_dir=None, resetting_all_metadata_on_repository=False, updating_installed_repository=False, persist=False, metadata_dict=None)[source]
app: ToolShedApp
build_repository_ids_select_field(name='repository_ids', multiple=True, display='checkboxes', my_writable=False)[source]

Generate the current list of repositories for resetting metadata.

compare_changeset_revisions(ancestor_changeset_revision, ancestor_metadata_dict)[source]

Compare the contents of two changeset revisions to determine if a new repository metadata revision should be created.

compare_data_manager(ancestor_metadata, current_metadata)[source]

Determine if ancestor_metadata is the same as or a subset of current_metadata for data_managers.

compare_repository_dependencies(ancestor_repository_dependencies, current_repository_dependencies)[source]

Determine if ancestor_repository_dependencies is the same as or a subset of current_repository_dependencies.

compare_tool_dependencies(ancestor_tool_dependencies, current_tool_dependencies)[source]

Determine if ancestor_tool_dependencies is the same as or a subset of current_tool_dependencies.

create_or_update_repository_metadata(changeset_revision, metadata_dict)[source]

Create or update a repository_metadata record in the tool shed.

different_revision_defines_tip_only_repository_dependency(rd_tup, repository_dependencies)[source]

Determine if the only difference between rd_tup and a dependency definition in the list of repository_dependencies is the changeset_revision value.

get_repositories_for_setting_metadata(my_writable=False, order=True)[source]

Return a list of repositories for resetting metadata. The order parameter is used for displaying the list of repositories ordered alphabetically for display on a page. When called from the Tool Shed API, order is False.

new_metadata_required_for_utilities()[source]

This method compares the last stored repository_metadata record associated with self.repository against the contents of self.metadata_dict and returns True or False for the union set of Galaxy utilities contained in both metadata dictionaries. The metadata contained in self.metadata_dict may not be a subset of that contained in the last stored repository_metadata record associated with self.repository because one or more Galaxy utilities may have been deleted from self.repository in the new tip.

new_repository_dependency_metadata_required(repository_metadata)[source]

Compare the last saved metadata for each repository dependency in the repository with the new metadata in self.metadata_dict to determine if a new repository_metadata table record is required or if the last saved metadata record can be updated for repository_dependencies instead.

new_data_manager_required(repository_metadata)[source]
new_tool_metadata_required(repository_metadata)[source]

Compare the last saved metadata for each tool in the repository with the new metadata in self.metadata_dict to determine if a new repository_metadata table record is required, or if the last saved metadata record can be updated instead.

new_tool_dependency_metadata_required(repository_metadata)[source]

Compare the last saved metadata for each tool dependency in the repository with the new metadata in self.metadata_dict to determine if a new repository_metadata table record is required or if the last saved metadata record can be updated for tool_dependencies instead.

reset_all_metadata_on_repository_in_tool_shed(repository_clone_url=None)[source]

Reset all metadata on a single repository in a tool shed.

reset_metadata_on_selected_repositories(**kwd)[source]

Inspect the repository changelog to reset metadata for all appropriate changeset revisions. This method is called from both Galaxy and the Tool Shed.

set_repository(repository, repository_clone_url=None)[source]
set_repository_metadata(host, content_alert_str='', **kwd)[source]

Set metadata using the self.repository’s current disk files, returning specific error messages (if any) to alert the repository owner that the changeset has problems.

repository: Repository | None
invalid_file_tups: List[Tuple[str, str]]
repository_clone_url: str | None
changeset_revision: str | None
shed_config_dict: Dict[str, Any]
metadata_dict: Dict[str, Any]
relative_install_dir: str | None
repository_files_dir: str | None
persist: bool
set_repository_metadata_due_to_new_tip(host, content_alert_str=None, **kwd)[source]

Set metadata on the tip of self.repository in the tool shed.

tool_shed.metadata.repository_metadata_manager.get_user_by_username(session, username)[source]
tool_shed.metadata.repository_metadata_manager.get_repository(session, name, user_id)[source]
tool_shed.metadata.repository_metadata_manager.get_repository_metadata(session, repository_id)[source]
tool_shed.metadata.repository_metadata_manager.get_current_repositories(session, order=False)[source]
tool_shed.metadata.repository_metadata_manager.get_filtered_repositories(session, repo_ids, order)[source]