avoid dependencies on package_data

__doc__ is handled poorly here; consider an alternate approach
This commit is contained in:
Jan Petykiewicz 2020-11-03 01:12:27 -08:00
parent db23cc1d6f
commit f4afb06210
4 changed files with 15 additions and 8 deletions

View File

@ -1 +0,0 @@
0.6

4
meanas/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.6
'''

View File

@ -6,11 +6,14 @@ See the readme or `import meanas; help(meanas)` for more info.
import pathlib import pathlib
from .VERSION import __version__
__author__ = 'Jan Petykiewicz' __author__ = 'Jan Petykiewicz'
with open(pathlib.Path(__file__).parent / 'VERSION', 'r') as f:
__version__ = f.read().strip()
try:
with open(pathlib.Path(__file__).parent.parent / 'README.md', 'r') as f: with open(pathlib.Path(__file__).parent.parent / 'README.md', 'r') as f:
__doc__ = f.read() __doc__ = f.read()
except Exception:
pass

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