From 92d2e39da733092910e50023cbd3622ec5d73839 Mon Sep 17 00:00:00 2001 From: Dmitry Tantsur Date: Tue, 6 Jan 2015 11:33:55 +0100 Subject: [PATCH] Introduce __version__ and __version_info__ Ported from stable/0.2 branch. Change-Id: I090d96efb62ab72cac39a76a897d563199adbf36 --- ironic_discoverd/__init__.py | 15 +++++++++++++++ setup.py | 6 +++++- 2 files changed, 20 insertions(+), 1 deletion(-) diff --git a/ironic_discoverd/__init__.py b/ironic_discoverd/__init__.py index e69de29bb..5e2b32d7d 100644 --- a/ironic_discoverd/__init__.py +++ b/ironic_discoverd/__init__.py @@ -0,0 +1,15 @@ +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or +# implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +__version_info__ = (1, 0, 0) +__version__ = '%d.%d.%d' % __version_info__ diff --git a/setup.py b/setup.py index 3c7203d8a..fee597c74 100644 --- a/setup.py +++ b/setup.py @@ -8,9 +8,13 @@ with open('requirements.txt', 'r') as fp: for line in fp if line.strip()] +with open('ironic_discoverd/__init__.py', 'rb') as fp: + exec(fp.read()) + + setup( name = "ironic-discoverd", - version = "1.0.0", + version = __version__, description = open('README.rst', 'r').readline().strip(), author = "Dmitry Tantsur", author_email = "dtantsur@redhat.com",