molt build
Build the distribution artifacts -- an sdist and a wheel per package -- for the packages a publish plan will ship.
This is the pack stage of the publish pipeline. The command you type is
molt build; the artifacts it produces are whatmolt publish --from-pack-diruploads.
Synopsis
Description
On PyPI, building is mandatory and produces two artifacts -- a source distribution (.tar.gz) and a wheel (.whl) -- for every package. There is no implicit build at upload time. molt build runs the ecosystem's build (for example uv build / python -m build) for each package a plan will publish, writes the artifacts to an output directory, and records an enriched publish plan that adds each artifact's path and a sha256 integrity hash to the plan entries.
molt build can compute the plan itself, or take a precomputed one from molt publish-plan via --from-publish-plan. Splitting build from upload lets CI build once and upload from a separate, credentialed job.
If a build fails, molt surfaces the error and writes no plan file -- there is no half-built output to clean up.
Options
The publish plan is a versioned envelope ({ "version": 1, "plan": [...] }); a plan file with an unrecognized version is rejected.
Exit codes
Examples
Build everything in the current plan into dist/:
Build from a precomputed plan, into a chosen directory:
Then upload the built artifacts from another job:
See also
- molt publish -- uploads what
molt buildproduces. - Publishing.