Welcome to app_version’s documentation!

app_version

Build status Coverage Requirements Status Version License Format Supported python versions Status

Do you write the version information on setup.py and __init__.py?

This tiny application allow you to access version information of setup.py from __init__.py.

Based on this post, I wrote this tiny application for convinience.

Check online documentation for more details.

Installation

Use pip like:

$ pip install app_version

Usage

The following code is an example __init__.py.

from app_version import get_versions
__version__, VERSION = get_versions('your app name')

Then you can access the version string with __version__ and version tuple with VERSION. The version tuple is useful for comparing versions like

>>> VERSION = (0, 1, 2)
>>> VERSION > (0, 1, 0)
True
>>> VERSION > (0, 1, 1)
True
>>> VERSION > (0, 1, 2)
False

Indices and tables