use VERSION file to avoid importing gridlock before its installed

This commit is contained in:
Jan Petykiewicz 2019-09-30 23:40:23 -07:00
parent e97bd482a9
commit f62be35966
4 changed files with 14 additions and 3 deletions

View File

@ -1,2 +1,3 @@
include README.md include README.md
include LICENSE.md include LICENSE.md
include gridlock/VERSION

1
gridlock/VERSION Normal file
View File

@ -0,0 +1 @@
0.3

View File

@ -16,10 +16,14 @@ Dependencies:
- skimage [Grid.visualize_isosurface()] - skimage [Grid.visualize_isosurface()]
""" """
import pathlib
from .error import GridError from .error import GridError
from .direction import Direction from .direction import Direction
from .grid import Grid from .grid import Grid
__author__ = 'Jan Petykiewicz' __author__ = 'Jan Petykiewicz'
version = '0.3' with open(pathlib.Path(__file__).parent / 'VERSION', 'r') as f:
__version__ = f.read().strip()
version = __version__

View File

@ -1,13 +1,15 @@
#!/usr/bin/env python3 #!/usr/bin/env python3
from setuptools import setup, find_packages from setuptools import setup, find_packages
import gridlock
with open('README.md', 'r') as f: with open('README.md', 'r') as f:
long_description = f.read() long_description = f.read()
with open('gridlock/VERSION', 'r') as f:
version = f.read().strip()
setup(name='gridlock', setup(name='gridlock',
version=gridlock.version, version=version,
description='Coupled gridding library', description='Coupled gridding library',
long_description=long_description, long_description=long_description,
long_description_content_type='text/markdown', long_description_content_type='text/markdown',
@ -15,6 +17,9 @@ setup(name='gridlock',
author_email='anewusername@gmail.com', author_email='anewusername@gmail.com',
url='https://mpxd.net/code/jan/gridlock', url='https://mpxd.net/code/jan/gridlock',
packages=find_packages(), packages=find_packages(),
package_data={
'gridlock': ['VERSION']
},
install_requires=[ install_requires=[
'numpy', 'numpy',
'float_raster', 'float_raster',