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:
Tobias Gruetzmacher 2019-12-05 21:23:30 +01:00
parent 7615ee60d1
commit f5253c7f45

View file

@ -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'