From e5e30a9414ec22ad6e271f82836fbd78fd20e317 Mon Sep 17 00:00:00 2001 From: Jan Petykiewicz Date: Tue, 3 Nov 2020 01:20:53 -0800 Subject: [PATCH] Use VERSION.py instead of plain text VERSION --- float_raster/VERSION | 1 - float_raster/VERSION.py | 4 ++++ float_raster/__init__.py | 7 +------ setup.py | 9 ++++----- 4 files changed, 9 insertions(+), 12 deletions(-) delete mode 100644 float_raster/VERSION create mode 100644 float_raster/VERSION.py diff --git a/float_raster/VERSION b/float_raster/VERSION deleted file mode 100644 index 2eb3c4f..0000000 --- a/float_raster/VERSION +++ /dev/null @@ -1 +0,0 @@ -0.5 diff --git a/float_raster/VERSION.py b/float_raster/VERSION.py new file mode 100644 index 0000000..d15f477 --- /dev/null +++ b/float_raster/VERSION.py @@ -0,0 +1,4 @@ +""" VERSION defintion. THIS FILE IS MANUALLY PARSED BY setup.py and REQUIRES A SPECIFIC FORMAT """ +__version__ = ''' +0.5 +''' diff --git a/float_raster/__init__.py b/float_raster/__init__.py index 1d96371..db3be2a 100644 --- a/float_raster/__init__.py +++ b/float_raster/__init__.py @@ -5,12 +5,7 @@ Module for rasterizing polygons, with float-precision anti-aliasing on See the documentation for float_raster.raster(...) for details. """ -import pathlib - +from .VERSION import __version__ from .float_raster import * __author__ = 'Jan Petykiewicz' - -with open(pathlib.Path(__file__).parent / 'VERSION', 'r') as f: - __version__ = f.read().strip() - diff --git a/setup.py b/setup.py index e47add2..aabd219 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('float_raster/VERSION', 'r') as f: - version = f.read().strip() +with open('float_raster/VERSION.py', 'rt') as f: + version = f.readlines()[2].strip() setup(name='float_raster', version=version, @@ -18,9 +19,7 @@ setup(name='float_raster', url='https://mpxd.net/code/jan/float_raster', packages=find_packages(), package_data={ - 'float_raster': ['VERSION', - 'py.typed', - ] + 'float_raster': ['py.typed'] }, install_requires=[ 'numpy',