From b996f5f27eb6c0bbb949ec75c0bb22aa391095d8 Mon Sep 17 00:00:00 2001 From: Jan Petykiewicz Date: Tue, 3 Nov 2020 01:27:47 -0800 Subject: [PATCH] use VERSION.py instead of plain VERSION file reduces reliance on package_data --- fatamorgana/VERSION | 1 - fatamorgana/VERSION.py | 4 ++++ fatamorgana/__init__.py | 4 +--- setup.py | 9 ++++----- 4 files changed, 9 insertions(+), 9 deletions(-) delete mode 100644 fatamorgana/VERSION create mode 100644 fatamorgana/VERSION.py diff --git a/fatamorgana/VERSION b/fatamorgana/VERSION deleted file mode 100644 index b63ba69..0000000 --- a/fatamorgana/VERSION +++ /dev/null @@ -1 +0,0 @@ -0.9 diff --git a/fatamorgana/VERSION.py b/fatamorgana/VERSION.py new file mode 100644 index 0000000..032341c --- /dev/null +++ b/fatamorgana/VERSION.py @@ -0,0 +1,4 @@ +""" VERSION defintion. THIS FILE IS MANUALLY PARSED BY setup.py and REQUIRES A SPECIFIC FORMAT """ +__version__ = ''' +0.9 +''' diff --git a/fatamorgana/__init__.py b/fatamorgana/__init__.py index a2198f5..bd0f57e 100644 --- a/fatamorgana/__init__.py +++ b/fatamorgana/__init__.py @@ -37,7 +37,5 @@ from .basic import ( __author__ = 'Jan Petykiewicz' -with open(pathlib.Path(__file__).parent / 'VERSION', 'r') as f: - __version__ = f.read().strip() +from .VERSION import __version version = __version__ - diff --git a/setup.py b/setup.py index a66adc1..9727e26 100644 --- a/setup.py +++ b/setup.py @@ -2,11 +2,12 @@ from setuptools import setup, find_packages + with open('README.md', 'r') as f: long_description = f.read() -with open('fatamorgana/VERSION', 'r') as f: - version = f.read().strip() +with open('fatamorgana/VERSION.py', 'rt') as f: + version = f.readlines()[2].strip() setup(name='fatamorgana', version=version, @@ -18,9 +19,7 @@ setup(name='fatamorgana', url='https://mpxd.net/code/jan/fatamorgana', packages=find_packages(), package_data={ - 'fatamorgana': ['VERSION', - 'py.typed', - ], + 'fatamorgana': ['py.typed'], }, install_requires=[ 'typing',