forked from pool/python-Rtree
- 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) - 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) OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/python-Rtree?expand=0&rev=4
This commit is contained in:
@@ -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},
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user