galaxy.tool_shed.metadata package
Submodules
galaxy.tool_shed.metadata.metadata_generator module
- class galaxy.tool_shed.metadata.metadata_generator.RepositoryProtocol(*args, **kwargs)[source]
Bases:
Protocol
- __init__(*args, **kwargs)
- class galaxy.tool_shed.metadata.metadata_generator.BaseMetadataGenerator[source]
Bases:
object
- app: BasicSharedApp | InstallationTarget
- repository: RepositoryProtocol | None
- handle_repository_elem(repository_elem, only_if_compiling_contained_td=False) Tuple[List, bool, str] [source]
- generate_environment_dependency_metadata(elem, valid_tool_dependencies_dict)[source]
The value of env_var_name must match the value of the “set_environment” type in the tool config’s <requirements> tag set, or the tool dependency will be considered an orphan.
- generate_metadata_for_changeset_revision()[source]
Generate metadata for a repository using its files on disk. To generate metadata for changeset revisions older than the repository tip, the repository will have been cloned to a temporary location and updated to a specified changeset revision to access that changeset revision’s disk files, so the value of self.repository_files_dir will not always be self.repository.repo_path( self.app ) (it could be an absolute path to a temporary directory containing a clone). If it is an absolute path, the value of self.relative_install_dir must contain repository.repo_path( self.app ).
The value of self.persist will be True when the installed repository contains a valid tool_data_table_conf.xml.sample file, in which case the entries should ultimately be persisted to the file referred to by self.app.config.shed_tool_data_table_config.
- generate_package_dependency_metadata(elem, valid_tool_dependencies_dict, invalid_tool_dependencies_dict)[source]
Generate the metadata for a tool dependencies package defined for a repository. The value of package_name must match the value of the “package” type in the tool config’s <requirements> tag set.
- generate_repository_dependency_metadata(repository_dependencies_config, metadata_dict)[source]
Generate a repository dependencies dictionary based on valid information defined in the received repository_dependencies_config. This method is called from the tool shed as well as from Galaxy.
- generate_tool_metadata(tool_config, tool, metadata_dict)[source]
Update the received metadata_dict with changes that have been applied to the received tool.
- generate_tool_dependency_metadata(tool_dependencies_config, metadata_dict, original_repository_metadata=None)[source]
If the combination of name, version and type of each element is defined in the <requirement> tag for at least one tool in self.repository, then update the received metadata_dict with information from the parsed tool_dependencies_config.
- get_relative_path_to_repository_file(root, name, relative_install_dir, work_dir, shed_config_dict)[source]
- class galaxy.tool_shed.metadata.metadata_generator.GalaxyMetadataGenerator(app: InstallationTarget, repository=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 Galaxy’s app and repository constructs.
- __init__(app: InstallationTarget, repository=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: InstallationTarget
- repository: ToolShedRepository | None
- 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.