You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@climate.apache.org by le...@apache.org on 2016/09/15 05:45:23 UTC
climate git commit: 3rd pass at CLIMATE-854 Ensure that ocw runs with
Python 3.X
Repository: climate
Updated Branches:
refs/heads/master 98020c9fe -> f931bb12c
3rd pass at CLIMATE-854 Ensure that ocw runs with Python 3.X
Project: http://git-wip-us.apache.org/repos/asf/climate/repo
Commit: http://git-wip-us.apache.org/repos/asf/climate/commit/f931bb12
Tree: http://git-wip-us.apache.org/repos/asf/climate/tree/f931bb12
Diff: http://git-wip-us.apache.org/repos/asf/climate/diff/f931bb12
Branch: refs/heads/master
Commit: f931bb12ca3f5155a7a844ea96088cb0a6f42ce1
Parents: 98020c9
Author: Lewis John McGibbney <le...@gmail.com>
Authored: Wed Sep 14 22:52:51 2016 -0700
Committer: Lewis John McGibbney <le...@gmail.com>
Committed: Wed Sep 14 22:52:51 2016 -0700
----------------------------------------------------------------------
test_smoke.py | 30 +++++++++++++++---------------
1 file changed, 15 insertions(+), 15 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/climate/blob/f931bb12/test_smoke.py
----------------------------------------------------------------------
diff --git a/test_smoke.py b/test_smoke.py
index e89f18d..863a943 100644
--- a/test_smoke.py
+++ b/test_smoke.py
@@ -29,11 +29,11 @@ FAILURE_MARK = '\033[91m' + u'\u274C' + '\033[0m'
def fail(prefix):
- print prefix + " " + FAILURE_MARK
+ print(prefix + " " + FAILURE_MARK)
def success(prefix):
- print prefix + " " + SUCCESS_MARK
+ print(prefix + " " + SUCCESS_MARK)
def check_dependencies(file):
@@ -49,18 +49,18 @@ def check_dependencies(file):
except DistributionNotFound as df:
fail(dep)
dep = str(df).split(' ')[1][1:-1]
- print '\n' + dep + ' dependency missing.'
- print 'Please install it using "pip/conda install ' + dep + '"'
+ print('\n' + dep + ' dependency missing.')
+ print('Please install it using "pip/conda install ' + dep + '"')
fail("\nDependencies")
end()
except VersionConflict as vc:
fail(dep)
- print ("\nRequired version and installed version differ for the "
+ print("\nRequired version and installed version differ for the "
"following package:\n"
"Required version: " + dep)
dep_name = str(vc).split(' ')[0][1:] # First element is '('
dep_version = str(vc).split(' ')[1]
- print "Installed version: " + dep_name + "==" + dep_version
+ print("Installed version: " + dep_name + "==" + dep_version)
fail("\nDependencies")
end()
@@ -73,8 +73,8 @@ def check_dataset_loading():
dataset = local.load_file(file_path, variable_name='value')
except Exception as e:
fail("\nDataset loading")
- print "The following error occured"
- print e
+ print("The following error occured")
+ print(e)
end(dataset)
success("\nDataset loading")
return dataset
@@ -88,8 +88,8 @@ def check_some_dataset_functions(dataset):
dataset.spatial_resolution()
except Exception as e:
fail("\nDataset functions")
- print "Following error occured:"
- print str(e)
+ print("Following error occured:")
+ print(str(e))
end(dataset)
success("\nDataset functions")
@@ -104,8 +104,8 @@ def check_some_dsp_functions(dataset):
dsp.ensemble([dataset])
except Exception as e:
fail("\nDataset processor functions")
- print "Following error occured:"
- print str(e)
+ print("Following error occured:")
+ print(str(e))
end()
finally:
os.remove(dataset.origin['path'])
@@ -117,15 +117,15 @@ def end(dataset=None):
if dataset:
os.remove(dataset.origin['path'])
'End program execution with return code 1'
- print '\033[91m' + "Some checks were unsuccessful"
- print "Please Fix them and run the test again." + '\033[0m'
+ print('\033[91m' + "Some checks were unsuccessful")
+ print("Please Fix them and run the test again." + '\033[0m')
exit(1)
def main():
pip_file = open(PIP_DEPENDENCIES_FILE, 'r')
conda_file = open(CONDA_DEPENDENCIES_FILE, 'r')
- print "Checking installed dependencies\n"
+ print("Checking installed dependencies\n")
check_dependencies(conda_file)
check_dependencies(pip_file)
success("\nDependencies")