From 0f95fd5fcf10241460885188a75bb7b4b6838df9 Mon Sep 17 00:00:00 2001 From: Benjamin A. Beasley Date: Apr 06 2022 12:46:34 +0000 Subject: [PATCH 1/3] Update to 1.0.0 --- diff --git a/.gitignore b/.gitignore index 1a2a524..0c3565a 100644 --- a/.gitignore +++ b/.gitignore @@ -5,3 +5,4 @@ /Rtree-0.9.3.tar.gz /Rtree-0.9.4.tar.gz /Rtree-0.9.7.tar.gz +/Rtree-1.0.0.tar.gz diff --git a/Rtree-0.9.7-issue-220-pr-222.patch b/Rtree-0.9.7-issue-220-pr-222.patch deleted file mode 100644 index e4fd54b..0000000 --- a/Rtree-0.9.7-issue-220-pr-222.patch +++ /dev/null @@ -1,409 +0,0 @@ -From 2e610c5da1aca8ef1b109fe8fe8236f7c19b0a8a Mon Sep 17 00:00:00 2001 -From: "Benjamin A. Beasley" -Date: Mon, 21 Feb 2022 09:44:39 -0500 -Subject: [PATCH 1/7] =?UTF-8?q?Correct=20(uint32=5Ft*)=E2=86=94(size=5Ft*)?= - =?UTF-8?q?=20prototype=20mismatch?= -MIME-Version: 1.0 -Content-Type: text/plain; charset=UTF-8 -Content-Transfer-Encoding: 8bit - -In the ctypes binding for Index_CreateWithStream, change the last -parameter from ctypes.POINTER(ctypes.c_uint32) to -ctypes.POINTER(ctypes.c_size_t) for consistency with libspatialindex. - -This fixes the test failure on 64-bit big-endian architectures that -prompted #220. Other inconsistencies noted in that issue will be fixed -in additional commits. - -https://github.com/Toblerity/rtree/issues/220#issue-1145043392 ---- - rtree/core.py | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) - -diff --git a/rtree/core.py b/rtree/core.py -index ae647f7b..95be034f 100644 ---- a/rtree/core.py -+++ b/rtree/core.py -@@ -99,7 +99,7 @@ def free_error_msg_ptr(result, func, cargs): - ctypes.POINTER(ctypes.POINTER(ctypes.c_double)), - ctypes.POINTER(ctypes.c_uint32), - ctypes.POINTER(ctypes.POINTER(ctypes.c_ubyte)), -- ctypes.POINTER(ctypes.c_uint32)) -+ ctypes.POINTER(ctypes.c_size_t)) - - rt.Index_CreateWithStream.argtypes = [ctypes.c_void_p, NEXTFUNC] - rt.Index_CreateWithStream.restype = ctypes.c_void_p - -From b2a2c80fc8aa50ef02fb48a04b6a1b43aed7cd90 Mon Sep 17 00:00:00 2001 -From: "Benjamin A. Beasley" -Date: Mon, 21 Feb 2022 09:50:30 -0500 -Subject: [PATCH 2/7] =?UTF-8?q?Set=20=E2=80=A6.argtypes=20=3D=20[]=20on=20?= - =?UTF-8?q?all=20=E2=80=A6(void)=20functions?= -MIME-Version: 1.0 -Content-Type: text/plain; charset=UTF-8 -Content-Transfer-Encoding: 8bit - -In the libspatialite API, Error_GetLastErrorNum, -Error_GetLastErrorMethod, and Error_GetErrorCount all take no parameters -“…(void)”. Add “….argtypes = []” to the ctypes bindings for -Error_GetLastErrorNum and Error_GetLastErrorMethod to match the other -two. This tells ctypes that they should have no parameters, “…(void)” in -C, rather than unspecified parameters, “…()” in C.' - -https://github.com/Toblerity/rtree/issues/220#issuecomment-1046256119 ---- - rtree/core.py | 2 ++ - 1 file changed, 2 insertions(+) - -diff --git a/rtree/core.py b/rtree/core.py -index 95be034f..180a9773 100644 ---- a/rtree/core.py -+++ b/rtree/core.py -@@ -74,12 +74,14 @@ def free_error_msg_ptr(result, func, cargs): - # load the shared library by looking in likely places - rt = finder.load() - -+rt.Error_GetLastErrorNum.argtypes = [] - rt.Error_GetLastErrorNum.restype = ctypes.c_int - - rt.Error_GetLastErrorMsg.argtypes = [] - rt.Error_GetLastErrorMsg.restype = ctypes.POINTER(ctypes.c_char) - rt.Error_GetLastErrorMsg.errcheck = free_error_msg_ptr - -+rt.Error_GetLastErrorMethod.argtypes = [] - rt.Error_GetLastErrorMethod.restype = ctypes.POINTER(ctypes.c_char) - rt.Error_GetLastErrorMethod.errcheck = free_returned_char_p - - -From 0b729154141b47f13b4f9bfd0c81c5152a64cb40 Mon Sep 17 00:00:00 2001 -From: "Benjamin A. Beasley" -Date: Mon, 21 Feb 2022 09:59:37 -0500 -Subject: [PATCH 3/7] =?UTF-8?q?Correct=20c=5Fuint/c=5Fuint32=E2=86=94c=5Fs?= - =?UTF-8?q?ize=5Ft=20prototype=20mismatches?= -MIME-Version: 1.0 -Content-Type: text/plain; charset=UTF-8 -Content-Transfer-Encoding: 8bit - -In SIDX_NewBuffer and Index_InsertTPData bindings, fix use of c_uint -(unsigned int) or c_uint32 (uint32_t) for value parameters that should be -c_size_t (size_t) for consistency with the libspatialite C API. - -https://github.com/Toblerity/rtree/issues/220#issuecomment-1046256534 ---- - rtree/core.py | 4 ++-- - 1 file changed, 2 insertions(+), 2 deletions(-) - -diff --git a/rtree/core.py b/rtree/core.py -index 180a9773..606786b1 100644 ---- a/rtree/core.py -+++ b/rtree/core.py -@@ -518,7 +518,7 @@ def free_error_msg_ptr(result, func, cargs): - rt.IndexProperty_GetIndexID.restype = ctypes.c_int64 - rt.IndexProperty_GetIndexID.errcheck = check_value - --rt.SIDX_NewBuffer.argtypes = [ctypes.c_uint] -+rt.SIDX_NewBuffer.argtypes = [ctypes.c_size_t] - rt.SIDX_NewBuffer.restype = ctypes.c_void_p - rt.SIDX_NewBuffer.errcheck = check_void - -@@ -541,7 +541,7 @@ def free_error_msg_ptr(result, func, cargs): - ctypes.c_double, - ctypes.c_uint32, - ctypes.POINTER(ctypes.c_ubyte), -- ctypes.c_uint32] -+ ctypes.c_size_t] - rt.Index_InsertTPData.restype = ctypes.c_int - rt.Index_InsertTPData.errcheck = check_return - - -From cd063c406cbdd7e9348fbc2f8a970c47eb34fd05 Mon Sep 17 00:00:00 2001 -From: "Benjamin A. Beasley" -Date: Mon, 21 Feb 2022 10:03:21 -0500 -Subject: [PATCH 4/7] Always use c_int to wrap enums -MIME-Version: 1.0 -Content-Type: text/plain; charset=UTF-8 -Content-Transfer-Encoding: 8bit - -Change IndexProperty_SetIndexType to use c_int instead of c_int32 for -the “enum RTIndexType” parameter, and change -IndexProperty_SetIndexVariant and IndexProperty_SetIndexStorage to use -c_int instead of c_uint32 for their “enum RTIndexVariant” and -“enum RTStorageType” parameters, respectively. - -This aligns these prototypes with the prevailing of c_int in these -bindings to wrap enums, elsewhere in the bindings for these particular -enum types, and even in the getters corresponding to these three -particular setters. - -https://github.com/Toblerity/rtree/issues/220#issuecomment-1046256648 ---- - rtree/core.py | 6 +++--- - 1 file changed, 3 insertions(+), 3 deletions(-) - -diff --git a/rtree/core.py b/rtree/core.py -index 606786b1..a75d9b8b 100644 ---- a/rtree/core.py -+++ b/rtree/core.py -@@ -295,7 +295,7 @@ def free_error_msg_ptr(result, func, cargs): - rt.IndexProperty_Destroy.restype = None - rt.IndexProperty_Destroy.errcheck = check_void_done - --rt.IndexProperty_SetIndexType.argtypes = [ctypes.c_void_p, ctypes.c_int32] -+rt.IndexProperty_SetIndexType.argtypes = [ctypes.c_void_p, ctypes.c_int] - rt.IndexProperty_SetIndexType.restype = ctypes.c_int - rt.IndexProperty_SetIndexType.errcheck = check_return - -@@ -311,7 +311,7 @@ def free_error_msg_ptr(result, func, cargs): - rt.IndexProperty_GetDimension.restype = ctypes.c_int - rt.IndexProperty_GetDimension.errcheck = check_value - --rt.IndexProperty_SetIndexVariant.argtypes = [ctypes.c_void_p, ctypes.c_uint32] -+rt.IndexProperty_SetIndexVariant.argtypes = [ctypes.c_void_p, ctypes.c_int] - rt.IndexProperty_SetIndexVariant.restype = ctypes.c_int - rt.IndexProperty_SetIndexVariant.errcheck = check_return - -@@ -319,7 +319,7 @@ def free_error_msg_ptr(result, func, cargs): - rt.IndexProperty_GetIndexVariant.restype = ctypes.c_int - rt.IndexProperty_GetIndexVariant.errcheck = check_value - --rt.IndexProperty_SetIndexStorage.argtypes = [ctypes.c_void_p, ctypes.c_uint32] -+rt.IndexProperty_SetIndexStorage.argtypes = [ctypes.c_void_p, ctypes.c_int] - rt.IndexProperty_SetIndexStorage.restype = ctypes.c_int - rt.IndexProperty_SetIndexStorage.errcheck = check_return - - -From 42a3373abff402e6e06b0e2a74090329bec43bf4 Mon Sep 17 00:00:00 2001 -From: "Benjamin A. Beasley" -Date: Mon, 21 Feb 2022 10:13:17 -0500 -Subject: [PATCH 5/7] =?UTF-8?q?Fix=20int=E2=86=94uint32=5Ft=20prototype=20?= - =?UTF-8?q?mismatches=20in=20property=20getters?= -MIME-Version: 1.0 -Content-Type: text/plain; charset=UTF-8 -Content-Transfer-Encoding: 8bit - -Fix a number of ctypes bindings for index property getters in which the -return type was given as c_int (int), but the libspatialite API has -c_uint32 (uint32_t). - -https://github.com/Toblerity/rtree/issues/220#issuecomment-1046256746 ---- - rtree/core.py | 26 +++++++++++++------------- - 1 file changed, 13 insertions(+), 13 deletions(-) - -diff --git a/rtree/core.py b/rtree/core.py -index a75d9b8b..42007e2b 100644 ---- a/rtree/core.py -+++ b/rtree/core.py -@@ -308,7 +308,7 @@ def free_error_msg_ptr(result, func, cargs): - rt.IndexProperty_SetDimension.errcheck = check_return - - rt.IndexProperty_GetDimension.argtypes = [ctypes.c_void_p] --rt.IndexProperty_GetDimension.restype = ctypes.c_int -+rt.IndexProperty_GetDimension.restype = ctypes.c_uint32 - rt.IndexProperty_GetDimension.errcheck = check_value - - rt.IndexProperty_SetIndexVariant.argtypes = [ctypes.c_void_p, ctypes.c_int] -@@ -332,7 +332,7 @@ def free_error_msg_ptr(result, func, cargs): - rt.IndexProperty_SetIndexCapacity.errcheck = check_return - - rt.IndexProperty_GetIndexCapacity.argtypes = [ctypes.c_void_p] --rt.IndexProperty_GetIndexCapacity.restype = ctypes.c_int -+rt.IndexProperty_GetIndexCapacity.restype = ctypes.c_uint32 - rt.IndexProperty_GetIndexCapacity.errcheck = check_value - - rt.IndexProperty_SetLeafCapacity.argtypes = [ctypes.c_void_p, ctypes.c_uint32] -@@ -340,7 +340,7 @@ def free_error_msg_ptr(result, func, cargs): - rt.IndexProperty_SetLeafCapacity.errcheck = check_return - - rt.IndexProperty_GetLeafCapacity.argtypes = [ctypes.c_void_p] --rt.IndexProperty_GetLeafCapacity.restype = ctypes.c_int -+rt.IndexProperty_GetLeafCapacity.restype = ctypes.c_uint32 - rt.IndexProperty_GetLeafCapacity.errcheck = check_value - - rt.IndexProperty_SetPagesize.argtypes = [ctypes.c_void_p, ctypes.c_uint32] -@@ -348,7 +348,7 @@ def free_error_msg_ptr(result, func, cargs): - rt.IndexProperty_SetPagesize.errcheck = check_return - - rt.IndexProperty_GetPagesize.argtypes = [ctypes.c_void_p] --rt.IndexProperty_GetPagesize.restype = ctypes.c_int -+rt.IndexProperty_GetPagesize.restype = ctypes.c_uint32 - rt.IndexProperty_GetPagesize.errcheck = check_value - - rt.IndexProperty_SetLeafPoolCapacity.argtypes = \ -@@ -357,7 +357,7 @@ def free_error_msg_ptr(result, func, cargs): - rt.IndexProperty_SetLeafPoolCapacity.errcheck = check_return - - rt.IndexProperty_GetLeafPoolCapacity.argtypes = [ctypes.c_void_p] --rt.IndexProperty_GetLeafPoolCapacity.restype = ctypes.c_int -+rt.IndexProperty_GetLeafPoolCapacity.restype = ctypes.c_uint32 - rt.IndexProperty_GetLeafPoolCapacity.errcheck = check_value - - rt.IndexProperty_SetIndexPoolCapacity.argtypes = \ -@@ -366,7 +366,7 @@ def free_error_msg_ptr(result, func, cargs): - rt.IndexProperty_SetIndexPoolCapacity.errcheck = check_return - - rt.IndexProperty_GetIndexPoolCapacity.argtypes = [ctypes.c_void_p] --rt.IndexProperty_GetIndexPoolCapacity.restype = ctypes.c_int -+rt.IndexProperty_GetIndexPoolCapacity.restype = ctypes.c_uint32 - rt.IndexProperty_GetIndexPoolCapacity.errcheck = check_value - - rt.IndexProperty_SetRegionPoolCapacity.argtypes = \ -@@ -375,7 +375,7 @@ def free_error_msg_ptr(result, func, cargs): - rt.IndexProperty_SetRegionPoolCapacity.errcheck = check_return - - rt.IndexProperty_GetRegionPoolCapacity.argtypes = [ctypes.c_void_p] --rt.IndexProperty_GetRegionPoolCapacity.restype = ctypes.c_int -+rt.IndexProperty_GetRegionPoolCapacity.restype = ctypes.c_uint32 - rt.IndexProperty_GetRegionPoolCapacity.errcheck = check_value - - rt.IndexProperty_SetPointPoolCapacity.argtypes = \ -@@ -384,7 +384,7 @@ def free_error_msg_ptr(result, func, cargs): - rt.IndexProperty_SetPointPoolCapacity.errcheck = check_return - - rt.IndexProperty_GetPointPoolCapacity.argtypes = [ctypes.c_void_p] --rt.IndexProperty_GetPointPoolCapacity.restype = ctypes.c_int -+rt.IndexProperty_GetPointPoolCapacity.restype = ctypes.c_uint32 - rt.IndexProperty_GetPointPoolCapacity.errcheck = check_value - - rt.IndexProperty_SetBufferingCapacity.argtypes = \ -@@ -393,7 +393,7 @@ def free_error_msg_ptr(result, func, cargs): - rt.IndexProperty_SetBufferingCapacity.errcheck = check_return - - rt.IndexProperty_GetBufferingCapacity.argtypes = [ctypes.c_void_p] --rt.IndexProperty_GetBufferingCapacity.restype = ctypes.c_int -+rt.IndexProperty_GetBufferingCapacity.restype = ctypes.c_uint32 - rt.IndexProperty_GetBufferingCapacity.errcheck = check_value - - rt.IndexProperty_SetEnsureTightMBRs.argtypes = \ -@@ -402,7 +402,7 @@ def free_error_msg_ptr(result, func, cargs): - rt.IndexProperty_SetEnsureTightMBRs.errcheck = check_return - - rt.IndexProperty_GetEnsureTightMBRs.argtypes = [ctypes.c_void_p] --rt.IndexProperty_GetEnsureTightMBRs.restype = ctypes.c_int -+rt.IndexProperty_GetEnsureTightMBRs.restype = ctypes.c_uint32 - rt.IndexProperty_GetEnsureTightMBRs.errcheck = check_value - - rt.IndexProperty_SetOverwrite.argtypes = [ctypes.c_void_p, ctypes.c_uint32] -@@ -410,7 +410,7 @@ def free_error_msg_ptr(result, func, cargs): - rt.IndexProperty_SetOverwrite.errcheck = check_return - - rt.IndexProperty_GetOverwrite.argtypes = [ctypes.c_void_p] --rt.IndexProperty_GetOverwrite.restype = ctypes.c_int -+rt.IndexProperty_GetOverwrite.restype = ctypes.c_uint32 - rt.IndexProperty_GetOverwrite.errcheck = check_value - - rt.IndexProperty_SetNearMinimumOverlapFactor.argtypes = \ -@@ -419,7 +419,7 @@ def free_error_msg_ptr(result, func, cargs): - rt.IndexProperty_SetNearMinimumOverlapFactor.errcheck = check_return - - rt.IndexProperty_GetNearMinimumOverlapFactor.argtypes = [ctypes.c_void_p] --rt.IndexProperty_GetNearMinimumOverlapFactor.restype = ctypes.c_int -+rt.IndexProperty_GetNearMinimumOverlapFactor.restype = ctypes.c_uint32 - rt.IndexProperty_GetNearMinimumOverlapFactor.errcheck = check_value - - rt.IndexProperty_SetWriteThrough.argtypes = [ctypes.c_void_p, ctypes.c_uint32] -@@ -427,7 +427,7 @@ def free_error_msg_ptr(result, func, cargs): - rt.IndexProperty_SetWriteThrough.errcheck = check_return - - rt.IndexProperty_GetWriteThrough.argtypes = [ctypes.c_void_p] --rt.IndexProperty_GetWriteThrough.restype = ctypes.c_int -+rt.IndexProperty_GetWriteThrough.restype = ctypes.c_uint32 - rt.IndexProperty_GetWriteThrough.errcheck = check_value - - rt.IndexProperty_SetFillFactor.argtypes = [ctypes.c_void_p, ctypes.c_double] - -From 70338ed3bf65c9d396781f9aa43a842eb01bd33f Mon Sep 17 00:00:00 2001 -From: "Benjamin A. Beasley" -Date: Mon, 21 Feb 2022 10:15:50 -0500 -Subject: [PATCH 6/7] Fix incomplete binding for Index_TPIntersects_count - -Add argument types and error checking callback. - -https://github.com/Toblerity/rtree/issues/220#issuecomment-1046256780 ---- - rtree/core.py | 2 ++ - 1 file changed, 2 insertions(+) - -diff --git a/rtree/core.py b/rtree/core.py -index 42007e2b..040c2170 100644 ---- a/rtree/core.py -+++ b/rtree/core.py -@@ -594,6 +594,8 @@ def free_error_msg_ptr(result, func, cargs): - ctypes.c_double, - ctypes.c_uint32, - ctypes.POINTER(ctypes.c_uint64)] -+ rt.Index_TPIntersects_count.restype = ctypes.c_int -+ rt.Index_TPIntersects_count.errcheck = check_return - - rt.Index_TPNearestNeighbors_id.argtypes = [ - ctypes.c_void_p, - -From 2c7a33cb09b4a2884d58cef65187444dfa6f65bb Mon Sep 17 00:00:00 2001 -From: "Benjamin A. Beasley" -Date: Tue, 22 Feb 2022 09:16:16 -0500 -Subject: [PATCH 7/7] Work around libspatialite ABI change in 1.9.0 - ---- - rtree/core.py | 35 ++++++++++++++++++++++++----------- - 1 file changed, 24 insertions(+), 11 deletions(-) - -diff --git a/rtree/core.py b/rtree/core.py -index 040c2170..888a8955 100644 ---- a/rtree/core.py -+++ b/rtree/core.py -@@ -74,6 +74,10 @@ def free_error_msg_ptr(result, func, cargs): - # load the shared library by looking in likely places - rt = finder.load() - -+rt.SIDX_Version.argtypes = [] -+rt.SIDX_Version.restype = ctypes.POINTER(ctypes.c_char) -+rt.SIDX_Version.errcheck = free_returned_char_p # type: ignore -+ - rt.Error_GetLastErrorNum.argtypes = [] - rt.Error_GetLastErrorNum.restype = ctypes.c_int - -@@ -95,13 +99,26 @@ def free_error_msg_ptr(result, func, cargs): - rt.Index_Create.restype = ctypes.c_void_p - rt.Index_Create.errcheck = check_void - --NEXTFUNC = ctypes.CFUNCTYPE(ctypes.c_int, -- ctypes.POINTER(ctypes.c_int64), -- ctypes.POINTER(ctypes.POINTER(ctypes.c_double)), -- ctypes.POINTER(ctypes.POINTER(ctypes.c_double)), -- ctypes.POINTER(ctypes.c_uint32), -- ctypes.POINTER(ctypes.POINTER(ctypes.c_ubyte)), -- ctypes.POINTER(ctypes.c_size_t)) -+_nDataLength_size_t = True -+try: -+ _major, _minor, _patch = ( -+ int(part) for part in rt.SIDX_Version().decode("ascii").split(".") -+ ) -+except (ValueError, UnicodeDecodeError): -+ pass # weird version; assume latest ABI -+else: -+ if (_major, _minor, _patch) < (1, 9, 0): -+ # Headers had size_t*, but implementation had uint32_t* -+ _nDataLength_size_t = False -+NEXTFUNC = ctypes.CFUNCTYPE( -+ ctypes.c_int, -+ ctypes.POINTER(ctypes.c_int64), -+ ctypes.POINTER(ctypes.POINTER(ctypes.c_double)), -+ ctypes.POINTER(ctypes.POINTER(ctypes.c_double)), -+ ctypes.POINTER(ctypes.c_uint32), -+ ctypes.POINTER(ctypes.POINTER(ctypes.c_ubyte)), -+ ctypes.POINTER(ctypes.c_size_t if _nDataLength_size_t else ctypes.c_uint32), -+) - - rt.Index_CreateWithStream.argtypes = [ctypes.c_void_p, NEXTFUNC] - rt.Index_CreateWithStream.restype = ctypes.c_void_p -@@ -525,10 +542,6 @@ def free_error_msg_ptr(result, func, cargs): - rt.SIDX_DeleteBuffer.argtypes = [ctypes.c_void_p] - rt.SIDX_DeleteBuffer.restype = None - --rt.SIDX_Version.argtypes = [] --rt.SIDX_Version.restype = ctypes.POINTER(ctypes.c_char) --rt.SIDX_Version.errcheck = free_returned_char_p -- - # TPR-Tree API - try: - rt.Index_InsertTPData.argtypes = [ctypes.c_void_p, diff --git a/Rtree-0.9.7-no-bundled-spatialite.patch b/Rtree-0.9.7-no-bundled-spatialite.patch deleted file mode 100644 index 18a3236..0000000 --- a/Rtree-0.9.7-no-bundled-spatialite.patch +++ /dev/null @@ -1,12 +0,0 @@ -diff -Naur Rtree-0.9.7-original/setup.py Rtree-0.9.7/setup.py ---- Rtree-0.9.7-original/setup.py 2020-12-24 10:38:19.000000000 -0500 -+++ Rtree-0.9.7/setup.py 2022-02-02 22:09:58.609247483 -0500 -@@ -105,8 +105,6 @@ - package_data={"rtree": ['lib']}, - zip_safe=False, - include_package_data=True, -- distclass=BinaryDistribution, -- cmdclass={'bdist_wheel': bdist_wheel, 'install': InstallPlatlib}, - classifiers=[ - 'Development Status :: 5 - Production/Stable', - 'Intended Audience :: Developers', diff --git a/Rtree-1.0.0-no-bundled-spatialite.patch b/Rtree-1.0.0-no-bundled-spatialite.patch new file mode 100644 index 0000000..e2983d1 --- /dev/null +++ b/Rtree-1.0.0-no-bundled-spatialite.patch @@ -0,0 +1,12 @@ +diff -Naur Rtree-1.0.0-original/setup.py Rtree-1.0.0/setup.py +--- Rtree-1.0.0-original/setup.py 2022-04-04 19:21:43.000000000 -0400 ++++ Rtree-1.0.0/setup.py 2022-04-06 08:37:34.669665491 -0400 +@@ -76,7 +76,4 @@ + ) + + +-setup( +- distclass=BinaryDistribution, +- cmdclass={"bdist_wheel": bdist_wheel, "install": InstallPlatlib}, +-) ++setup() diff --git a/python-Rtree.spec b/python-Rtree.spec index e0bb861..1fc1597 100644 --- a/python-Rtree.spec +++ b/python-Rtree.spec @@ -8,8 +8,8 @@ %global debug_package %{nil} Name: python-%{srcname} -Version: 0.9.7 -Release: 4%{?dist} +Version: 1.0.0 +Release: 1%{?dist} Summary: R-Tree spatial index for Python GIS %global _description \ Rtree is a ctypes Python wrapper of the spatialindex library, that \ @@ -39,15 +39,7 @@ Source0: https://files.pythonhosted.org/packages/source/R/%{srcname}/%{sr # patch. # # https://bugzilla.redhat.com/show_bug.cgi?id=2050010 -Patch0: Rtree-0.9.7-no-bundled-spatialite.patch -# Fix test failures on s390x by correcting C API mismatches vs. libspatialite -# -# https://bugzilla.redhat.com/show_bug.cgi?id=2055249 -# https://github.com/Toblerity/rtree/issues/220 -# https://github.com/Toblerity/rtree/pull/222 -# -# Rebased on release 0.9.7: -Patch1: https://github.com/musicinmybrain/rtree/pull/1.patch#/Rtree-0.9.7-issue-220-pr-222.patch +Patch0: Rtree-1.0.0-no-bundled-spatialite.patch BuildRequires: spatialindex-devel BuildRequires: python3-devel @@ -77,7 +69,6 @@ Requires: spatialindex # Delete junk from tarball. rm -rf Rtree.egg-info find . -name '*.pyc' -delete -rm setup.cfg rm -rf docs/build @@ -103,6 +94,9 @@ rm -rf docs/build %changelog +* Wed Apr 06 2022 Benjamin A. Beasley - 1.0.0-1 +- Update to 1.0.0 + * Sat Feb 19 2022 Benjamin A. Beasley - 0.9.7-4 - Ensure tests run on all architectures - Fix RHBZ#2055249 with upstream PR#222, which includes fixes for additional C diff --git a/sources b/sources index 8c6ce9c..596623d 100644 --- a/sources +++ b/sources @@ -1 +1 @@ -SHA512 (Rtree-0.9.7.tar.gz) = 35b39e29f6d2b9cf4e774191bed69ade515680d07213f0ba74748da11ba916b41c93dfc4f489d7320855f3722ac8b5b58bac4614ea95e6230fcffe33f4332607 +SHA512 (Rtree-1.0.0.tar.gz) = 9a414cd65b27ba35313dd7185dece83f5d7235867f6f0c72c2902d7ffd72808138dbf30d8fe11c8bbf0ec463072e5f6112d75b5fdd5a1dab7720c56d3632d576 From 1aa2df854d86c817eb7972d7880dd34c59620c15 Mon Sep 17 00:00:00 2001 From: Benjamin A. Beasley Date: Apr 06 2022 12:51:57 +0000 Subject: [PATCH 2/3] Tidy up spec file macros and other trivia --- diff --git a/python-Rtree.spec b/python-Rtree.spec index 1fc1597..55e24e2 100644 --- a/python-Rtree.spec +++ b/python-Rtree.spec @@ -1,4 +1,7 @@ -%global srcname Rtree +Name: python-Rtree +Version: 1.0.0 +Release: 1%{?dist} +Summary: R-Tree spatial index for Python GIS # Since the package has a history of arch-dependent bugs (see RHBZ#2055249), # the base package is arched to flush out any arch-dependent bugs by ensuring @@ -7,28 +10,24 @@ # no debuginfo to generate. %global debug_package %{nil} -Name: python-%{srcname} -Version: 1.0.0 -Release: 1%{?dist} -Summary: R-Tree spatial index for Python GIS -%global _description \ -Rtree is a ctypes Python wrapper of the spatialindex library, that \ -provides a number of advanced spatial indexing features for the \ -spatially curious Python user. These features include: \ -\ --Nearest neighbor search \ --Intersection search \ --Multi-dimensional indexes \ --Clustered indexes (store Python pickles directly with index entries) \ --Bulk loading \ --Deletion \ --Disk serialization \ --Custom storage implementation \ - (to implement spatial indexing in ZODB, for example) +%global _description %{expand: \ +Rtree is a ctypes Python wrapper of libspatialindex that provides a number of +advanced spatial indexing features for the spatially curious Python user. These +features include: + + • Nearest neighbor search + • Intersection search + • Multi-dimensional indexes + • Clustered indexes (store Python pickles directly with index entries) + • Bulk loading + • Deletion + • Disk serialization + • Custom storage implementation (to implement spatial indexing in ZODB, for + example)} License: LGPLv2 -URL: https://pypi.python.org/pypi/%{srcname} -Source0: https://files.pythonhosted.org/packages/source/R/%{srcname}/%{srcname}-%{version}.tar.gz +URL: https://github.com/Toblerity/rtree +Source0: %{pypi_source Rtree} # Since we are not bundling libspatialite as upstream does for PyPI wheel # distribution, do not force setuptools to treat the package as binary/arched @@ -43,18 +42,17 @@ Patch0: Rtree-1.0.0-no-bundled-spatialite.patch BuildRequires: spatialindex-devel BuildRequires: python3-devel -BuildRequires: python3-setuptools +BuildRequires: python3dist(setuptools) -BuildRequires: python3-pytest -BuildRequires: python3-numpy -BuildRequires: python3-wheel +BuildRequires: python3dist(pytest) +BuildRequires: python3dist(numpy) +BuildRequires: python3dist(wheel) %description %{_description} %package -n python3-rtree Summary: %{summary} -%{?python_provide:%python_provide python3-rtree} BuildArch: noarch @@ -67,9 +65,8 @@ Requires: spatialindex %autosetup -n Rtree-%{version} -p1 # Delete junk from tarball. -rm -rf Rtree.egg-info -find . -name '*.pyc' -delete -rm -rf docs/build +rm -rvf *.egg-info +find . -name '*.pyc' -print -delete %build @@ -90,12 +87,13 @@ rm -rf docs/build %license LICENSE.txt %doc README.md %{python3_sitelib}/rtree -%{python3_sitelib}/%{srcname}-%{version}-py%{python3_version}.egg-info +%{python3_sitelib}/Rtree-%{version}-py%{python3_version}.egg-info %changelog * Wed Apr 06 2022 Benjamin A. Beasley - 1.0.0-1 - Update to 1.0.0 +- Tidy up spec file macros and other trivia * Sat Feb 19 2022 Benjamin A. Beasley - 0.9.7-4 - Ensure tests run on all architectures From 16ff1f434b2ae14c72ecd580342ae24398b4eee0 Mon Sep 17 00:00:00 2001 From: Benjamin A. Beasley Date: Apr 06 2022 12:54:43 +0000 Subject: [PATCH 3/3] Use pyproject-rpm-macros --- diff --git a/python-Rtree.spec b/python-Rtree.spec index 55e24e2..31dadde 100644 --- a/python-Rtree.spec +++ b/python-Rtree.spec @@ -41,12 +41,12 @@ Source0: %{pypi_source Rtree} Patch0: Rtree-1.0.0-no-bundled-spatialite.patch BuildRequires: spatialindex-devel + BuildRequires: python3-devel -BuildRequires: python3dist(setuptools) +# For testing: BuildRequires: python3dist(pytest) BuildRequires: python3dist(numpy) -BuildRequires: python3dist(wheel) %description %{_description} @@ -64,17 +64,18 @@ Requires: spatialindex %prep %autosetup -n Rtree-%{version} -p1 -# Delete junk from tarball. -rm -rvf *.egg-info -find . -name '*.pyc' -print -delete + +%generate_buildrequires +%pyproject_buildrequires %build -%py3_build +%pyproject_wheel %install -%py3_install +%pyproject_install +%pyproject_save_files rtree %check @@ -83,17 +84,16 @@ find . -name '*.pyc' -print -delete # Note that there is no %%files section for the unversioned python module if we # are building for several python runtimes -%files -n python3-rtree -%license LICENSE.txt +%files -n python3-rtree -f %{pyproject_files} +# pyproject_files handles LICENSE.txt; verify with “rpm -qL -p …” %doc README.md -%{python3_sitelib}/rtree -%{python3_sitelib}/Rtree-%{version}-py%{python3_version}.egg-info %changelog * Wed Apr 06 2022 Benjamin A. Beasley - 1.0.0-1 - Update to 1.0.0 - Tidy up spec file macros and other trivia +- Use pyproject-rpm-macros * Sat Feb 19 2022 Benjamin A. Beasley - 0.9.7-4 - Ensure tests run on all architectures