perago.workspace_delete_object_paths#

perago.workspace_delete_object_paths(workspace_spec, existing_object_paths, uploaded_files)[源代码]#

Find stale remote objects that should be deleted from a staging branch.

The delete list is restricted to the task's workspace prefix. It removes remote objects that still exist on the staging branch but no longer appear in the local attempt workspace.

Parameters:
workspace_specWorkspaceSpec

Workspace declaration whose prefix limits the delete scope.

existing_object_pathslist of str

Object paths currently present under the staging branch.

uploaded_fileslist of WorkspaceUploadFile

Upload records generated from the local attempt workspace.

Returns:
list of str

Existing object paths under the workspace prefix that are absent from the upload list. Objects outside the prefix and Perago's attempt marker file are not returned.

Raises:
TaskDefinitionError

If an existing object path cannot be represented as a safe workspace path.

参数:
返回类型:

list[str]

参见

workspace_upload_files

Build the upload side of the sync plan.

build_workspace_sync_plan

Build the complete upload/delete plan.

Examples

>>> uploaded = [WorkspaceUploadFile(Path("raw/input.wav"), "audio/render/raw/input.wav")]
>>> workspace_delete_object_paths(
...     WorkspaceSpec(prefix="/audio/render"),
...     ["audio/render/raw/input.wav", "audio/render/old.tmp"],
...     uploaded,
... )
['audio/render/old.tmp']