Skip to content

Non-monotonic development versions with release branch scheme #1025

Open
@danchr

Description

@danchr

I use setuptools_scm for versioning hg-git, with the release-branch-semver scheme, where I have release branches named e.g. 1.0.x and 1.1.x. When doing a stable release, I do it on the release branch and merge it into default. Unfortunately, the devN is merely calculated as the length to the most recent tag, which then makes it decrease after a minor release is merged into the main development branch.

I checked, and I can reproduce this using both Mercurial and Git sources. For example, the version determined relative to 1.1.0 is 1.2.0.dev26+g7069705 whereas after the merge, it.s 1.2.0.dev17+g5b33fad.

As best I can tell, you cannot easily customise the devN part. For release-branch-semver, I believe it should either:

  1. Use some monotonically increasing value, like the date or a timestamp.
  2. Somehow take the minor into account, e.g. by multiplying the distance by 100 or 1000 times the minor release number.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions