From c4d4adc46dbb05944461f2278bc794336a1d3a60 Mon Sep 17 00:00:00 2001 From: Vladan Popovic Date: Mon, 7 Sep 2020 14:52:33 +0200 Subject: [PATCH] Add __version__ to __init__.py --- src/chweb/__init__.py | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/src/chweb/__init__.py b/src/chweb/__init__.py index e69de29..37b4b35 100644 --- a/src/chweb/__init__.py +++ b/src/chweb/__init__.py @@ -0,0 +1,10 @@ +""" +Package related information, like version, name, etc. +""" +from pkg_resources import get_distribution, DistributionNotFound + +try: + __version__ = get_distribution(__name__).version +except DistributionNotFound: + # package is not installed + pass