diff --git a/nd2reader/__init__.py b/nd2reader/__init__.py index 8354a47..3941461 100644 --- a/nd2reader/__init__.py +++ b/nd2reader/__init__.py @@ -2,4 +2,12 @@ from os import path from nd2reader.reader import ND2Reader from nd2reader.legacy import Nd2 -__version__ = '3.2.3' +try: + import importlib.metadata as importlib_metadata +except ModuleNotFoundError: + import importlib_metadata + +try: + __version__ = importlib_metadata.version(__name__) +except: + print('Unable to read version number') diff --git a/setup.py b/setup.py index 0ade4f4..73f7bf7 100644 --- a/setup.py +++ b/setup.py @@ -1,5 +1,6 @@ from setuptools import setup -from nd2reader import __version__ as VERSION + +VERSION = '3.2.3' if __name__ == '__main__': setup(