[pyfai] 05/10: refresh the patch series in order to deal with a missing third_party

Frédéric-Emmanuel Picca picca at moszumanska.debian.org
Fri Jul 24 12:10:03 UTC 2015


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

picca pushed a commit to branch master
in repository pyfai.

commit 4707336b86918da3cab687be6a306cd831092818
Author: Picca Frédéric-Emmanuel <picca at synchrotron-soleil.fr>
Date:   Fri Jul 24 10:56:13 2015 +0200

    refresh the patch series in order to deal with a missing third_party
---
 ...tream-histogram-build-when-.c-file-is-mis.patch |  34 ---
 ...001-fix-pyFAI-when-third_party-is-missing.patch | 230 +++++++++++++++++++++
 ...r-upstream-skip-test-if-QT4-not-available.patch |  38 ----
 debian/patches/series                              |   3 +-
 4 files changed, 231 insertions(+), 74 deletions(-)

diff --git a/debian/patches/0001-fix-for-upstream-histogram-build-when-.c-file-is-mis.patch b/debian/patches/0001-fix-for-upstream-histogram-build-when-.c-file-is-mis.patch
deleted file mode 100644
index 05a2524..0000000
--- a/debian/patches/0001-fix-for-upstream-histogram-build-when-.c-file-is-mis.patch
+++ /dev/null
@@ -1,34 +0,0 @@
-From: =?UTF-8?q?Picca=20Fr=C3=A9d=C3=A9ric-Emmanuel?=
- <picca at synchrotron-soleil.fr>
-Date: Fri, 17 Oct 2014 14:17:50 +0200
-Subject: fix for upstream histogram build when .c file is missing
-
----
- setup.py | 13 ++++++++-----
- 1 file changed, 8 insertions(+), 5 deletions(-)
-
-diff --git a/setup.py b/setup.py
-index 5d64589..43e5121 100644
---- a/setup.py
-+++ b/setup.py
-@@ -52,12 +52,15 @@ def copy(infile, outfile, folder=None):
-     if folder:
-         infile = os.path.join(folder, infile)
-         outfile = os.path.join(folder, outfile)
--    if os.path.exists(outfile):
--        os.unlink(outfile)
--    if "link" in dir(os):
--        os.link(infile, outfile)
-+    if os.path.exists(infile):
-+        if os.path.exists(outfile):
-+            os.unlink(outfile)
-+        if "link" in dir(os):
-+            os.link(infile, outfile)
-+        else:
-+            shutil.copy(infile, outfile)
-     else:
--        shutil.copy(infile, outfile)
-+        print("Skipping copy of %s -> %s which is missing" % (infile, outfile))
- 
- 
- cmdclass = {}
diff --git a/debian/patches/0001-fix-pyFAI-when-third_party-is-missing.patch b/debian/patches/0001-fix-pyFAI-when-third_party-is-missing.patch
new file mode 100644
index 0000000..aae6c43
--- /dev/null
+++ b/debian/patches/0001-fix-pyFAI-when-third_party-is-missing.patch
@@ -0,0 +1,230 @@
+From: =?utf-8?q?Picca_Fr=C3=A9d=C3=A9ric-Emmanuel?=
+ <picca at synchrotron-soleil.fr>
+Date: Fri, 24 Jul 2015 10:54:52 +0200
+Subject: fix pyFAI when third_party is missing
+
+---
+ pyFAI-src/detectors.py        |  5 ++++-
+ pyFAI-src/distortion.py       |  5 ++++-
+ pyFAI-src/geometry.py         |  5 ++++-
+ pyFAI-src/grid.py             |  5 ++++-
+ pyFAI-src/integrate_widget.py |  6 +++++-
+ pyFAI-src/massif.py           |  5 ++++-
+ pyFAI-src/peak_picker.py      |  5 ++++-
+ pyFAI-src/units.py            |  5 ++++-
+ pyFAI-src/utils.py            |  5 ++++-
+ setup.py                      | 14 +++++++++-----
+ src/_distortion.pyx           |  6 +++++-
+ test/test_bispev.py           |  5 ++++-
+ 12 files changed, 55 insertions(+), 16 deletions(-)
+
+diff --git a/pyFAI-src/detectors.py b/pyFAI-src/detectors.py
+index 3649ae5..5c07882 100644
+--- a/pyFAI-src/detectors.py
++++ b/pyFAI-src/detectors.py
+@@ -58,7 +58,10 @@ try:
+     import fabio
+ except ImportError:
+     fabio = None
+-from .third_party.six import with_metaclass
++try:
++    from six import with_metaclass
++except ImportError:
++    from .third_party.six import with_metaclass
+ 
+ 
+ epsilon = 1e-6
+diff --git a/pyFAI-src/distortion.py b/pyFAI-src/distortion.py
+index a07ba18..78f94f0 100644
+--- a/pyFAI-src/distortion.py
++++ b/pyFAI-src/distortion.py
+@@ -43,7 +43,10 @@ if ocl:
+ else:
+     ocl_azim_lut = ocl_azim_csr = None
+ from .utils import timeit
+-from .third_party import six
++try:
++    import six
++except ImportError:
++    from .third_party import six
+ import fabio
+ 
+ try:
+diff --git a/pyFAI-src/geometry.py b/pyFAI-src/geometry.py
+index 531ab3c..19aa0bb 100644
+--- a/pyFAI-src/geometry.py
++++ b/pyFAI-src/geometry.py
+@@ -40,7 +40,10 @@ import types
+ 
+ from . import detectors
+ from . import units
+-from .third_party import six
++try:
++    import six
++except ImportError:
++    from .third_party import six
+ StringTypes = (six.binary_type, six.text_type)
+ 
+ logger = logging.getLogger("pyFAI.geometry")
+diff --git a/pyFAI-src/grid.py b/pyFAI-src/grid.py
+index c981c1a..9804d27 100644
+--- a/pyFAI-src/grid.py
++++ b/pyFAI-src/grid.py
+@@ -37,7 +37,10 @@ import time
+ 
+ from . import detectors
+ from . import units
+-from .third_party import six
++try:
++    import six
++except ImportError:
++    from .third_party import six
+ StringTypes = (six.binary_type, six.text_type)
+ 
+ logger = logging.getLogger("pyFAI.grid")
+diff --git a/pyFAI-src/integrate_widget.py b/pyFAI-src/integrate_widget.py
+index 87f418c..66c6509 100644
+--- a/pyFAI-src/integrate_widget.py
++++ b/pyFAI-src/integrate_widget.py
+@@ -61,7 +61,11 @@ from .utils import float_, int_, str_, get_ui_file
+ from .io import HDF5Writer
+ from .azimuthalIntegrator import AzimuthalIntegrator
+ from .units import RADIAL_UNITS, TTH_DEG, TTH_RAD, Q_NM, Q_A, R_MM
+-from .third_party import six
++
++try:
++    import six
++except ImportError:
++    from .third_party import six
+ 
+ UIC = get_ui_file("integration.ui")
+ 
+diff --git a/pyFAI-src/massif.py b/pyFAI-src/massif.py
+index 67ffb28..1f2f52d 100644
+--- a/pyFAI-src/massif.py
++++ b/pyFAI-src/massif.py
+@@ -40,7 +40,10 @@ from scipy.ndimage.filters  import median_filter
+ 
+ from .bilinear import Bilinear
+ from .utils import gaussian_filter, binning, unBinning, relabel, is_far_from_group
+-from .third_party import six
++try:
++    import six
++except ImportError:
++    from .third_party import six
+ 
+ if os.name != "nt":
+     WindowsError = RuntimeError
+diff --git a/pyFAI-src/peak_picker.py b/pyFAI-src/peak_picker.py
+index 5311b60..dc7cd9f 100644
+--- a/pyFAI-src/peak_picker.py
++++ b/pyFAI-src/peak_picker.py
+@@ -52,7 +52,10 @@ from .calibrant import Calibrant, ALL_CALIBRANTS
+ from .blob_detection import BlobDetection
+ from .massif import Massif
+ from .watershed import InverseWatershed
+-from .third_party import six
++try:
++    import six
++except ImportError:
++    from .third_party import six
+ logger = logging.getLogger("pyFAI.peak_picker")
+ if os.name != "nt":
+     WindowsError = RuntimeError
+diff --git a/pyFAI-src/units.py b/pyFAI-src/units.py
+index beedf1e..81eed18 100644
+--- a/pyFAI-src/units.py
++++ b/pyFAI-src/units.py
+@@ -32,7 +32,10 @@ __docformat__ = 'restructuredtext'
+ import logging
+ logger = logging.getLogger("pyFAI.unit")
+ from numpy import pi
+-from .third_party import six
++try:
++    import six
++except ImportError:
++    from .third_party import six
+ hc = 12.398419292004204
+ 
+ class Enum(dict):
+diff --git a/pyFAI-src/utils.py b/pyFAI-src/utils.py
+index a7abcad..13c9295 100644
+--- a/pyFAI-src/utils.py
++++ b/pyFAI-src/utils.py
+@@ -52,7 +52,10 @@ else:
+ from scipy import ndimage
+ from scipy.interpolate import interp1d
+ from math import ceil, sin, cos, atan2, pi
+-from .third_party import six
++try:
++    import six
++except ImportError:
++    from .third_party import six
+ try:
+     from . import relabel as _relabel
+ except:
+diff --git a/setup.py b/setup.py
+index 7c9531f..7a457ae 100644
+--- a/setup.py
++++ b/setup.py
+@@ -476,6 +476,13 @@ License :: OSI Approved :: GPL
+ Topic :: Crystallography
+ """
+ 
++packages = ["pyFAI", "pyFAI.test"]
++package_dir = {"pyFAI": "pyFAI-src",
++               "pyFAI.test": "test"}
++if os.path.isdir("third_party"):
++    package_dir["pyFAI.third_party"] = "third_party"
++    packages.append("pyFAI.third_party")
++
+ if __name__ == "__main__":
+     setup(name='pyFAI',
+           version=get_version(),
+@@ -491,11 +498,8 @@ if __name__ == "__main__":
+           ext_package="pyFAI",
+           scripts=script_files,
+           ext_modules=ext_modules,
+-          packages=["pyFAI", "pyFAI.third_party", "pyFAI.test"],
+-          package_dir={"pyFAI": "pyFAI-src",
+-                       "pyFAI.third_party": "third_party",
+-                       "pyFAI.test": "test",
+-                       },
++          packages=packages,
++          package_dir=package_dir,
+           test_suite="test",
+           cmdclass=cmdclass,
+           data_files=data_files,
+diff --git a/src/_distortion.pyx b/src/_distortion.pyx
+index bb58b84..e26def3 100644
+--- a/src/_distortion.pyx
++++ b/src/_distortion.pyx
+@@ -45,7 +45,11 @@ import time
+ logger = logging.getLogger("pyFAI._distortion")
+ from .detectors import detector_factory
+ from .utils import timeit, expand2d
+-from .third_party import six
++
++try
++    import six
++except ImportError
++    from .third_party import six
+ import fabio
+ 
+ cdef struct lut_point:
+diff --git a/test/test_bispev.py b/test/test_bispev.py
+index 32b0ef9..c673a53 100755
+--- a/test/test_bispev.py
++++ b/test/test_bispev.py
+@@ -47,7 +47,10 @@ pyFAI = sys.modules["pyFAI"]
+ if logger.getEffectiveLevel() <= logging.INFO:
+     import pylab
+ from pyFAI import spline, _bispev
+-from pyFAI.third_party import six
++try:
++    import six
++except ImportError:
++    from pyFAI.third_party import six
+ 
+ try:
+     from scipy.interpolate import fitpack
diff --git a/debian/patches/0002-fix-for-upstream-skip-test-if-QT4-not-available.patch b/debian/patches/0002-fix-for-upstream-skip-test-if-QT4-not-available.patch
deleted file mode 100644
index f33602c..0000000
--- a/debian/patches/0002-fix-for-upstream-skip-test-if-QT4-not-available.patch
+++ /dev/null
@@ -1,38 +0,0 @@
-From: =?UTF-8?q?Picca=20Fr=C3=A9d=C3=A9ric-Emmanuel?=
- <picca at synchrotron-soleil.fr>
-Date: Mon, 20 Oct 2014 16:44:30 +0200
-Subject: fix for upstream skip test if QT4 not available
-
----
- test/test_peak_picking.py | 11 +++++++++--
- 1 file changed, 9 insertions(+), 2 deletions(-)
-
-diff --git a/test/test_peak_picking.py b/test/test_peak_picking.py
-index 59e635f..f075c9b 100755
---- a/test/test_peak_picking.py
-+++ b/test/test_peak_picking.py
-@@ -41,15 +41,22 @@ import fabio
- from utilstest import UtilsTest, Rwp, getLogger
- logger = getLogger(__file__)
- pyFAI = sys.modules["pyFAI"]
--import pyFAI.peak_picker
-+
-+NO_PEAK_PICKER = False
-+try:
-+    import pyFAI.peak_picker
-+    from pyFAI.peak_picker import PeakPicker
-+except ImportError:
-+    NO_PEAK_PICKER = True
-+
- import pyFAI.geometryRefinement
--from pyFAI.peak_picker import PeakPicker
- from pyFAI.calibrant import Calibrant
- from pyFAI.geometryRefinement import GeometryRefinement
- if logger.getEffectiveLevel() <= logging.INFO:
-     import pylab
- 
- 
-+ at unittest.skipIf(NO_PEAK_PICKER, "cannot import peak_peaker")
- class test_peak_picking(unittest.TestCase):
-     """basic test"""
-     calibFile = "1788/moke.tif"
diff --git a/debian/patches/series b/debian/patches/series
index 589bb7c..ae710c5 100644
--- a/debian/patches/series
+++ b/debian/patches/series
@@ -1,2 +1 @@
-0001-fix-for-upstream-histogram-build-when-.c-file-is-mis.patch
-0002-fix-for-upstream-skip-test-if-QT4-not-available.patch
+0001-fix-pyFAI-when-third_party-is-missing.patch

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



More information about the debian-science-commits mailing list