Programmatic publish staging

Version 0.3.1 Updated Sep 14, 2026

Programmatic callers should import the staging helper from lading.commands.publish_staging and pass a publication plan with options as a keyword argument:

from lading.commands.publish_staging import prepare_workspace

preparation = prepare_workspace(plan, options=options)

The workspace argument accepted by older releases is no longer part of the prepare_workspace(plan, *, options=None) contract; the plan supplies the workspace root. When options.cleanup is enabled and no options.build_directory is supplied, process-exit cleanup removes the entire automatically created build directory. With a caller-supplied build directory, cleanup removes only the staged workspace root and preserves the caller's other files.

Migration note for the next minor release: Update imports from lading.commands.publish to lading.commands.publish_staging, remove the obsolete workspace argument, and pass options by keyword.