move VERSION into a .py file that gets directly parsed by setup.py

avoids possible issues with pyinstaller
This commit is contained in:
Jan Petykiewicz 2020-11-01 19:45:31 -08:00
parent 1b400605b1
commit b9322be77f
4 changed files with 9 additions and 10 deletions

View File

@ -1 +0,0 @@
2.2

4
masque/VERSION.py Normal file
View File

@ -0,0 +1,4 @@
""" VERSION defintion. THIS FILE IS MANUALLY PARSED BY setup.py and REQUIRES A SPECIFIC FORMAT """
__version__ = '''
2.2
'''

View File

@ -17,8 +17,6 @@
otherwise noted, assume that arguments are stored by-reference. otherwise noted, assume that arguments are stored by-reference.
""" """
import pathlib
from .error import PatternError, PatternLockedError from .error import PatternError, PatternLockedError
from .shapes import Shape from .shapes import Shape
from .label import Label from .label import Label
@ -30,6 +28,5 @@ from .library import Library
__author__ = 'Jan Petykiewicz' __author__ = 'Jan Petykiewicz'
with open(pathlib.Path(__file__).parent / 'VERSION', 'r') as f: from .VERSION import __version__
__version__ = f.read().strip() version = __version__ # legacy
version = __version__

View File

@ -6,8 +6,8 @@ from setuptools import setup, find_packages
with open('README.md', 'r') as f: with open('README.md', 'r') as f:
long_description = f.read() long_description = f.read()
with open('masque/VERSION', 'r') as f: with open('masque/VERSION.py', 'rt') as f:
version = f.read().strip() version = f.readlines()[2].strip()
setup(name='masque', setup(name='masque',
version=version, version=version,
@ -19,8 +19,7 @@ setup(name='masque',
url='https://mpxd.net/code/jan/masque', url='https://mpxd.net/code/jan/masque',
packages=find_packages(), packages=find_packages(),
package_data={ package_data={
'masque': ['VERSION', 'masque': ['py.typed',
'py.typed',
] ]
}, },
install_requires=[ install_requires=[