aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/vk/version.py
diff options
context:
space:
mode:
authorEgor Tensin <Egor.Tensin@gmail.com>2023-03-03 10:17:28 +0100
committerEgor Tensin <Egor.Tensin@gmail.com>2023-03-03 10:17:28 +0100
commit0835d1b7811c38f8e4f48ae3772d26fccd70c217 (patch)
tree4e054105ceb6735a6d99f737fa9a4e0ef44ac2dc /vk/version.py
parentworkflows/ci: unpin runner image (diff)
downloadvk-scripts-0835d1b7811c38f8e4f48ae3772d26fccd70c217.tar.gz
vk-scripts-0835d1b7811c38f8e4f48ae3772d26fccd70c217.zip
add runtime version informationv1.0.3
Diffstat (limited to 'vk/version.py')
-rw-r--r--vk/version.py15
1 files changed, 15 insertions, 0 deletions
diff --git a/vk/version.py b/vk/version.py
new file mode 100644
index 0000000..6843bf4
--- /dev/null
+++ b/vk/version.py
@@ -0,0 +1,15 @@
+try:
+ import importlib.metadata as metadata
+except ImportError:
+ import importlib_metadata as metadata
+
+
+try:
+ __version__ = metadata.version('vk_scripts')
+except Exception:
+ __version__ = 'unknown'
+
+
+def add_to_arg_parser(parser):
+ parser.add_argument('--version', '-V', action='version',
+ version=f'%(prog)s {__version__}')