Skip to main content

A tiny utility to get application version from pkg_resouces

Project description

Build status Coverage Downloads Latest version Wheel Status Egg Status License
Author

Alisue <lambdalisue@hashnote.net>

Supported python versions

2.6, 2.7, 3.2, 3.3, 3.4

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 write 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.

# coding: utf-8
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

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

app_version-0.2.1.tar.gz (5.0 kB view hashes)

Uploaded Source

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