From 52520529eb28608e73fea9d30022a70acc5ff0de Mon Sep 17 00:00:00 2001 From: tierno Date: Fri, 20 Dec 2019 14:07:07 +0000 Subject: [PATCH] Get version from installed package if available Change-Id: I28ba441351a62f249c5af190ffb9efdd109ccef2 Signed-off-by: tierno --- osm_common/__init__.py | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/osm_common/__init__.py b/osm_common/__init__.py index 6fc66a5..8bdb9f5 100644 --- a/osm_common/__init__.py +++ b/osm_common/__init__.py @@ -15,5 +15,12 @@ # See the License for the specific language governing permissions and # limitations under the License. -version = '6.0.2.post3' -date_version = '2019-09-19' +version = '7.0.0.post2' +date_version = '2019-12-20' + +# try to get version from installed package. Skip if fails +try: + from pkg_resources import get_distribution + version = get_distribution("osm_common").version +except Exception: + pass -- 2.25.1