15
0
forked from pool/python-Rtree

Accepting request 1201610 from devel:languages:python

OBS-URL: https://build.opensuse.org/request/show/1201610
OBS-URL: https://build.opensuse.org/package/show/openSUSE:Factory/python-Rtree?expand=0&rev=2
This commit is contained in:
2024-09-17 16:20:00 +00:00
committed by Git OBS Bridge
5 changed files with 57 additions and 77 deletions

View File

@@ -1,3 +0,0 @@
version https://git-lfs.github.com/spec/v1
oid sha256:be8772ca34699a9ad3fb4cfe2cfb6629854e453c10b3328039301bbfc128ca3e
size 44877

View File

@@ -1,95 +1,65 @@
diff -ur Rtree-0.9.7/setup.py Rtree-0.9.7.p/setup.py
--- Rtree-0.9.7/setup.py 2020-12-24 16:38:19.000000000 +0100
+++ Rtree-0.9.7.p/setup.py 2021-05-18 00:48:04.350602925 +0200
@@ -6,7 +6,6 @@
from setuptools.dist import Distribution
Index: rtree-1.3.0/setup.py
===================================================================
--- rtree-1.3.0.orig/setup.py
+++ rtree-1.3.0/setup.py
@@ -4,60 +4,11 @@ from pathlib import Path
from setuptools import setup
from setuptools.command.install import install
from setuptools.dist import Distribution
-from wheel.bdist_wheel import bdist_wheel as _bdist_wheel
# Get text from README.txt
@@ -21,74 +20,6 @@
# current working directory of this setup.py file
_cwd = os.path.abspath(os.path.split(__file__)[0])
_cwd = Path(__file__).resolve().parent
-
-class bdist_wheel(_bdist_wheel):
- def finalize_options(self):
-class bdist_wheel(_bdist_wheel): # type: ignore[misc]
- def finalize_options(self) -> None:
- _bdist_wheel.finalize_options(self)
- self.root_is_pure = False
-
-
-class BinaryDistribution(Distribution):
-class BinaryDistribution(Distribution): # type: ignore[misc]
- """Distribution which always forces a binary package with platform name"""
- def has_ext_modules(foo):
-
- def has_ext_modules(foo) -> bool:
- return True
-
-
-class InstallPlatlib(install):
- def finalize_options(self):
-class InstallPlatlib(install): # type: ignore[misc]
- def finalize_options(self) -> None:
- """
- Copy the shared libraries into the wheel. Note that this
- will *only* check in `rtree/lib` rather than anywhere on
- the system so if you are building a wheel you *must* copy or
- symlink the `.so`/`.dll`/`.dylib` files into `rtree/lib`.
- Copy the shared libraries and header files into the wheel. Note that
- this will *only* check in `rtree/lib` and `include` rather than
- anywhere on the system so if you are building a wheel you *must* copy
- or symlink the `.so`/`.dll`/`.dylib` files into `rtree/lib` and
- `.h` into `rtree/include`.
- """
- # use for checking extension types
- from fnmatch import fnmatch
-
- install.finalize_options(self)
- if self.distribution.has_ext_modules():
- self.install_lib = self.install_platlib
- # now copy over libspatialindex
- # get the location of the shared library on the filesystem
-
- # where we're putting the shared library in the build directory
- target_dir = os.path.join(self.build_lib, 'rtree', 'lib')
- # where are we checking for shared libraries
- source_dir = os.path.join(_cwd, 'rtree', 'lib')
- # source files to copy
- source_dir = _cwd / "rtree"
-
- # what patterns represent shared libraries
- patterns = {'*.so',
- 'libspatialindex*dylib',
- '*.dll'}
- # destination for the files in the build directory
- target_dir = Path(self.build_lib) / "rtree"
-
- if not os.path.isdir(source_dir):
- # no copying of binary parts to library
- # this is so `pip install .` works even
- # if `rtree/lib` isn't populated
- return
- # copy lib tree
- source_lib = source_dir / "lib"
- if source_lib.is_dir():
- target_lib = target_dir / "lib"
- self.copy_tree(str(source_lib), str(target_lib))
-
- for file_name in os.listdir(source_dir):
- # make sure file name is lower case
- check = file_name.lower()
- # use filename pattern matching to see if it is
- # a shared library format file
- if not any(fnmatch(check, p) for p in patterns):
- continue
-
- # if the source isn't a file skip it
- if not os.path.isfile(os.path.join(source_dir, file_name)):
- continue
-
- # make build directory if it doesn't exist yet
- if not os.path.isdir(target_dir):
- os.makedirs(target_dir)
-
- # copy the source file to the target directory
- self.copy_file(
- os.path.join(source_dir, file_name),
- os.path.join(target_dir, file_name))
- # copy include tree
- source_include = source_dir / "include"
- if source_include.is_dir():
- target_include = target_dir / "include"
- self.copy_tree(str(source_include), str(target_include))
-
-
# See pyproject.toml for other project metadata
setup(
name='Rtree',
version=__version__,
@@ -105,8 +36,6 @@
package_data={"rtree": ['lib']},
zip_safe=False,
include_package_data=True,
name="Rtree",
- distclass=BinaryDistribution,
- cmdclass={'bdist_wheel': bdist_wheel, 'install': InstallPlatlib},
classifiers=[
'Development Status :: 5 - Production/Stable',
'Intended Audience :: Developers',
- cmdclass={"bdist_wheel": bdist_wheel, "install": InstallPlatlib},
)

View File

@@ -1,3 +1,12 @@
-------------------------------------------------------------------
Tue Sep 17 11:34:46 UTC 2024 - Nico Krapp <nico.krapp@suse.com>
- Update to 1.3.0
* Upgrade binary wheels with libspatialindex-2.0.0 (#316)
* Fix binary wheels for musllinux (#316)
* Update code style, replace isort and black with ruff, modern numpy rng (#319)
* Remove libsidx version testing (#313)
-------------------------------------------------------------------
Wed May 19 10:29:54 UTC 2021 - Ben Greiner <code@bnavigator.de>

View File

@@ -1,7 +1,7 @@
#
# spec file for package python-Rtree
#
# Copyright (c) 2021 SUSE LLC
# Copyright (c) 2024 SUSE LLC
#
# All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed
@@ -16,21 +16,22 @@
#
%{?!python_module:%define python_module() python-%{**} python3-%{**}}
%define skip_python36 1
%{?sle15_python_module_pythons}
Name: python-Rtree
Version: 0.9.7
Version: 1.3.0
Release: 0
Summary: R-Tree spatial index for Python GIS
License: MIT
URL: https://github.com/Toblerity/rtree
Source: https://files.pythonhosted.org/packages/source/R/Rtree/Rtree-%{version}.tar.gz
Source: https://files.pythonhosted.org/packages/source/R/Rtree/rtree-%{version}.tar.gz
Source99: python-Rtree-rpmlintrc
# PATCH-FIX-OPENSUSE Rtree-opensuse-noarch.patch -- we don't put spatialindex into a wheel so the module is kept pure. <code@bnavigator.de>
Patch0: Rtree-opensuse-noarch.patch
BuildRequires: %{python_module numpy}
BuildRequires: %{python_module pip}
BuildRequires: %{python_module pytest}
BuildRequires: %{python_module setuptools}
BuildRequires: %{python_module wheel}
BuildRequires: fdupes
# only for the shlib requirement, no headers needed
BuildRequires: spatialindex-devel
@@ -55,7 +56,7 @@ spatial indexing features for the spatially curious Python user.
for example)
%prep
%autosetup -p1 -n Rtree-%{version}
%autosetup -p1 -n rtree-%{version}
%build
%python_build

3
rtree-1.3.0.tar.gz Normal file
View File

@@ -0,0 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:b36e9dd2dc60ffe3d02e367242d2c26f7281b00e1aaf0c39590442edaaadd916
size 48190