Prerelease control
How molt cuts prereleases.
There is no prerelease mode
Prerelease is a stateless flag on molt version, not a mode you enter and later exit:
There is no state file, no mode to enter, no mode to exit, and no leftover state on the branch. The state is the version string already on disk. This page is the reference for how --pre behaves.
If you are migrating from changesets, changeset pre enter <tag> and changeset pre exit have no molt equivalent, and a named tag such as next has no PEP 440 spelling. Pass --pre on the runs you want prereleases on.
Synopsis
The --pre values
--pre takes one PEP 440 prerelease identifier. Each maps to a fixed spelling -- arbitrary tags are not allowed:
See Versioning and PEP 440 for the version grammar.
How the counter moves
Because the counter lives in the version string, not in a state file, iteration is just running the command again:
- First
--prerun reads the pending changesets, computes the target bump, and appends the prerelease identifier at counter0. A pending minor on1.0.0with--pre rcyields1.1.0rc0. The changeset files are kept: they are the counter's input, so a--prerun never consumes them. - Each subsequent
--prerun increments the counter:1.1.0rc0to1.1.0rc1to1.1.0rc2. The highest bump type across the accumulated changesets is retained, so a major that landed earlier is not lost when a later minor arrives. - Exiting prerelease is running plain
molt version(no--pre). It finalizes to the stable version, dropping the prerelease identifier:1.1.0rc1becomes1.1.0, and this is the run that consumes the changesets.
Dependents that already opted into prereleases through their own constraints are not force-released as a dependency moves rc0 to rc1 -- this follows PEP 440's opt-in scoping and is a deliberate divergence from changesets. See Dependency propagation and Versioning and PEP 440.
--pre cannot be combined with --snapshot.
Migrating from changeset pre enter / pre exit
For users coming from changesets, the mapping is direct:
If you have a pre.json from a previous tool, delete it; molt does not read it.
Examples
Cut a candidate, iterate, then release:
Cut an alpha for early testing:
Preview a prerelease without writing:
See also
- molt version -- the command
--prelives on. - Prerelease mode -- the concept in depth.
- Migrating from changesets.
- Snapshot releases -- the other throwaway-version path.