diff --git a/meanas/VERSION b/meanas/VERSION deleted file mode 100644 index 5a2a580..0000000 --- a/meanas/VERSION +++ /dev/null @@ -1 +0,0 @@ -0.6 diff --git a/meanas/VERSION.py b/meanas/VERSION.py new file mode 100644 index 0000000..ba887e5 --- /dev/null +++ b/meanas/VERSION.py @@ -0,0 +1,4 @@ +""" VERSION defintion. THIS FILE IS MANUALLY PARSED BY setup.py and REQUIRES A SPECIFIC FORMAT """ +__version__ = ''' +0.6 +''' diff --git a/meanas/__init__.py b/meanas/__init__.py index 770bdf4..8b9b300 100644 --- a/meanas/__init__.py +++ b/meanas/__init__.py @@ -6,11 +6,14 @@ See the readme or `import meanas; help(meanas)` for more info. import pathlib +from .VERSION import __version__ + __author__ = 'Jan Petykiewicz' -with open(pathlib.Path(__file__).parent / 'VERSION', 'r') as f: - __version__ = f.read().strip() -with open(pathlib.Path(__file__).parent.parent / 'README.md', 'r') as f: - __doc__ = f.read() +try: + with open(pathlib.Path(__file__).parent.parent / 'README.md', 'r') as f: + __doc__ = f.read() +except Exception: + pass diff --git a/setup.py b/setup.py index 8438f8f..e316f82 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('meanas/VERSION', 'r') as f: - version = f.read().strip() +with open('meanas/VERSION.py', 'rt') as f: + version = f.readlines()[2].strip() setup(name='meanas', version=version, @@ -18,7 +19,7 @@ setup(name='meanas', url='https://mpxd.net/code/jan/meanas', packages=find_packages(), package_data={ - 'meanas': ['VERSION'] + 'meanas': [] }, install_requires=[ 'numpy',