Return a fallback "version" if dosage is not installed
Additionally, inform the user on how to fix the problem. Thanks to twb for noticing this.
This commit is contained in:
parent
7615ee60d1
commit
f5253c7f45
1 changed files with 4 additions and 1 deletions
|
@ -27,4 +27,7 @@ try:
|
|||
__version__ = version(AppName) # PEP 396
|
||||
except PackageNotFoundError:
|
||||
# package is not installed
|
||||
pass
|
||||
out.warn('{} is not installed, no version available.'
|
||||
' Use at least {!r} or {!r} to fix this.'.format(
|
||||
AppName, 'pip install -e .', 'setup.py egg_info'))
|
||||
__version__ = 'ERR.NOT.INSTALLED'
|
||||
|
|
Loading…
Reference in a new issue