use VERSION.py instead of plain VERSION file

reduces reliance on package_data
This commit is contained in:
Jan Petykiewicz 2020-11-03 01:27:47 -08:00
parent 60f879a1ad
commit b996f5f27e
4 changed files with 9 additions and 9 deletions

View File

@ -1 +0,0 @@
0.9

4
fatamorgana/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__ = '''
0.9
'''

View File

@ -37,7 +37,5 @@ from .basic import (
__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__ version = __version__

View File

@ -2,11 +2,12 @@
from setuptools import setup, find_packages 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('fatamorgana/VERSION', 'r') as f: with open('fatamorgana/VERSION.py', 'rt') as f:
version = f.read().strip() version = f.readlines()[2].strip()
setup(name='fatamorgana', setup(name='fatamorgana',
version=version, version=version,
@ -18,9 +19,7 @@ setup(name='fatamorgana',
url='https://mpxd.net/code/jan/fatamorgana', url='https://mpxd.net/code/jan/fatamorgana',
packages=find_packages(), packages=find_packages(),
package_data={ package_data={
'fatamorgana': ['VERSION', 'fatamorgana': ['py.typed'],
'py.typed',
],
}, },
install_requires=[ install_requires=[
'typing', 'typing',