Skip to main content

Simple git tag based version numbers

Project description

https://img.shields.io/pypi/v/versiontag.svg https://img.shields.io/pypi/dm/versiontag.svg https://travis-ci.org/crgwbr/python-versiontag.svg

What?

This is an ultra-simple library design to make accessing the current version number of your software easy.

Why?

Version numbers are all too often duplicated among setup.py, git tags, and others sources of truth. This library makes it possible to consolidate on git tags as a single source of truth regarding version numbers.

How?

Install python-versiontag using pip.

pip install versiontag

Add version.txt to your .gitignore file.

echo "version.txt" >> .gitignore

Add versiontag to your package’s setup.py file.

from versiontag import get_version, cache_git_tag

# This caches for version in version.txt so that it is still accessible if
# the .git folder disappears, for example, after the slug is built on Heroku.
cache_git_tag()

setup(name='My Package',
      version=get_version(pypi=True),
...

Use versiontag where ever you want to access the version number.

>>> from versiontag import get_version
>>> print( get_version() )
'r1.2.3'

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

versiontag-1.0.0.tar.gz (2.5 kB view details)

Uploaded Source

File details

Details for the file versiontag-1.0.0.tar.gz.

File metadata

  • Download URL: versiontag-1.0.0.tar.gz
  • Upload date:
  • Size: 2.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No

File hashes

Hashes for versiontag-1.0.0.tar.gz
Algorithm Hash digest
SHA256 e6e5c8c05acae05fc726560f721ea68701fd49eba9dae5224a3d9bd769b3601a
MD5 d4a6804018c4ed48c99dd8e4fcc1b557
BLAKE2b-256 8489f4cf95c48c723e0b6dde08f8bd08b27355b837c4aef874583bc51849acaf

See more details on using hashes here.

Provenance

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