[cmor] 148/190: WIP: testing python3

Alastair McKinstry mckinstry at moszumanska.debian.org
Tue Jul 21 12:54:49 UTC 2015


This is an automated email from the git hooks/post-receive script.

mckinstry pushed a commit to branch debian/master
in repository cmor.

commit 7318ae1fdec1f8daae1dbf447466bc2dcd07e964
Author: Alastair McKinstry <mckinstry at debian.org>
Date:   Wed Jun 12 15:52:32 2013 +0100

    WIP: testing python3
---
 debian/patches/destdir.patch | 15 ++++++++++++---
 debian/patches/python3.patch | 30 +++++++++++++++---------------
 debian/rules                 | 19 +++++++++++++------
 3 files changed, 40 insertions(+), 24 deletions(-)

diff --git a/debian/patches/destdir.patch b/debian/patches/destdir.patch
index 5460eac..f2723c0 100644
--- a/debian/patches/destdir.patch
+++ b/debian/patches/destdir.patch
@@ -1,12 +1,12 @@
 Author: Alastair McKinstry <mckinstry at debian.org>
 Description: Add DESTDIR support for installing.
-Last-Updated: 2013-06-10
+Last-Updated: 2013-06-11
 Forwarded: no
 
 Index: cmor-2.8.3/Makefile.in
 ===================================================================
---- cmor-2.8.3.orig/Makefile.in	2013-06-10 19:02:07.000000000 +0100
-+++ cmor-2.8.3/Makefile.in	2013-06-10 19:02:07.000000000 +0100
+--- cmor-2.8.3.orig/Makefile.in	2013-06-12 14:10:28.000000000 +0100
++++ cmor-2.8.3/Makefile.in	2013-06-12 15:48:46.000000000 +0100
 @@ -87,14 +87,14 @@
  	@echo "Completely cleaning [$(WHEREAMI)]..."
  	@rm -f $(DISTFILES)
@@ -30,3 +30,12 @@ Index: cmor-2.8.3/Makefile.in
  install_shlib: $(SONAME)
  	mkdir -p $(DESTDIR)@prefix@/lib
  	cp -p $(SONAME) $(DESTDIR)@prefix@/lib
+@@ -116,7 +116,7 @@
+ 	rm -f test_lots_of_variables ; @CC@ @CFLAGS@ @USERCFLAGS@ @CPPFLAGS@  Test/test_lots_of_variables.c -L at prefix@/lib -I at prefix@/include  -L. -lcmor @NCCFLAGS@ @NCLDFLAGS@ @UDUNITS2LDFLAGS@ @UDUNITS2FLAGS@ @UUIDLDFLAGS@ @UUIDLDFLAGS@ -lm -o test_lots_of_variables @VERB@; ./test_lots_of_variables @VERB@;
+ python:
+ 	@echo "Building Python interface"
+-	@${PYTHONEXEC} setup.py install @CDATPREFIX@
++	@${PYTHONEXEC} setup.py install --prefix=${DESTDIR}${PREFIX}
+ test_a_python:
+ 	@echo "${OK_COLOR}Testing ${TEST_NAME} ${NO_COLOR}"
+ 	${PYTHONEXEC} ${TEST_NAME} @VERB@
diff --git a/debian/patches/python3.patch b/debian/patches/python3.patch
index a5607d2..7246914 100644
--- a/debian/patches/python3.patch
+++ b/debian/patches/python3.patch
@@ -5,8 +5,8 @@ Forwarded: no
 
 Index: cmor-2.8.3/Lib/git2svn.py
 ===================================================================
---- cmor-2.8.3.orig/Lib/git2svn.py	2013-06-12 13:33:07.000000000 +0100
-+++ cmor-2.8.3/Lib/git2svn.py	2013-06-12 14:08:47.000000000 +0100
+--- cmor-2.8.3.orig/Lib/git2svn.py	2013-06-12 14:10:22.000000000 +0100
++++ cmor-2.8.3/Lib/git2svn.py	2013-06-12 14:10:28.000000000 +0100
 @@ -1,3 +1,4 @@
 +from __future__ import print_function
  import os,sys
