def create_search_path(search_path: List[str], abspath: bool = False) -> ConfigSearchPathImpl: Plugins.register_config_sources() csp = ConfigSearchPathImpl() csp.append("hydra", "pkg://hydra.conf") for sp in search_path: csp.append("test", sp if not abspath else os.path.realpath(sp)) return csp
def create_config_search_path(search_path_dir: Optional[str]) -> ConfigSearchPath: from hydra.core.plugins import Plugins from hydra.plugins.search_path_plugin import SearchPathPlugin search_path = ConfigSearchPathImpl() search_path.append("hydra", "pkg://hydra.conf") if search_path_dir is not None: search_path.append("main", search_path_dir) search_path_plugins = Plugins.instance().discover(SearchPathPlugin) for spp in search_path_plugins: plugin = spp() assert isinstance(plugin, SearchPathPlugin) plugin.manipulate_search_path(search_path) search_path.append("schema", "structured://") return search_path
def create_config_search_path(path: str) -> ConfigSearchPathImpl: csp = ConfigSearchPathImpl() csp.append(provider="test", path=path) return csp
def create_search_path(base_list: List[Tuple[str, str]]) -> ConfigSearchPathImpl: csp = ConfigSearchPathImpl() csp.config_search_path = [SearchPathElement(x[0], x[1]) for x in base_list] return csp
def create_repo() -> IConfigRepository: csp = ConfigSearchPathImpl() csp.append(provider="test", path="file://tests/defaults_list/data") csp.append("schema", "structured://") return ConfigRepository(config_search_path=csp)