diff options
| author | Owen Jacobson <owen@grimoire.ca> | 2020-12-21 23:33:35 -0500 |
|---|---|---|
| committer | Owen Jacobson <owen@grimoire.ca> | 2020-12-21 23:33:35 -0500 |
| commit | 4fc6e6f5186163ecf03582d74c668d2329cf031a (patch) | |
| tree | 0ef6ef93ac467caef06fe14236bfd4f1f6928a42 /envdir | |
| parent | 7c5bef76c50121e2171e0e67feff2fb46b2a3a56 (diff) | |
Pull version information from Git tags.
Diffstat (limited to 'envdir')
| -rw-r--r-- | envdir/__init__.py | 7 | ||||
| -rw-r--r-- | envdir/cli.py | 1 |
2 files changed, 8 insertions, 0 deletions
diff --git a/envdir/__init__.py b/envdir/__init__.py index e69de29..a7b85bd 100644 --- a/envdir/__init__.py +++ b/envdir/__init__.py @@ -0,0 +1,7 @@ +from importlib.metadata import version, PackageNotFoundError + +try: + __version__ = version("envdir-helper") +except PackageNotFoundError: + # package is not installed + pass diff --git a/envdir/cli.py b/envdir/cli.py index 9f9db15..3eea246 100644 --- a/envdir/cli.py +++ b/envdir/cli.py @@ -9,6 +9,7 @@ import subprocess as sp @click.command() @click.pass_context +@click.version_option() @click.argument( "envdir", default=pathlib.Path.home() / ".envdir", |
