scripts.publish_release

Insert a TOML header into the latest release note.

Module Contents

scripts.publish_release.insert_break(lines, break_pos=9)[source]

Insert a <!–more–> tag for larger release notes.

Parameters:
  • lines (list of str) – The content of the release note.
  • break_pos (int) – Line number before which a break should approximately be inserted.
Returns:

The text with the inserted tag or no modification if it was sufficiently short.

Return type:

list of str

scripts.publish_release.build_hugo_md(filename, tag, bump)[source]

Build the markdown release notes for Hugo.

Inserts the required TOML header with specific values and adds a break for long release notes.

Parameters:
  • filename (str, path) – The release notes file.
  • tag (str) – The tag, following semantic versioning, of the current release.
  • bump ({"major", "minor", "patch", "alpha", "beta"}) – The type of release.
scripts.publish_release.intify(filename)[source]

Turn a release note filename into something sortable.

Parameters:filename (str) – A release note of expected filename format ‘<major>.<minor>.<patch>.md’.
Returns:A pair of the major and minor versions as integers.
Return type:tuple
scripts.publish_release.find_bump(target, tag)[source]

Identify the kind of release by comparing to existing ones.

scripts.publish_release.main(argv)[source]

Identify the release type and create a new target file with TOML header.

Requires three arguments.