Use fatamorgana/VERSION file to single-source version number

`import fatamorgana` inside setup.py could break if dependencies weren't
satisfied
This commit is contained in:
Jan Petykiewicz 2019-09-28 11:22:27 -07:00
commit e514ade2b1
4 changed files with 15 additions and 3 deletions

1
fatamorgana/VERSION Normal file
View file

@ -0,0 +1 @@
0.4

View file

@ -18,6 +18,8 @@
- Python 3.5 or later
- numpy (optional, no additional functionality)
"""
import pathlib
from .main import OasisLayout, Cell, XName
from .basic import NString, AString, Validation, OffsetTable, OffsetEntry, \
EOFError, SignedError, InvalidDataError, InvalidRecordError
@ -25,4 +27,7 @@ from .basic import NString, AString, Validation, OffsetTable, OffsetEntry, \
__author__ = 'Jan Petykiewicz'
version = '0.4'
with open(pathlib.Path(__file__).parent / 'VERSION', 'r') as f:
__version__ = f.read().strip()
version = __version__