Skip to main content

A CLI tool to detect version labels in temp.md

Project description

Bump versions automagically

Bump versions based on changelog entries.

Setup

This package only works together with scriv and works best if used with hatch.

In the scriv configuration the following is assumed:

[tool.scriv]
format = "md"
categories = [
  "Major: Feature",
  "Minor: Feature",
  "Minor: Fix", 
  "Patch: Fix", 
  "Major: Business impact",
  "Minor: Business impact"
]

You can adjust the categories as you like the BUMB: part is what is checked for, and the bumps must be Major, Minor, Patch

For a nice integration in hatch use these two additional env definition blocks:

[tool.hatch.envs.changelog]
dependencies = [
  "scriv",
  "changelog-version"
]

[tool.hatch.envs.changelog.scripts]
init = "mkdir changelog.d"
new = "scriv create --edit --add"
collate = "scriv print > temp.md && hatch version $(changelog-version-bump)  && scriv collect"
  1. Initial setup needed once is the init part (feel free to not bother with a seperate command).

  2. In each branch you'll need to run scriv create or hatch run changelog:new to create and edit the changelog fragment for scriv.

  3. The actual magic is the collate comand that should run in ci/cd when you create tags / releases.

Pre-commit hook

This was originally created by TypicalArray.

Some places (like Azure DevOps) do not render .md files automatically. So in order to clean them up, this repo also contains a pre-commit hook which automatically removes all commented out lines, removes superfluous empty lines and enforces that all lines have to start with a # or a -, which helps with formatting. It can be used as follows:

repos:
  - repo: https://github.com/banking-circle-advanced-analytics/changelog-version-bump
    rev: <insert-latest-release>
    hooks:
      - id: remove-comments

FAQ

Can you change the options and headings? No. It would be easy to add configurability via the toml and a tool.changelog-version-bump section but for now I see no need, the defaults should suffice.

Could this not just be some bash? Yes. This code was actually bash, but for distribution and later configuration, see above, python scripts are easier.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

changelog_version_bump-0.4.7.tar.gz (16.0 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

changelog_version_bump-0.4.7-py3-none-any.whl (18.0 kB view details)

Uploaded Python 3

File details

Details for the file changelog_version_bump-0.4.7.tar.gz.

File metadata

  • Download URL: changelog_version_bump-0.4.7.tar.gz
  • Upload date:
  • Size: 16.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for changelog_version_bump-0.4.7.tar.gz
Algorithm Hash digest
SHA256 ca0b36a1394b2d5c0eb775c9c0eba3b9e7f77dcfb9c288a7784445929a08e732
MD5 7feecbef8347fa1c75aab43c7aceece5
BLAKE2b-256 5d651da4c6ec0c238c4913395271bc0c15985d4f45c26b77279f82d3aebb2666

See more details on using hashes here.

Provenance

The following attestation bundles were made for changelog_version_bump-0.4.7.tar.gz:

Publisher: python-publish.yml on banking-circle-advanced-analytics/changelog-version-bump

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file changelog_version_bump-0.4.7-py3-none-any.whl.

File metadata

File hashes

Hashes for changelog_version_bump-0.4.7-py3-none-any.whl
Algorithm Hash digest
SHA256 6a5f258284fb992e0e639c638fd8f87dffdadbf39db7bb0134d0b18b56b8833f
MD5 782223ceb92ebd5e8c0c4241c7adb2d8
BLAKE2b-256 b0b2e0a247d2f35e030d5c569512b4e38a67b34fb0d4fcc872f3ad44a15f22fb

See more details on using hashes here.

Provenance

The following attestation bundles were made for changelog_version_bump-0.4.7-py3-none-any.whl:

Publisher: python-publish.yml on banking-circle-advanced-analytics/changelog-version-bump

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page