A tiny utility to get application version from pkg_resouces
Project description
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
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-1.0.0.tar.gz
(11.1 kB
view hashes)
Built Distribution
Close
Hashes for app_version-1.0.0-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | f0e3438104903427beb1a6fb5ef3721beeea9834dc24033011672bd3b5b18f26 |
|
MD5 | 1389f3928c4eebee8acab5ba60a6e69a |
|
BLAKE2b-256 | 44bdcc25c16b209cf5cbb2f38ca7eb28aae3c093651074a84916183db626abb1 |