Example #1
0
def load_workspace_from_config(workspace_config, yaml_path, python_user_process_api):
    ensure_workspace_config(workspace_config, yaml_path)
    check.inst_param(python_user_process_api, "python_user_process_api", UserProcessApi)

    if "repository" in workspace_config:
        warnings.warn(
            # link to docs once they exist
            "You are using the legacy repository yaml format. Please update your file "
            "to abide by the new workspace file format."
        )
        return Workspace(
            [
                RepositoryLocationHandle.create_in_process_location(
                    pointer=CodePointer.from_legacy_repository_yaml(yaml_path)
                )
            ]
        )

    location_handles = []
    for location_config in workspace_config["load_from"]:
        location_handles.append(
            _location_handle_from_location_config(
                location_config, yaml_path, python_user_process_api
            )
        )

    return Workspace(location_handles)
Example #2
0
 def from_legacy_repository_yaml(cls, file_path):
     check.str_param(file_path, 'file_path')
     absolute_file_path = os.path.abspath(os.path.expanduser(file_path))
     return cls(
         pointer=CodePointer.from_legacy_repository_yaml(
             absolute_file_path),
         yaml_path=absolute_file_path,
     )
Example #3
0
def load_workspace_from_config(workspace_config, yaml_path):
    ensure_workspace_config(workspace_config, yaml_path)

    if 'repository' in workspace_config:
        warnings.warn(
            # link to docs once they exist
            'You are using the legacy repository yaml format. Please update your file '
            'to abide by the new workspace file format.')
        return Workspace([
            RepositoryLocationHandle.create_in_process_location(
                pointer=CodePointer.from_legacy_repository_yaml(yaml_path))
        ])

    location_handles = []
    for location_config in workspace_config['load_from']:
        location_handles.append(
            _location_handle_from_location_config(location_config, yaml_path))

    return Workspace(location_handles)