mirror of
https://github.com/gsi-upm/senpy
synced 2025-09-17 20:12:22 +00:00
Added fallback version '0.0'
Installing depends on the VERSION file, so it raies an error if it is installed in some other way. ReadTheDocs installs the package so it can generate code docs. This commit adds a default version 0.0
This commit is contained in:
@@ -8,8 +8,12 @@ DEFAULT_FILE = os.path.join(ROOT, 'VERSION')
|
||||
|
||||
|
||||
def read_version(versionfile=DEFAULT_FILE):
|
||||
with open(versionfile) as f:
|
||||
return f.read().strip()
|
||||
try:
|
||||
with open(versionfile) as f:
|
||||
return f.read().strip()
|
||||
except IOError:
|
||||
logger.error('Running an unknown version of senpy. Be careful!.')
|
||||
return '0.0'
|
||||
|
||||
|
||||
__version__ = read_version()
|
||||
|
Reference in New Issue
Block a user