From b9322be77fa2aeeb5270c075c494d938108887a6 Mon Sep 17 00:00:00 2001 From: Jan Petykiewicz Date: Sun, 1 Nov 2020 19:45:31 -0800 Subject: [PATCH] move VERSION into a .py file that gets directly parsed by setup.py avoids possible issues with pyinstaller --- masque/VERSION | 1 - masque/VERSION.py | 4 ++++ masque/__init__.py | 7 ++----- setup.py | 7 +++---- 4 files changed, 9 insertions(+), 10 deletions(-) delete mode 100644 masque/VERSION create mode 100644 masque/VERSION.py diff --git a/masque/VERSION b/masque/VERSION deleted file mode 100644 index 8bbe6cf..0000000 --- a/masque/VERSION +++ /dev/null @@ -1 +0,0 @@ -2.2 diff --git a/masque/VERSION.py b/masque/VERSION.py new file mode 100644 index 0000000..c80f65a --- /dev/null +++ b/masque/VERSION.py @@ -0,0 +1,4 @@ +""" VERSION defintion. THIS FILE IS MANUALLY PARSED BY setup.py and REQUIRES A SPECIFIC FORMAT """ +__version__ = ''' +2.2 +''' diff --git a/masque/__init__.py b/masque/__init__.py index 87ceb5d..48059b3 100644 --- a/masque/__init__.py +++ b/masque/__init__.py @@ -17,8 +17,6 @@ otherwise noted, assume that arguments are stored by-reference. """ -import pathlib - from .error import PatternError, PatternLockedError from .shapes import Shape from .label import Label @@ -30,6 +28,5 @@ from .library import Library __author__ = 'Jan Petykiewicz' -with open(pathlib.Path(__file__).parent / 'VERSION', 'r') as f: - __version__ = f.read().strip() -version = __version__ +from .VERSION import __version__ +version = __version__ # legacy diff --git a/setup.py b/setup.py index ff8aad9..f12de6a 100644 --- a/setup.py +++ b/setup.py @@ -6,8 +6,8 @@ from setuptools import setup, find_packages with open('README.md', 'r') as f: long_description = f.read() -with open('masque/VERSION', 'r') as f: - version = f.read().strip() +with open('masque/VERSION.py', 'rt') as f: + version = f.readlines()[2].strip() setup(name='masque', version=version, @@ -19,8 +19,7 @@ setup(name='masque', url='https://mpxd.net/code/jan/masque', packages=find_packages(), package_data={ - 'masque': ['VERSION', - 'py.typed', + 'masque': ['py.typed', ] }, install_requires=[