@@ -33,8 +33,8 @@ Index: cmor-2.8.3/Lib/git2svn.py
      os.popen(cmd).readlines()
 Index: cmor-2.8.3/Lib/pywrapper.py
 ===================================================================
---- cmor-2.8.3.orig/Lib/pywrapper.py	2013-06-12 13:33:07.000000000 +0100
-+++ cmor-2.8.3/Lib/pywrapper.py	2013-06-12 13:33:12.000000000 +0100
+--- cmor-2.8.3.orig/Lib/pywrapper.py	2013-06-12 14:10:22.000000000 +0100
++++ cmor-2.8.3/Lib/pywrapper.py	2013-06-12 14:10:28.000000000 +0100
 @@ -1,4 +1,3 @@
 -
  import cmor_const,numpy,os,_cmor
@@ -708,8 +708,8 @@ Index: cmor-2.8.3/Lib/pywrapper.py
          if (file_name is False):
 Index: cmor-2.8.3/Lib/__init__.py
 ===================================================================
---- cmor-2.8.3.orig/Lib/__init__.py	2013-06-12 13:33:07.000000000 +0100
-+++ cmor-2.8.3/Lib/__init__.py	2013-06-12 13:33:12.000000000 +0100
+--- cmor-2.8.3.orig/Lib/__init__.py	2013-06-12 14:10:22.000000000 +0100
++++ cmor-2.8.3/Lib/__init__.py	2013-06-12 14:10:28.000000000 +0100
 @@ -1,9 +1,9 @@
 -from cmor_const import *
 -
@@ -728,8 +728,8 @@ Index: cmor-2.8.3/Lib/__init__.py
    pass
 Index: cmor-2.8.3/Lib/check_CMOR_compliant.py
 ===================================================================
---- cmor-2.8.3.orig/Lib/check_CMOR_compliant.py	2013-06-12 13:33:07.000000000 +0100
-+++ cmor-2.8.3/Lib/check_CMOR_compliant.py	2013-06-12 13:33:12.000000000 +0100
+--- cmor-2.8.3.orig/Lib/check_CMOR_compliant.py	2013-06-12 14:10:22.000000000 +0100
++++ cmor-2.8.3/Lib/check_CMOR_compliant.py	2013-06-12 14:10:28.000000000 +0100
 @@ -1,3 +1,4 @@
 +from __future__ import print_function
  import cdms2
@@ -1152,8 +1152,8 @@ Index: cmor-2.8.3/Lib/check_CMOR_compliant.py
             
 Index: cmor-2.8.3/Test/check_results.py
 ===================================================================
---- cmor-2.8.3.orig/Test/check_results.py	2013-06-12 13:33:07.000000000 +0100
-+++ cmor-2.8.3/Test/check_results.py	2013-06-12 13:33:12.000000000 +0100
+--- cmor-2.8.3.orig/Test/check_results.py	2013-06-12 14:10:22.000000000 +0100
++++ cmor-2.8.3/Test/check_results.py	2013-06-12 14:10:28.000000000 +0100
 @@ -2,6 +2,8 @@
  from in_files import input_tables
  import sys,os
@@ -1207,12 +1207,12 @@ Index: cmor-2.8.3/Test/check_results.py
 +    raise CMORResultCheckError(["Error checking output files for test: Test/%s.f90 we could only find %i files when %i were expected.\n\n Expected files: \n\t%s\n\nPresent files: \n\t%s\n\nMissing files: \n\t%s\n" % (test,nfiles,len(outfiles),repr(outfiles),repr(gotfiles),repr(missing)),])
 Index: cmor-2.8.3/Test/cmor_speed_and_compression_01.py
 ===================================================================
