Description: Minor changes for python3
Author: Alastair McKinstry <mckinsrty@debian.org>
Last-Updated: 2025-06-03
Forwarded: no

2025-06-03:
Updated to use python3 instead of python as executable.

--- a/Test/test_python_CMIP6_CV_bad_data_specs.py
+++ b/Test/test_python_CMIP6_CV_bad_data_specs.py
@@ -1,4 +1,4 @@
-#!/usr/bin/env python2.7
+#!/usr/bin/python3
 # If this example is not executed from the directory containing the
 # CMOR code, please first complete the following steps:
 #
@@ -28,14 +28,14 @@
             error_flag = cmor.dataset_json('Test/CMOR_input_TestTables.json')
             table_id = cmor.load_table('CMIP6_6hrLev_bad_specs.json')
             time = cmor.axis(table_entry='time1', units='days since 2000-01-01',
-                            coord_vals=numpy.array(range(1)),
-                            cell_bounds=numpy.array(range(2)))
+                            coord_vals=numpy.array(list(range(1))),
+                            cell_bounds=numpy.array(list(range(2))))
             latitude = cmor.axis(table_entry='latitude', units='degrees_north',
-                                coord_vals=numpy.array(range(5)),
-                                cell_bounds=numpy.array(range(6)))
+                                coord_vals=numpy.array(list(range(5))),
+                                 cell_bounds=numpy.array(list(range(6))))
             longitude = cmor.axis(table_entry='longitude', units='degrees_east',
-                                coord_vals=numpy.array(range(5)),
-                                cell_bounds=numpy.array(range(6)))
+                                coord_vals=numpy.array(list(range(5))),
+                                cell_bounds=numpy.array(list(range(6))))
             plev3 = cmor.axis(table_entry='plev3', units='Pa',
                             coord_vals=numpy.array([85000., 50000., 25000.]))
             axis_ids = [longitude, latitude, plev3, time]
@@ -57,4 +57,4 @@
         self.assertCV("data_specs_version")
 
 if __name__ == '__main__':
-    unittest.main()
\ No newline at end of file
+    unittest.main()
--- a/LibCV/PrePARE/PrePARE.py
+++ b/LibCV/PrePARE/PrePARE.py
@@ -1,4 +1,4 @@
-#!/usr/bin/env python
+#!/usr/bin/python3
 # -*- coding: utf-8 -*-
 #
 # Please first complete the following steps:
--- a/configure.ac
+++ b/configure.ac
@@ -125,7 +125,7 @@
 if [ test ${with_cdatb} != "-yes"  ] ; then
   if [ test ${with_cdatb} != "-no" ] ; then
     PYTHONEXEC=${with_cdat}/bin/cdat
-    MAKEDEPPYTHON="python"
+    MAKEDEPPYTHON="python3"
     MAKETESTPYTHON="test_python"
     CDATPREFIX="--prefix="${with_cdat}
   else
@@ -134,19 +134,19 @@
   fi
 else
   PYTHONEXEC="cdat"
-  MAKEDEPPYTHON="python"
+  MAKEDEPPYTHON="python3"
   MAKETESTPYTHON="test_python"
 fi
 AC_ARG_WITH([python],[AS_HELP_STRING([--with-python],[enable support for python put path root (w/o bin/python)])],[],[with_python="no"])
 with_pythonb="-"${with_python}
 if [ test ${with_pythonb} != "-yes"  ] ; then
   if [ test ${with_pythonb} != "-no" ] ; then
-    PYTHONEXEC=${with_python}/bin/python
-    MAKEDEPPYTHON="python"
+    PYTHONEXEC=${with_python}/bin/python3
+    MAKEDEPPYTHON="python3"
   fi
 else
-  PYTHONEXEC="python"
-  MAKEDEPPYTHON="python"
+  PYTHONEXEC="python3"
+  MAKEDEPPYTHON="python3"
 fi
 
 AC_SUBST(CDATPREFIX)
--- a/Makefile.in
+++ b/Makefile.in
@@ -149,13 +149,13 @@
 	env TEST_NAME=test_lots_of_variables make test_a_C
 # do something Linux-y
 endif
-python:
+python3:
 	@echo "Building Python interface"
 	LDSHARED=${LDSHARED} ${PYTHONEXEC} -m pip install --no-deps $(srcdir)
 test_a_python:
 	@echo "${OK_COLOR}Testing ${TEST_NAME} ${NO_COLOR}"
 	${PYTHONEXEC} ${TEST_NAME} ${VERB}
-test_python: python
+test_python: python3
 	env TEST_NAME=Test/test_non_monotonic_climo_bounds.py make test_a_python
 	# [missing] env TEST_NAME=Test/test_python_climatology.py make test_a_python
 	env TEST_NAME=Test/test_python_history.py make test_a_python
