From 9759645f927f42f72794b7df2f57fa721fbda39c Mon Sep 17 00:00:00 2001 From: Jan Petykiewicz Date: Sun, 1 Nov 2020 20:16:06 -0800 Subject: [PATCH] move version info into VERSION.py This avoid needing custom spec files for pyinstaller, which doesn't handle package_data by default --- mem_edit/VERSION | 1 - mem_edit/VERSION.py | 4 ++++ mem_edit/__init__.py | 6 ++---- setup.py | 6 +++--- 4 files changed, 9 insertions(+), 8 deletions(-) delete mode 100644 mem_edit/VERSION create mode 100644 mem_edit/VERSION.py diff --git a/mem_edit/VERSION b/mem_edit/VERSION deleted file mode 100644 index bd73f47..0000000 --- a/mem_edit/VERSION +++ /dev/null @@ -1 +0,0 @@ -0.4 diff --git a/mem_edit/VERSION.py b/mem_edit/VERSION.py new file mode 100644 index 0000000..a3aacc8 --- /dev/null +++ b/mem_edit/VERSION.py @@ -0,0 +1,4 @@ +""" VERSION defintion. THIS FILE IS MANUALLY PARSED BY setup.py and REQUIRES A SPECIFIC FORMAT """ +__version__ = ''' +0.4 +''' diff --git a/mem_edit/__init__.py b/mem_edit/__init__.py index 8947638..a4a0178 100644 --- a/mem_edit/__init__.py +++ b/mem_edit/__init__.py @@ -12,16 +12,14 @@ To get started, try: """ import platform -import pathlib from .utils import MemEditError __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 compatibility system = platform.system() diff --git a/setup.py b/setup.py index 5b53ab7..3a55145 100644 --- a/setup.py +++ b/setup.py @@ -5,8 +5,8 @@ from setuptools import setup, find_packages with open('README.md', 'r') as f: long_description = f.read() -with open('mem_edit/VERSION', 'r') as f: - version = f.read().strip() +with open('mem_edit/VERSION.py', 'rt') as f: + version = f.readlines()[2].strip() setup(name='mem_edit', version=version, @@ -50,7 +50,7 @@ setup(name='mem_edit', ], packages=find_packages(), package_data={ - 'mem_edit': ['VERSION'] + 'mem_edit': [] }, install_requires=[ 'typing',