Browse Source

Install package on travis to correctly get version number

upstream/backport/20220103
Ruben Verweij 4 years ago
committed by Lorenzo ZOLFANELLI
parent
commit
ac6c4a39e4
2 changed files with 6 additions and 5 deletions
  1. +1
    -0
      .travis.yml
  2. +5
    -5
      nd2reader/__init__.py

+ 1
- 0
.travis.yml View File

@ -26,6 +26,7 @@ before_script:
- curl -L https://codeclimate.com/downloads/test-reporter/test-reporter-latest-linux-amd64 > ./cc-test-reporter
- chmod +x ./cc-test-reporter
- ./cc-test-reporter before-build
- python setup.py develop # need to install to get version number
script: python ./test.py


+ 5
- 5
nd2reader/__init__.py View File

@ -2,12 +2,12 @@ from os import path
from nd2reader.reader import ND2Reader
from nd2reader.legacy import Nd2
#try:
import importlib.metadata as importlib_metadata
#except:
# import importlib_metadata
try:
import importlib.metadata as importlib_metadata
except:
import importlib_metadata
try:
__version__ = importlib_metadata.version(__name__)
except:
raise ValueError('Unable to read version number')
print('Unable to read version number')

Loading…
Cancel
Save