Skip to content

Commit 5e93d2f

Browse files
committed
unify version handling of the package
1 parent 250e3ac commit 5e93d2f

File tree

3 files changed

+3
-10
lines changed

3 files changed

+3
-10
lines changed

python/cdo/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
__author__ = "Brian Earl Spilner [email protected]"
2-
__version__ = "1.6"
2+
__version__ = "1.6.0"
33

44
from .cdo import Cdo, CDOException

python/cdo/cdo.py

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -53,8 +53,6 @@
5353
# POSSIBILITY OF SUCH DAMAGE.
5454
# }}}
5555

56-
CDO_PY_VERSION = "1.6"
57-
5856
# build interactive documentation: help(cdo.sinfo) {{{
5957

6058
def operator_doc(tool, path2cdo):
@@ -795,11 +793,6 @@ def readXDataset(self, ifile=None):
795793

796794
return self.xa_open(ifile)
797795

798-
# internal helper methods:
799-
# return internal cdo.py version
800-
def __version__(self):
801-
return CDO_PY_VERSION
802-
803796
def __print__(self, context=''):
804797
if '' != context:
805798
print('CDO:CONTEXT ' + context)

python/test/test_cdo.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@
2323
# add local dir to search path
2424
sys.path.insert(0,os.path.dirname(sys.path[0]))
2525
from cdo import Cdo, CDOException
26-
26+
import cdo as cdoPkg
2727

2828
if 'CDF_MOD' in os.environ:
2929
CDF_MOD = os.environ['CDF_MOD']
@@ -85,9 +85,9 @@ def test_ju(self):
8585
print(cdo.sinfov(input='-topo'))
8686

8787
def testCDO(self):
88+
self.assertTrue(parse_version(cdoPkg.__version__) >= parse_version('1.6.0'))
8889
cdo = Cdo()
8990
print('this is CDO version %s'%(cdo.version()))
90-
print('cdo-bindings version: %s'%(cdo.__version__()))
9191
newCDO="/home/ram/src/tools/spack/opt/spack/linux-antergos-skylake/gcc-11.1.0/cdo-1.9.9-switof25xqmlys765t7aonnc564wl3jl/bin/cdo"
9292
if os.path.isfile(newCDO):
9393
cdo.setCdo(newCDO)

0 commit comments

Comments
 (0)