mirror of
https://github.com/gsi-upm/senpy
synced 2024-09-28 17:01:43 +00:00
cbeb3adbdb
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
20 lines
416 B
Python
20 lines
416 B
Python
import os
|
|
import logging
|
|
|
|
logger = logging.getLogger(__name__)
|
|
|
|
ROOT = os.path.dirname(__file__)
|
|
DEFAULT_FILE = os.path.join(ROOT, 'VERSION')
|
|
|
|
|
|
def read_version(versionfile=DEFAULT_FILE):
|
|
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()
|