Browse Source

Fix #42: read version number from setup.py

upstream/backport/20220103
Ruben Verweij 4 years ago
committed by Lorenzo ZOLFANELLI
parent
commit
a58d8d75de
2 changed files with 11 additions and 2 deletions
  1. +9
    -1
      nd2reader/__init__.py
  2. +2
    -1
      setup.py

+ 9
- 1
nd2reader/__init__.py View File

@ -2,4 +2,12 @@ from os import path
from nd2reader.reader import ND2Reader from nd2reader.reader import ND2Reader
from nd2reader.legacy import Nd2 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')

+ 2
- 1
setup.py View File

@ -1,5 +1,6 @@
from setuptools import setup from setuptools import setup
from nd2reader import __version__ as VERSION
VERSION = '3.2.3'
if __name__ == '__main__': if __name__ == '__main__':
setup( setup(


Loading…
Cancel
Save