---- cmor-2.8.3.orig/Test/cmor_speed_and_compression_01.py	2013-06-12 13:33:07.000000000 +0100
-+++ cmor-2.8.3/Test/cmor_speed_and_compression_01.py	2013-06-12 13:33:12.000000000 +0100
+--- cmor-2.8.3.orig/Test/cmor_speed_and_compression_01.py	2013-06-12 14:10:22.000000000 +0100
++++ cmor-2.8.3/Test/cmor_speed_and_compression_01.py	2013-06-12 15:32:42.000000000 +0100
 @@ -1,11 +1,13 @@
++from __future__ import print_function 
  import cmor,numpy,sys,os
 +
-+from __future__ import print_function # Work with both python2 and python3
  try:
      import cdms2
      cdms2.setNetcdfShuffleFlag(0)
@@ -1286,8 +1286,8 @@ Index: cmor-2.8.3/Test/cmor_speed_and_compression_01.py
  f.close()
 Index: cmor-2.8.3/setup.py.in
 ===================================================================
---- cmor-2.8.3.orig/setup.py.in	2013-06-12 13:33:07.000000000 +0100
-+++ cmor-2.8.3/setup.py.in	2013-06-12 13:33:12.000000000 +0100
+--- cmor-2.8.3.orig/setup.py.in	2013-06-12 14:10:22.000000000 +0100
++++ cmor-2.8.3/setup.py.in	2013-06-12 14:10:28.000000000 +0100
 @@ -1,8 +1,10 @@
 +from __future__ import print_function # to be python2/python3 agnostic
  import numpy
diff --git a/debian/rules b/debian/rules
index 3206c12..d633e61 100755
--- a/debian/rules
+++ b/debian/rules
@@ -15,7 +15,8 @@ BUILD_ARCH_OS :-= $(shell dpkg-architecture -qDEB_BUILD_ARCH_OS)
 BUILD_ARCH_CPU := $(shell dpkg-architecture -qDEB_BUILD_ARCH_CPU)
 
 PYVERS:=`pyversions --supported`
-PY3VERS:=`py3versions --supported`
+PY3VERS:=''
+DESTDIR:=`pwd`/debian/tmp
 
 %:
 	dh $@ --with python2,python3
@@ -27,21 +28,27 @@ override_dh_auto_configure:
 		UUIDLDFLAGS="-lossp-uuid" UUIDFLAGS="-I/usr/include/ossp" SZLIBFLAGS=nosz
 
 override_dh_auto_clean:
-	rm -rf config.sub config.log config.status libcmor.a libcmor.so.2 build test_grid configure
+	rm -rf config.sub config.log config.status libcmor.a libcmor.so.2 build test_grid configure CMIP5
+	find . -name '*.nc' -delete
+	find . -name '*.o' -or -name '*.pic_o' -or -name '*.pyc' -delete
 
 override_dh_auto_build:
 	$(MAKE) FC=gfortran
 
-ifeq ( $(BUILD_ARCH_OS)-$(BUILD_ARCH_CPU), kfreebsd-i386)
 override_dh_auto_test:
+	for p in $(PYVERS) ; do \
+		$(MAKE) test_python PYTHONEXEC=$$p DESTDIR=$(DESTDIR)  ; done
+ifeq ( $(BUILD_ARCH_OS)-$(BUILD_ARCH_CPU), kfreebsd-i386)
 	@echo "Tests disabled; see http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=598745"
+else
+	dh_auto_test
 endif
 
 override_dh_auto_install:
-	$(MAKE) install DESTDIR=`pwd`/debian/tmp
-	$(MAKE) install_shlib DESTDIR=`pwd`/debian/tmp
+	$(MAKE) install DESTDIR=$(DESTDIR)
+	$(MAKE) install_shlib DESTDIR=$(DESTDIR)
 	for p in $(PYVERS) $(PY3VERS) ; do \
-		$$p ./setup.py install  --prefix==$(CURDIR)/debian/tmp ; \
+		$$p ./setup.py install  --prefix=$(DESTDIR)/usr ; \
 		done
 	dh_numpy
 	dh_install -p libcmor2 libcmor.so.2    $(LIBDIR)

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/debian-science/packages/cmor.git



More information about the debian-science-commits mailing list