Prerelease control
How molt cuts prereleases -- and why there is no molt pre mode to enter or exit.
Molt has no prerelease mode
changesets models prereleases as a persistent state: you run changeset pre enter next, which writes a pre.json file that becomes shared branch state, cut some prereleases, and later run changeset pre exit. That pre.json is the single most-disliked part of changesets, and its arbitrary tags (1.0.1-next.0) are not even legal under PEP 440.
Molt does neither. Prerelease is a stateless flag on molt version:
There is no pre.json, no mode to enter, no mode to exit, and no leftover state on the branch. The "state" is simply the version string already on disk. This page is the reference for how --pre behaves.
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.