Skip to main content

Easy semantic versioning for projects in Git

Project description

VerNum

Version numbering and git tagging for project releases

Watch the video

Installation

Requires Python 3 to run the command; your project can be anything.

pip3 install vernum

What it does

  • Read the Git tags in the repo that match the pattern e.g. "v5.6.1" and pick the highest value
  • Increment the version number for major, minor, or patch releases - patch is the default
  • Write the new version number to a file e.g. "5.6.2"
  • Optionally create and push a git tag with the version number in it

Usage

Requirements:

  • CD to the root of the project before running it
  • Be on the branch that you use for releases (i.e. master)
  • Be fully up-to-date in git (i.e. merged, committed, and pushed)

Then run the command:

  • vernum major to update the major version level, i.e. 5.6.2 -> 6.0.0
  • vernum minor to update the minor version level, i.e. 5.6.2 -> 5.7.0
  • vernum patch to update the patch version level, i.e. 5.6.2 -> 5.6.3

Note that patch is the default so you can just say vernum for a patch release

Reference the .version file within your code when it needs to know the version.

Use the provided vernum.gitlab-ci.yml to use it in GitLab.

VerNum looks at the most recent git tag that fits the format, then increments it appropriately. It also generates the .version file.

Options:

  • --push-tag create a git tag for the version and push it
  • --dry-run just output the information; don't do anything

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

vernum-3.2.1.tar.gz (3.7 kB view details)

Uploaded Source

Built Distribution

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

vernum-3.2.1-py3-none-any.whl (4.3 kB view details)

Uploaded Python 3

File details

Details for the file vernum-3.2.1.tar.gz.

File metadata

  • Download URL: vernum-3.2.1.tar.gz
  • Upload date:
  • Size: 3.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.11.5

File hashes

Hashes for vernum-3.2.1.tar.gz
Algorithm Hash digest
SHA256 eada67dcc14520d645f39356af5a5549d0829acf9d08372936106e97600a2024
MD5 ac3430c4b567d72e18d25ae5c5ae1722
BLAKE2b-256 62527ba416c07a9571266f087e59a5ef9934b638b2f1f2786522d60bf02391df

See more details on using hashes here.

File details

Details for the file vernum-3.2.1-py3-none-any.whl.

File metadata

  • Download URL: vernum-3.2.1-py3-none-any.whl
  • Upload date:
  • Size: 4.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.11.5

File hashes

Hashes for vernum-3.2.1-py3-none-any.whl
Algorithm Hash digest
SHA256 dac1ebb36f4ee17f040dd48f6bf9c04980d6ef5c97270bf1e26abb939552a114
MD5 f6784bc1bab3c4176b19393632d99a71
BLAKE2b-256 ca0ae1580d2c50a7b90697a25885bae15d66eb8cf4d8bccbb189d1e9645d5d8a

See more details on using hashes here.

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