[Python-modules-commits] [cf-python] 05/06: merge patched into master
Klaus Zimmermann
zklaus-guest at moszumanska.debian.org
Thu Sep 22 13:02:35 UTC 2016
This is an automated email from the git hooks/post-receive script.
zklaus-guest pushed a commit to branch master
in repository cf-python.
commit a253eaedda2e25c2f1b3352749405aa1629d8e62
Merge: ab198e3 2df3116
Author: Klaus Zimmermann <klaus_zimmermann at gmx.de>
Date: Wed Sep 21 17:02:54 2016 +0200
merge patched into master
cf/um/umread/c-lib/Makefile | 12 +-----
cf/um/umread/c-lib/type-dep/Makefile | 1 -
debian/.git-dpm | 4 +-
.../patches/0002-Added-stripping-of-type-lib.patch | 19 --------
...-config-to-avoid-network-access-and-add-.patch} | 2 +-
...=> 0003-Remove-special-udunits2-database.patch} | 2 +-
...0005-Test-fixes.patch => 0004-Test-fixes.patch} | 2 +-
...0005-Improve-umread-building-and-handling.patch | 33 ++++++++++++++
...k-with-gcc-for-standard-libs-and-dep-info.patch | 50 ----------------------
debian/patches/series | 9 ++--
10 files changed, 44 insertions(+), 90 deletions(-)
diff --cc debian/.git-dpm
index 49365fa,0000000..f0749c4
mode 100644,000000..100644
--- a/debian/.git-dpm
+++ b/debian/.git-dpm
@@@ -1,8 -1,0 +1,8 @@@
+# see git-dpm(1) from git-dpm package
- 833443d6c08c527ed8ae51303643dffafaf5201b
- 833443d6c08c527ed8ae51303643dffafaf5201b
++2df311662c4215485183da69902d6b3e352aa79a
++2df311662c4215485183da69902d6b3e352aa79a
+0a04259b30001c5b49f62c8f4902f376d9c97558
+0a04259b30001c5b49f62c8f4902f376d9c97558
+cf-python_1.3.1+dfsg.1.orig.tar.gz
+13622776b4c9064e37a776ae09edc0b85c00a416
+2261560
diff --cc debian/patches/0002-Patch-sphinx-config-to-avoid-network-access-and-add-.patch
index bde9384,0000000..a5d1fa9
mode 100644,000000..100644
--- a/debian/patches/0002-Patch-sphinx-config-to-avoid-network-access-and-add-.patch
+++ b/debian/patches/0002-Patch-sphinx-config-to-avoid-network-access-and-add-.patch
@@@ -1,56 -1,0 +1,56 @@@
- From a5cd411fce8b3a178ff154bd081fa9e8055bc24f Mon Sep 17 00:00:00 2001
++From 94359c41378ec35ed9ad95331104dd6f6c3a6ac7 Mon Sep 17 00:00:00 2001
+From: Klaus Zimmermann <klaus_zimmermann at gmx.de>
+Date: Wed, 14 Sep 2016 13:25:19 +0200
+Subject: Patch sphinx config to avoid network access and add local intersphinx
+ links.
+
+Signed-off-by: Klaus Zimmermann <klaus_zimmermann at gmx.de>
+---
+ docs/source/conf.py | 27 +++++++++++++++++++++++++--
+ 1 file changed, 25 insertions(+), 2 deletions(-)
+
+diff --git a/docs/source/conf.py b/docs/source/conf.py
+index 50084c5..7e24935 100755
+--- a/docs/source/conf.py
++++ b/docs/source/conf.py
+@@ -72,6 +72,30 @@ intersphinx_mapping = {
+ 'scipy': ('http://docs.scipy.org/doc/scipy/reference', None),
+ }
+
++def check_object_path(key, url, path):
++ if os.path.isfile(path):
++ return {key: (url, path)}
++ return {}
++
++intersphinx_mapping.update(check_object_path('sphinx',
++ 'http://sphinx.pocoo.org/',
++ '/usr/share/doc/sphinx-doc/html/objects.inv'))
++intersphinx_mapping.update(check_object_path('python',
++ 'http://docs.python.org/',
++ '/usr/share/doc/python'
++ + '.'.join([str(x) for x in sys.version_info[0:2]])
++ + '/html/objects.inv'))
++intersphinx_mapping.update(check_object_path('matplotlib',
++ 'http://matplotlib.sourceforge.net/',
++ '/usr/share/doc/python-matplotlib-doc/html/objects.inv'))
++intersphinx_mapping.update(check_object_path('numpy',
++ 'http://docs.scipy.org/doc/numpy/',
++ '/usr/share/doc/python-numpy-doc/html/objects.inv'))
++intersphinx_mapping.update(check_object_path('scipy',
++ 'http://docs.scipy.org/doc/scipy/',
++ '/usr/share/doc/python-scipy-doc/html/objects.inv'))
++
++
+ # The name of the default domain. Can also be None to disable a
+ # default domain. The default is 'py'.
+ #primary_domain = 'cf'
+@@ -324,8 +348,7 @@ def linkcode_resolve(domain, info):
+ #=================================================================
+
+
+- online_source_code = True
+-# online_source_code = False
++ online_source_code = False
+
+ if domain != 'py':
+ return None
diff --cc debian/patches/0003-Remove-special-udunits2-database.patch
index 485a675,0000000..e1e746b
mode 100644,000000..100644
--- a/debian/patches/0003-Remove-special-udunits2-database.patch
+++ b/debian/patches/0003-Remove-special-udunits2-database.patch
@@@ -1,114 -1,0 +1,114 @@@
- From 236c306f46c21191694836bd93263f28837712d2 Mon Sep 17 00:00:00 2001
++From 7823a5f624d309241d939c67097e83520625e899 Mon Sep 17 00:00:00 2001
+From: Klaus Zimmermann <klaus_zimmermann at gmx.de>
+Date: Wed, 14 Sep 2016 14:42:49 +0200
+Subject: Remove special udunits2 database.
+
+This removes the dependence of the program on the special cf udunits2
+database. The changes are now performed programmatically.
+
+Signed-off-by: Klaus Zimmermann <klaus_zimmermann at gmx.de>
+---
+ cf/units.py | 76 ++++++++++++++++++++++++++++++++++++++++++++++++++-----------
+ 1 file changed, 63 insertions(+), 13 deletions(-)
+
+diff --git a/cf/units.py b/cf/units.py
+index afbe7bf..ada337c 100644
+--- a/cf/units.py
++++ b/cf/units.py
+@@ -42,18 +42,6 @@ if sys.platform == 'darwin':
+ else:
+ # Linux
+ _udunits = ctypes.CDLL('libudunits2.so.0')
+-
+-# Get the name of the XML-formatted unit-database
+-_unit_database = os.path.join(os.path.dirname(__file__),
+- 'etc/udunits/udunits2.xml')
+-
+-if os.path.isfile(_unit_database):
+- # The database included with this module exists, so use it
+- _unit_database = _c_char_p(_unit_database)
+-else:
+- # Use the default (non-CF) database
+- print 'WARNING: Using the default (non-CF) Udunits database'
+- _unit_database = None
+ #--- End: if
+
+ # Suppress "overrides prefixed-unit" messages. This also suppresses
+@@ -76,7 +64,7 @@ _ut_read_xml.argtypes = (_c_char_p, )
+ _ut_read_xml.restype = _c_void_p
+
+ #print 'units: before _udunits.ut_read_xml(',_unit_database,')'
+-_ut_system = _ut_read_xml(_unit_database)
++_ut_system = _ut_read_xml(None)
+ #print 'units: after _udunits.ut_read_xml(',_unit_database,')'
+
+ # Reinstate the reporting of error messages
+@@ -194,6 +182,68 @@ _UT_DEFINITION = 8
+ _cv_convert_array = {4: _cv_convert_floats,
+ 8: _cv_convert_doubles}
+
++# Some function definitions necessary for the following
++# changes to the unit system.
++_ut_get_unit_by_name = _udunits.ut_get_unit_by_name
++_ut_get_unit_by_name.argtypes = (_c_void_p, _c_char_p)
++_ut_get_unit_by_name.restype = _c_void_p
++_ut_get_status = _udunits.ut_get_status
++_ut_get_status.restype = _c_int
++_ut_unmap_symbol_to_unit = _udunits.ut_unmap_symbol_to_unit
++_ut_unmap_symbol_to_unit.argtypes = (_c_void_p, _c_char_p, _c_int)
++_ut_unmap_symbol_to_unit.restype = _c_int
++_ut_map_symbol_to_unit = _udunits.ut_map_symbol_to_unit
++_ut_map_symbol_to_unit.argtypes = (_c_char_p, _c_int, _c_void_p)
++_ut_map_symbol_to_unit.restype = _c_int
++_ut_map_unit_to_symbol = _udunits.ut_map_unit_to_symbol
++_ut_map_unit_to_symbol.argtypes = (_c_void_p, _c_char_p, _c_int)
++_ut_map_unit_to_symbol.restype = _c_int
++_ut_map_name_to_unit = _udunits.ut_map_name_to_unit
++_ut_map_name_to_unit.argtypes = (_c_char_p, _c_int, _c_void_p)
++_ut_map_name_to_unit.restype = _c_int
++_ut_map_unit_to_name = _udunits.ut_map_unit_to_name
++_ut_map_unit_to_name.argtypes = (_c_void_p, _c_char_p, _c_int)
++_ut_map_unit_to_name.restype = _c_int
++_ut_new_base_unit = _udunits.ut_new_base_unit
++_ut_new_base_unit.argtypes = (_c_void_p, )
++_ut_new_base_unit.restype = _c_void_p
++
++# Change Sv mapping. Both sievert and sverdrup are just aliases,
++# so no unit to symbol mapping needs to be changed.
++# We don't need to remove rem, since it was constructed with
++# the correct sievert mapping in place; because that mapping
++# was only an alias, the unit now doesn't depend on the mapping
++# persisting.
++assert(0 == _ut_unmap_symbol_to_unit(_ut_system, _c_char_p('Sv'), _UT_ASCII))
++assert(0 == _ut_map_symbol_to_unit(_c_char_p('Sv'), _UT_ASCII,
++ _ut_get_unit_by_name(_ut_system, _c_char_p('sverdrup'))))
++
++# Add new base unit calendar_year
++calendar_year_unit = _ut_new_base_unit(_ut_system)
++assert(0 == _ut_map_symbol_to_unit(_c_char_p('cY'), _UT_ASCII, calendar_year_unit))
++assert(0 == _ut_map_unit_to_symbol(calendar_year_unit, _c_char_p('cY'), _UT_ASCII))
++assert(0 == _ut_map_name_to_unit(_c_char_p('calendar_year'), _UT_ASCII, calendar_year_unit))
++assert(0 == _ut_map_unit_to_name(calendar_year_unit, _c_char_p('calendar_year'), _UT_ASCII))
++assert(0 == _ut_map_name_to_unit(_c_char_p('calendar_years'), _UT_ASCII, calendar_year_unit))
++
++# Add various aliases useful for CF.
++def add_unit_alias(definition, symbol, singular, plural):
++ unit = _ut_parse(_ut_system, _c_char_p(definition), _UT_ASCII)
++ if symbol is not None:
++ assert(0 == _ut_map_symbol_to_unit(_c_char_p(symbol), _UT_ASCII, unit))
++ if singular is not None:
++ assert(0 == _ut_map_name_to_unit(_c_char_p(singular), _UT_ASCII, unit))
++ if plural is not None:
++ assert(0 == _ut_map_name_to_unit(_c_char_p(plural), _UT_ASCII, unit))
++
++add_unit_alias("1.e-3", "psu", "practical_salinity_unit", "practical_salinity_units")
++add_unit_alias("calendar_year/12", "cM", "calendar_month", "calendar_months")
++add_unit_alias("1", None, "level", "levels")
++add_unit_alias("1", None, "layer", "layers")
++add_unit_alias("1", None, "sigma_level", "sigma_levels")
++add_unit_alias("1", "dB", "decibel", "debicels")
++add_unit_alias("10 dB", None, "bel", "bels")
++
+ #_udunits.ut_get_unit_by_name(_udunits.ut_new_base_unit(_ut_system),
+ # _ut_system, 'calendar_year')
+
diff --cc debian/patches/0004-Test-fixes.patch
index fd95086,0000000..fd3d12e
mode 100644,000000..100644
--- a/debian/patches/0004-Test-fixes.patch
+++ b/debian/patches/0004-Test-fixes.patch
@@@ -1,132 -1,0 +1,132 @@@
- From cb0f225a844796af205b9963b62b708f6215c997 Mon Sep 17 00:00:00 2001
++From 9cacf106902d2fcd91be7e51b729c947bc0d227e Mon Sep 17 00:00:00 2001
+From: Klaus Zimmermann <klaus_zimmermann at gmx.de>
+Date: Fri, 16 Sep 2016 11:11:48 +0200
+Subject: Test fixes
+
+Move some class variables to setUp methods in order to avoid import errors.
+Added skipping of tests relying on esmf.
+
+Signed-off-by: Klaus Zimmermann <klaus_zimmermann at gmx.de>
+---
+ test/test_Field.py | 39 ++++++++++++++++++---------------------
+ test/test_Regrid.py | 2 ++
+ test/test_Variable.py | 15 +++++++--------
+ test/test_general.py | 9 ++++-----
+ 4 files changed, 31 insertions(+), 34 deletions(-)
+
+diff --git a/test/test_Field.py b/test/test_Field.py
+index 1816060..a144580 100644
+--- a/test/test_Field.py
++++ b/test/test_Field.py
+@@ -6,27 +6,24 @@ import inspect
+ import datetime
+
+ class FieldTest(unittest.TestCase):
+- filename = os.path.join(os.path.dirname(os.path.abspath(__file__)),
+- 'test_file.nc')
+-
+- filename2 = os.path.join(os.path.dirname(os.path.abspath(__file__)),
+- 'test_file2.nc')
+-
+- chunk_sizes = (17, 34, 300, 100000)[::-1]
+- original_chunksize = cf.CHUNKSIZE()
+-
+- f = cf.read(filename)[0]
+-
+- test_only = ()
+-# test_only = ('test_Field_transpose','test_Field_squeeze',)
+-# test_only = ('test_Field_collapse',)
+-# test_only = ('test_Field_match','test_Field_items',)
+-# test_only = ('test_Field_items',)
+-# test_only = ('test_Field_axes','test_Field_data_axes',)
+-# test_only = ('test_Field_where',)
+-# test_only = ('test_Field_anchor',)
+-# test_only = ('test_Field_period',)
+-# test_only = ('test_FieldList_argless_methods',)
++ def setUp(self):
++ self.filename = os.path.join(os.path.dirname(os.path.abspath(__file__)),
++ 'test_file.nc')
++ self.filename2 = os.path.join(os.path.dirname(os.path.abspath(__file__)),
++ 'test_file2.nc')
++ self.chunk_sizes = (17, 34, 300, 100000)[::-1]
++ self.original_chunksize = cf.CHUNKSIZE()
++ self.f = cf.read(self.filename)[0]
++ self.test_only = ()
++ # self.test_only = ('test_Field_transpose','test_Field_squeeze',)
++ # self.test_only = ('test_Field_collapse',)
++ # self.test_only = ('test_Field_match','test_Field_items',)
++ # self.test_only = ('test_Field_items',)
++ # self.test_only = ('test_Field_axes','test_Field_data_axes',)
++ # self.test_only = ('test_Field_where',)
++ # self.test_only = ('test_Field_anchor',)
++ # self.test_only = ('test_Field_period',)
++ # self.test_only = ('test_FieldList_argless_methods',)
+
+ def test_Field_anchor(self):
+ if self.test_only and inspect.stack()[0][3] not in self.test_only:
+diff --git a/test/test_Regrid.py b/test/test_Regrid.py
+index b182ac9..4eff69a 100644
+--- a/test/test_Regrid.py
++++ b/test/test_Regrid.py
+@@ -38,6 +38,7 @@ class RegridTest(unittest.TestCase):
+ # test_only('test_Field_section',)
+ # test_only('test_Data_section',)
+
++ @unittest.skipUnless(cf._found_ESMF, "Requires esmf package.")
+ def test_Field_regrids(self):
+ if self.test_only and inspect.stack()[0][3] not in self.test_only:
+ return
+@@ -72,6 +73,7 @@ class RegridTest(unittest.TestCase):
+ cf.ATOL(original_atol)
+ #--- End: def
+
++ @unittest.skipUnless(cf._found_ESMF, "Requires esmf package.")
+ def test_Field_regridc(self):
+ if self.test_only and inspect.stack()[0][3] not in self.test_only:
+ return
+diff --git a/test/test_Variable.py b/test/test_Variable.py
+index 97a47ba..e0dbe4c 100644
+--- a/test/test_Variable.py
++++ b/test/test_Variable.py
+@@ -5,14 +5,13 @@ import unittest
+ import inspect
+
+ class VariableTest(unittest.TestCase):
+- filename = os.path.join(os.path.dirname(os.path.abspath(__file__)),
+- 'test_file.nc')
+- chunk_sizes = (17, 34, 300, 100000)[::-1]
+- original_chunksize = cf.CHUNKSIZE()
+-
+- f = cf.read(filename)[0]
+-
+- test_only = ()
++ def setUp(self):
++ self.filename = os.path.join(os.path.dirname(os.path.abspath(__file__)),
++ 'test_file.nc')
++ self.chunk_sizes = (17, 34, 300, 100000)[::-1]
++ self.original_chunksize = cf.CHUNKSIZE()
++ self.f = cf.read(self.filename)[0]
++ self.test_only = ()
+
+ def test_Variable_max_mean_mid_range_min_range_sd_sum_var(self):
+ if self.test_only and inspect.stack()[0][3] not in self.test_only:
+diff --git a/test/test_general.py b/test/test_general.py
+index 340fd3b..f14d34f 100644
+--- a/test/test_general.py
++++ b/test/test_general.py
+@@ -27,11 +27,10 @@ atexit.register(_remove_tmpfiles)
+
+
+ class generalTest(unittest.TestCase):
+- filename = os.path.join(os.path.dirname(os.path.abspath(__file__)),
+- 'test_file.nc')
+- chunk_sizes = (17, 34, 300, 100000)[::-1]
+-
+- f = cf.read(filename)[0]
++ def setUp(self):
++ filename = os.path.join(os.path.dirname(os.path.abspath(__file__)),
++ 'test_file.nc')
++ self.f = cf.read(filename)[0]
+
+ def test_GENERAL(self):
+ # Save original chunksize
diff --cc debian/patches/0005-Improve-umread-building-and-handling.patch
index 0000000,0000000..9f5698c
new file mode 100644
--- /dev/null
+++ b/debian/patches/0005-Improve-umread-building-and-handling.patch
@@@ -1,0 -1,0 +1,33 @@@
++From 2df311662c4215485183da69902d6b3e352aa79a Mon Sep 17 00:00:00 2001
++From: Klaus Zimmermann <klaus_zimmermann at gmx.de>
++Date: Wed, 21 Sep 2016 17:01:37 +0200
++Subject: Improve umread building and handling.
++
++Signed-off-by: Klaus Zimmermann <klaus_zimmermann at gmx.de>
++---
++ cf/um/umread/c-lib/Makefile | 5 +++--
++ 1 file changed, 3 insertions(+), 2 deletions(-)
++
++diff --git a/cf/um/umread/c-lib/Makefile b/cf/um/umread/c-lib/Makefile
++index bc6d336..0b69f96 100644
++--- a/cf/um/umread/c-lib/Makefile
+++++ b/cf/um/umread/c-lib/Makefile
++@@ -5,7 +5,7 @@ LIBRARY=umfile.so
++ CC=gcc
++ CFLAGS=-Wall -fPIC -g
++ CPP=gcc -E -P
++-LD=ld
+++LD=gcc
++ LDFLAGS=-shared
++ OBJS = umfile.o error.o filetype.o \
++ malloc.o linklist.o new_structs.o swap.o
++@@ -28,7 +28,8 @@ type-dep:
++ $(MAKE) -C $(TYPE_DEP_DIR)
++
++ $(LIBRARY): $(OBJS) type-dep
++- $(LD) $(LDFLAGS) -o $@ $(OBJS) --whole-archive $(TYPE_DEP_LIBRARY_PATH)
+++ $(LD) $(LDFLAGS) -o $@ $(OBJS) -Wl,--whole-archive $(TYPE_DEP_LIBRARY_PATH) -Wl,--no-whole-archive
+++ strip --remove-section=.comment --remove-section=.note --enable-deterministic-archives $@
++
++ %.o: %.c $(HEADERS)
++ $(CC) $(CFLAGS) -c $<
diff --cc debian/patches/series
index 7ac7f62,0000000..bd383cb
mode 100644,000000..100644
--- a/debian/patches/series
+++ b/debian/patches/series
@@@ -1,6 -1,0 +1,5 @@@
+0001-Remove-check-for-python-version.patch
- 0002-Added-stripping-of-type-lib.patch
- 0003-Patch-sphinx-config-to-avoid-network-access-and-add-.patch
- 0004-Remove-special-udunits2-database.patch
- 0005-Test-fixes.patch
- 0006-Link-with-gcc-for-standard-libs-and-dep-info.patch
++0002-Patch-sphinx-config-to-avoid-network-access-and-add-.patch
++0003-Remove-special-udunits2-database.patch
++0004-Test-fixes.patch
++0005-Improve-umread-building-and-handling.patch
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/python-modules/packages/cf-python.git
More information about the Python-modules-commits
mailing list