summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMaurizio Lombardi <mlombard@redhat.com>2019-07-10 17:24:17 +0200
committerGitHub <noreply@github.com>2019-07-10 17:24:17 +0200
commitc8ea2bf6b2e58296c9061f7c9f6f96a28d9c7937 (patch)
tree07abb95c7988745ef546c9c2bb7307aefc984df8
parent166ba97e36d7b53e7fa53d7853a8b9f5a509503c (diff)
parent097982d3484f30e32dc03113944186f471f36505 (diff)
downloadconfigshell-fb-c8ea2bf6b2e58296c9061f7c9f6f96a28d9c7937.tar.gz
Merge pull request #47 from pkalever/version
configshell: export __version__ variable
-rw-r--r--configshell/__init__.py7
-rwxr-xr-xsetup.py14
2 files changed, 20 insertions, 1 deletions
diff --git a/configshell/__init__.py b/configshell/__init__.py
index 8580669..70af749 100644
--- a/configshell/__init__.py
+++ b/configshell/__init__.py
@@ -15,7 +15,7 @@ License for the specific language governing permissions and limitations
under the License.
'''
-if __name__ == "configshell":
+if __name__ == 'configshell-fb':
from warnings import warn
warn("'configshell' package name for configshell-fb is deprecated, please"
+ " instead import 'configshell_fb'", UserWarning, stacklevel=2)
@@ -25,3 +25,8 @@ from .log import Log
from .node import ConfigNode, ExecutionError
from .prefs import Prefs
from .shell import ConfigShell
+
+__version__ = '1.1.25'
+__url__ = 'http://github.com/open-iscsi/configshell-fb'
+__description__ = 'A framework to implement simple but nice CLIs.'
+__license__ = 'Apache 2.0'
diff --git a/setup.py b/setup.py
index 81af568..71d9412 100755
--- a/setup.py
+++ b/setup.py
@@ -16,8 +16,22 @@ License for the specific language governing permissions and limitations
under the License.
'''
+import os
+import re
from setuptools import setup
+# Get version without importing.
+init_file_path = os.path.join(os.path.dirname(__file__), 'configshell/__init__.py')
+
+with open(init_file_path) as f:
+ for line in f:
+ match = re.match(r"__version__.*'([0-9.]+)'", line)
+ if match:
+ version = match.group(1)
+ break
+ else:
+ raise Exception("Couldn't find version in setup.py")
+
setup(
name = 'configshell-fb',
version = '1.1.25',