Skip to main content

Simple git tag based version numbers

Project description

license kit format downloads travisci

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.1.0.tar.gz (3.4 kB view details)

Uploaded Source

Built Distribution

versiontag-1.1.0-py3-none-any.whl (4.4 kB view details)

Uploaded Python 3

File details

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

File metadata

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

File hashes

Hashes for versiontag-1.1.0.tar.gz
Algorithm Hash digest
SHA256 5f79c22bb589f343cc80686df175cb1861e38cb71cb58de289aaebad2b3293d8
MD5 637933871f30a42ef1118656cd110c2a
BLAKE2b-256 65820699feb0ce50eebef50ba113fc67319fb1d409c3aec359bb52b5bb4c9e40

See more details on using hashes here.

Provenance

File details

Details for the file versiontag-1.1.0-py3-none-any.whl.

File metadata

File hashes

Hashes for versiontag-1.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 2fb3b28a19202d230842a74d26291c65eed3d4c5ef6177804b89dd0caf09ed07
MD5 7b32e54e2e6974a08dbac9ef586df599
BLAKE2b-256 a3fc225c8f5c0b3d01c17ff442201efd8cd66edc43967e2b8f5c69efb86d5770

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