summaryrefslogtreecommitdiff
path: root/sci-libs/shapely
diff options
context:
space:
mode:
authorV3n3RiX <venerix@redcorelinux.org>2021-03-12 21:55:15 +0000
committerV3n3RiX <venerix@redcorelinux.org>2021-03-12 21:55:15 +0000
commit7218e1b46bceac05841e90472501742d905fb3fc (patch)
tree56fae051db521b8fce8014cbc8b11484885b14b3 /sci-libs/shapely
parent6d691ad5b6239929063441bbd14c489e92e7396e (diff)
gentoo resync : 12.03.2021
Diffstat (limited to 'sci-libs/shapely')
-rw-r--r--sci-libs/shapely/Manifest2
-rw-r--r--sci-libs/shapely/files/shapely-1.7.1-tests-support-geos-3.9.patch61
-rw-r--r--sci-libs/shapely/shapely-1.7.1-r1.ebuild41
3 files changed, 104 insertions, 0 deletions
diff --git a/sci-libs/shapely/Manifest b/sci-libs/shapely/Manifest
index 93e6366f0327..38ba7d5fb833 100644
--- a/sci-libs/shapely/Manifest
+++ b/sci-libs/shapely/Manifest
@@ -1,3 +1,5 @@
+AUX shapely-1.7.1-tests-support-geos-3.9.patch 2130 BLAKE2B 2785926f41a8d9486b9591616acf1f9b2dd76c2b009a7a51fefcb664733b304e7fc59b247a87fa36f4b4301132f157a16153f78dc68c2102901c4eea46c020ba SHA512 64c5ecd44ee7b6020e9605825b8af78ba0dfcaa5b0358c8f76af4104869ce027eb059331fa8c488add3ac1e360e41f46346d24e702c54858fe2f9bbef0b929a6
DIST shapely-1.7.1.tar.gz 293368 BLAKE2B 14d9cb0c2b486a3a20b71c0cde7260ec357287ea020352c0320eea07b91674605bdcd22512b33c5ac5a71b89c3d811946f8dd6d3b90c61398203a4c68f30d067 SHA512 72070437960a8c1cf6504b5f4ccc8ec509f87fb6a90178e291aff14889f5add89f9ed4f7e9a19799ce0835c1aea3f0241eaa6efd4d8ea5b879f2167f7c1de50a
+EBUILD shapely-1.7.1-r1.ebuild 902 BLAKE2B 7ca1c17771c26ca7ba773eb6a781e8df5bde1b5b9becc1a5dabb31a15ce919ef0b0bafa1c07c23d3dd04e9c86a3f834977a7f0d525373b0c588a78d27495c0ee SHA512 6c03a2986f6ff854810e51dc26fc240d2e2ebc4cbe89eddec0492a21409a367d3d9cdae9b9c28edc7053a8eea6e26581d0e21190f942d33a58d54a02acba13df
EBUILD shapely-1.7.1.ebuild 839 BLAKE2B cdff940dce5acbd360bb81467475bdf7bd95d512f23c45c9bc7604c6769d56f5e111e0c6a830ab3c79ef84b17fe9878eb424ddd56b62588a80cb18115b68af2e SHA512 407d39827d32b759fc7944195bed880243424374555471a283700c47426e39ab3ec57ec6808e41b9670f1783f580f19737c0aeb12ca2f39da1ef32bf6e17e0e5
MISC metadata.xml 896 BLAKE2B 44a39e16f3f580535a2f9adc3c08411dce5f10432aa05687f231d1614d9b18d442783a0f2344eac9300f52a17e32552dbae75be3efcc8e3b3cc4ec539eff39b4 SHA512 84a5c6215b64b2f5c27bf9360f19772945b5a919b1407b18ae812a057aba183a593652ad80729de7472fb412e0172a2cb693482b58eccab056c66303d632d856
diff --git a/sci-libs/shapely/files/shapely-1.7.1-tests-support-geos-3.9.patch b/sci-libs/shapely/files/shapely-1.7.1-tests-support-geos-3.9.patch
new file mode 100644
index 000000000000..18b6c5ad9a46
--- /dev/null
+++ b/sci-libs/shapely/files/shapely-1.7.1-tests-support-geos-3.9.patch
@@ -0,0 +1,61 @@
+diff --git a/tests/test_svg.py b/tests/test_svg.py
+--- a/tests/test_svg.py (revision 56c0f97a80e75308cf62e0bc4883238c10f56fdf)
++++ b/tests/test_svg.py (date 1615044742785)
+@@ -174,7 +174,8 @@
+ self.assertSVG(GeometryCollection(), '<g />')
+ # Valid
+ self.assertSVG(
+- Point(7, 3).union(LineString([(4, 2), (8, 4)])),
++ GeometryCollection(
++ [Point(7, 3), LineString([(4, 2), (8, 4)])]),
+ '<g><circle cx="7.0" cy="3.0" r="3.0" stroke="#555555" '
+ 'stroke-width="1.0" fill="#66cc99" opacity="0.6" />'
+ '<polyline fill="none" stroke="#66cc99" stroke-width="2.0" '
+--- a/tests/test_wkb.py (revision 56c0f97a80e75308cf62e0bc4883238c10f56fdf)
++++ b/tests/test_wkb.py (date 1615044817079)
+@@ -1,6 +1,11 @@
++import binascii
++
++import pytest
++
++from shapely import wkt
+ from shapely.wkb import dumps, loads
+ from shapely.geometry import Point
+-import binascii
++from shapely.geos import geos_version
+
+
+ def bin2hex(value):
+@@ -49,3 +54,20 @@
+ # replace geometry srid with another
+ result = dumps(geom, srid=27700)
+ assert bin2hex(result) == "0101000020346C0000333333333333F33F3333333333330B40"
++
++
++requires_geos_39 = pytest.mark.xfail(
++ geos_version < (3, 9, 0), reason="GEOS >= 3.9.0 is required", strict=True)
++
++
++@requires_geos_39
++def test_point_empty():
++ g = wkt.loads("POINT EMPTY")
++ assert g.wkb_hex == "0101000000000000000000F87F000000000000F87F"
++
++
++@requires_geos_39
++def test_point_z_empty():
++ g = wkt.loads("POINT Z EMPTY")
++ assert g.wkb_hex == \
++ "0101000080000000000000F87F000000000000F87F000000000000F87F"
+diff --git a/shapely/geos.py b/shapely/geos.py
+--- a/shapely/geos.py (revision 56c0f97a80e75308cf62e0bc4883238c10f56fdf)
++++ b/shapely/geos.py (date 1615044673942)
+@@ -84,7 +84,7 @@
+ 'libgeos_c.so.1',
+ 'libgeos_c.so',
+ ]
+- _lgeos = load_dll('geos_c', fallbacks=alt_paths)
++ _lgeos = load_dll('libgeos_c', fallbacks=alt_paths)
+ # Necessary for environments with only libc.musl
+ c_alt_paths = [
+ 'libc.musl-x86_64.so.1'
diff --git a/sci-libs/shapely/shapely-1.7.1-r1.ebuild b/sci-libs/shapely/shapely-1.7.1-r1.ebuild
new file mode 100644
index 000000000000..6bb1493675cf
--- /dev/null
+++ b/sci-libs/shapely/shapely-1.7.1-r1.ebuild
@@ -0,0 +1,41 @@
+# Copyright 1999-2021 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=7
+
+MY_PN="Shapely"
+MY_P="${MY_PN}-${PV}"
+
+PYTHON_COMPAT=( python3_{7..9} )
+
+inherit distutils-r1
+
+DESCRIPTION="Geometric objects, predicates, and operations"
+HOMEPAGE="https://pypi.org/project/Shapely/ https://github.com/Toblerity/Shapely"
+SRC_URI="https://github.com/Toblerity/Shapely/archive/${PV}.tar.gz -> ${P}.tar.gz"
+
+LICENSE="BSD"
+SLOT="0"
+KEYWORDS="~amd64 ~arm64 ~x86"
+
+RDEPEND="
+ dev-python/numpy[${PYTHON_USEDEP}]
+ >=sci-libs/geos-3.9
+"
+
+BDEPEND="${RDEPEND}
+ dev-python/cython[${PYTHON_USEDEP}]
+"
+
+S="${WORKDIR}/${MY_P}"
+
+PATCHES=( "${FILESDIR}/${P}-tests-support-geos-3.9.patch" )
+
+distutils_enable_tests pytest
+
+distutils_enable_sphinx docs dev-python/matplotlib
+
+python_test() {
+ distutils_install_for_testing
+ ${EPYTHON} -m pytest tests || die "tests failed under ${EPYTHON}"
+}