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

Uploaded Source

Built Distribution

versiontag-0.1.0.macosx-10.11-x86_64.tar.gz (2.4 kB view details)

Uploaded Source

File details

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

File metadata

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

File hashes

Hashes for versiontag-0.1.0.tar.gz
Algorithm Hash digest
SHA256 23301965e436b8ab85ba25df71d1ee25ee7149aa7f7e8af03d722dcbde78fb05
MD5 92026076387e5963b32a8bdf55ff3594
BLAKE2b-256 9247ff96706bec87230564ab13f8a23d25deebf52ab555bc75fee4de3833c986

See more details on using hashes here.

Provenance

File details

Details for the file versiontag-0.1.0.macosx-10.11-x86_64.tar.gz.

File metadata

File hashes

Hashes for versiontag-0.1.0.macosx-10.11-x86_64.tar.gz
Algorithm Hash digest
SHA256 a6b504f233b9c9ddf22f2cb9652b8246629459c71000403c1af894f0e8880257
MD5 c7110b8ae027c3640495663a34230dd5
BLAKE2b-256 d4bea126f0e8e8843e2d7cc01170768d31695fa333e87762fb05235d3fcc6987

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