Skip to main content

Semantic versioning module enriched by hotfix version

Project description


A python module to deal with modified semantic versioning.


There are three numbers as main part of a version in semantic version ( Third number, patch, is defined as:

PATCH version when you make backward compatible bug fixes

However, sometimes we need to distinguish two types of a bugfix.

  1. bugfix which is released in a standard way
  2. bugfix which has to be release immidiately as hotfix

The first type is released in a standard release process and at the end the patch of a version is increased.

The second one is the case we identified a bug which has to be fixed and released immidiately. In this case, a version witch increased patch can potentially already exists as any sort of pre-release version.
Let's assume there is version 0.4.2 deployed in production. Versions 0.4.3-rc and 0.4.4-rc already exist in our non prod environment but they are not ready to be released. The question is what version should have fixed code. If we want to increase patch we would have to jump to 0.4.5 which may (and will) brings confusion in the versioning.

Fix version part

To solve to the scenario described above, we introduce 4th number to main version part. Let's call it fix version and define it as:

FIX version when you make hot fixes released immidiately

So the new version in the described scenario would be

At the end, the modification means only the one number.


from semver4 import Version

version = Version(major=2, minor=4, path=4, prerelease='beta')
# '2.4.4-beta'

version > Version('')
# True

# ''

# ''

Known limitations

  • Comparing of two Versions only by major, minor, patch and fix. Prerelease and build do not affect any comparison operation.
  • pre release and build metadata parts can not be modified

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

semver4-0.0.1b3.tar.gz (5.1 kB view hashes)

Uploaded Source

Built Distribution

semver4-0.0.1b3-py3-none-any.whl (5.6 kB view hashes)

Uploaded Python 3

Supported by

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