Repository: NOhs/dkey

Issue:
Dkey should provide version info
It is common practice to provide the version of an installed package via `__version__` etc. This should be added.

Discussion:
coveralls: 
[![Coverage Status](https://coveralls.io/builds/22497490/badge)](https://coveralls.io/builds/22497490)

Coverage remained the same at 100.0% when pulling **4d8ecc412eaf39b83911e68c66db16e2f1e85e67 on added_version_info** into **098cecbe1c1ed8cca92029dbd90f77cc6c0d7673 on master**.


Patch:
diff --git a/dkey/__init__.py b/dkey/__init__.py
index 266df21..f71a87d 100644
--- a/dkey/__init__.py
+++ b/dkey/__init__.py
@@ -10,6 +10,20 @@ dkey
 ====
 Function to generate deprecated keys.
 
+__version__
+===========
+A string indicating which version of dkey is currently used.
+
+version_info
+============
+A tuple containing the currently used version.
+
 """
 from ._dkey import deprecate_keys as deprecate_keys
 from ._dkey import dkey as dkey
+
+from pbr.version import VersionInfo
+
+_v = VersionInfo('mgen').semantic_version()
+__version__ = _v.release_string()
+version_info = _v.version_tuple()


Test patch:
diff --git a/tests/test_dkey.py b/tests/test_dkey.py
index fa6ae8d..3105fd0 100644
--- a/tests/test_dkey.py
+++ b/tests/test_dkey.py
@@ -6,6 +6,12 @@ from contextlib import contextmanager
 
 from dkey import deprecate_keys, dkey
 
+class version_test_case(unittest.TestCase):
+    def test_version_string_available(self):
+        import dkey as dk
+        self.assertTrue(hasattr(dk, '__version__'))
+        self.assertTrue(hasattr(dk, 'version_info'))
+
 class dkey_test_case(unittest.TestCase):
     def test_number_of_keys_incorrect(self):
         with self.assertRaises(ValueError):