diff options
| author | kotfu <kotfu@kotfu.net> | 2018-07-29 18:15:14 -0600 |
|---|---|---|
| committer | kotfu <kotfu@kotfu.net> | 2018-07-29 18:15:14 -0600 |
| commit | 4da2d373319ef03d62dd5b0bbd1a8e7609a6c483 (patch) | |
| tree | 1579c31a2aab76407911f3c6c607476c2e300370 /cmd2/__init__.py | |
| parent | 2cfeac8ff7e5457b63b19057b8ab012663968e09 (diff) | |
| download | cmd2-git-4da2d373319ef03d62dd5b0bbd1a8e7609a6c483.tar.gz | |
Use setuptools_scm for version numbers
Diffstat (limited to 'cmd2/__init__.py')
| -rw-r--r-- | cmd2/__init__.py | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/cmd2/__init__.py b/cmd2/__init__.py index f61b7165..2de297d3 100644 --- a/cmd2/__init__.py +++ b/cmd2/__init__.py @@ -1,6 +1,14 @@ # # -*- coding: utf-8 -*- """This simply imports certain things for backwards compatibility.""" -from .cmd2 import __version__, Cmd, Statement, EmptyStatement, categorize + +from pkg_resources import get_distribution, DistributionNotFound +try: + __version__ = get_distribution(__name__).version +except DistributionNotFound: + # package is not installed + pass + +from .cmd2 import Cmd, Statement, EmptyStatement, categorize from .cmd2 import with_argument_list, with_argparser, with_argparser_and_unknown_args, with_category -from .pyscript_bridge import CommandResult
\ No newline at end of file +from .pyscript_bridge import CommandResult |
