From 0ad289e5ac733001187e43e042cd95ba00e9d8e8 Mon Sep 17 00:00:00 2001 From: Jan Petykiewicz Date: Fri, 27 Sep 2019 20:44:31 -0700 Subject: [PATCH] Switch to file-based version number --- MANIFEST.in | 3 +++ meanas/VERSION | 1 + meanas/__init__.py | 6 ++++-- setup.py | 8 +++++++- 4 files changed, 15 insertions(+), 3 deletions(-) create mode 100644 MANIFEST.in create mode 100644 meanas/VERSION diff --git a/MANIFEST.in b/MANIFEST.in new file mode 100644 index 0000000..41ad357 --- /dev/null +++ b/MANIFEST.in @@ -0,0 +1,3 @@ +include README.md +include LICENSE.md +include meanas/VERSION diff --git a/meanas/VERSION b/meanas/VERSION new file mode 100644 index 0000000..2eb3c4f --- /dev/null +++ b/meanas/VERSION @@ -0,0 +1 @@ +0.5 diff --git a/meanas/__init__.py b/meanas/__init__.py index 131646b..76388dc 100644 --- a/meanas/__init__.py +++ b/meanas/__init__.py @@ -41,10 +41,12 @@ Dependencies: """ -import pkg_resources +import pathlib from .types import dx_lists_t, field_t, vfield_t, field_updater from .vectorization import vec, unvec __author__ = 'Jan Petykiewicz' -__version__ = pkg_resources.get_distribution('meanas').version + +with open(pathlib.Path(__file__).parent / 'VERSION', 'r') as f: + __version__ = f.read().strip() diff --git a/setup.py b/setup.py index 7093b57..f5e0a77 100644 --- a/setup.py +++ b/setup.py @@ -5,8 +5,11 @@ 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() + setup(name='meanas', - version='0.5', + version=version, description='Electromagnetic simulation tools', long_description=long_description, long_description_content_type='text/markdown', @@ -14,6 +17,9 @@ setup(name='meanas', author_email='anewusername@gmail.com', url='https://mpxd.net/code/jan/fdfd_tools', packages=find_packages(), + package_data={ + 'meanas': ['VERSION'] + }, install_requires=[ 'numpy', 'scipy',