Skip to content

deploy_from_folder

async def deploy_from_folder(client: AuraClient, deployment_name: str, folder: str | Path, *, dest_prefix: str = '', include: Callable[[str], bool] | None = None, concurrency: int = 4, on_file_uploaded: Callable[[str], None] | None = None) -> list[FileEntry]

Upload every file under folder, preserving its tree under dest_prefix.

Does not create the deployment or run the contract check — pair it with AuraClient.create_deployment and AuraClient.check_deployment. Uploads only: nothing remote is deleted, so a file renamed or removed locally keeps its old copy on the server. aura deploy is the command that syncs; to prune from the SDK, diff AuraClient.list_files against the folder and AuraClient.delete_file the rest.

Nothing is excluded by default, and the server refuses dot-prefixed path segments (.git, .venv, .DS_Store, .env) with a 400, so pass include to skip them and anything else you would not ship — aura deploy skips those, __pycache__, node_modules, dist and venv on its own.

The first failure stops the pool: workers finish their in-flight upload and then stop taking new work, because a caller that treats a failed sync as “stop and prune stale remote files” would otherwise have files still landing behind the raised error, leaving the remote matching neither file set.

Parameter Type Default Description
client AuraClient A connected AuraClient.
deployment_name str The deployment to upload into.
folder str | Path Local directory to upload.
dest_prefix str '' Prepended to each relative path, e.g. "run/".
include Callable[[str], bool] | None None Keep only files whose POSIX-relative path passes this predicate. Everything uploads when omitted, dotfiles included — e.g. lambda p: not any(part.startswith(".") for part in p.split("/")).
concurrency int 4 How many uploads run at once.
on_file_uploaded Callable[[str], None] | None None Called with each destination path as it lands.

The stored file entries, in upload order.

Exception When
AuraApiError An upload failed — a dot-prefixed path (400) or a file over 100 MiB (501) included. Raised as itself, not wrapped in an ExceptionGroup, so except AuraApiError works.
FileNotFoundError folder does not exist.
NotADirectoryError folder exists but is not a directory.