The package rpms/python-shapely.git has added or updated architecture specific content in
its
spec file (ExclusiveArch/ExcludeArch or %ifarch/%ifnarch) in commit(s):
https://src.fedoraproject.org/cgit/rpms/python-shapely.git/commit/?id=32e....
Change:
-%ifarch s390x
Thanks.
Full change:
============
commit 32ed2ae5945a0285347e6f2a33e643241b2d02e9
Author: Benjamin A. Beasley <code(a)musicinmybrain.net>
Date: Fri Mar 12 10:26:32 2021 -0500
Fix tests that failed on s390x because they assumed the host was little-endian
(RHBZ#1937719,
https://github.com/Toblerity/Shapely/issues/1102)
diff --git a/python-shapely.spec b/python-shapely.spec
index 58e38f8..e1bc696 100644
--- a/python-shapely.spec
+++ b/python-shapely.spec
@@ -1,5 +1,3 @@
-%bcond_with failing_s390x_tests
-
%bcond_without descartes
Name: python-shapely
@@ -20,6 +18,11 @@ Source0: %{url}/archive/%{version}%{?prerel}.tar.gz
#
https://github.com/Toblerity/Shapely/pull/1031 is not in 1.7.1;
# in particular, “WKTWriter.defaults = {}” is still in tests/__init__.py.
Patch1: shapely-1.7.1-611a0b3b-subset.patch
+# Fix test failures in test_wkb.py on big-endian platforms (s390x); fixes
+# RHBZ#1937719 and upstream bug
+#
https://github.com/Toblerity/Shapely/issues/1102 by applying the contents of
+#
https://github.com/Toblerity/Shapely/pull/1103.
+Patch2: shapely-1.7.1-test_wkb-endianness.patch
BuildRequires: gcc
BuildRequires: geos-devel
@@ -104,14 +107,7 @@ mkdir empty
cd empty
ln -s ../tests/
-%if %{without failing_s390x_tests}
-%ifarch s390x
-k="not test_dumps_srid and not test_dumps_endianness and not test_dumps_hex \
-and not test_loads_srid and not test_point_empty and not test_point_z_empty"
-%global pytest_skips -k "${k}"
-%endif
-%endif
-%pytest %{?pytest_skips}
+%pytest
%install
@@ -151,6 +147,9 @@ find %{buildroot}%{python3_sitearch}/shapely \
* Thu Mar 11 2021 Benjamin A. Beasley <code(a)musicinmybrain.net> - 1.7.1-7
- Rename bootstrap conditional to “descartes”
- Fix skipped tests for vectorized extensions
+- Fix tests that failed on s390x because they assumed the host was
+ little-endian (RHBZ#1937719,
+
https://github.com/Toblerity/Shapely/issues/1102)
* Thu Mar 11 2021 Benjamin A. Beasley <code(a)musicinmybrain.net> - 1.7.1-6
- Switch to python3dist(…) style BR’s
diff --git a/shapely-1.7.1-test_wkb-endianness.patch
b/shapely-1.7.1-test_wkb-endianness.patch
new file mode 100644
index 0000000..abc3c5d
--- /dev/null
+++ b/shapely-1.7.1-test_wkb-endianness.patch
@@ -0,0 +1,110 @@
+diff --git a/tests/test_wkb.py b/tests/test_wkb.py
+index ddc2f46..8ee6dca 100644
+--- a/tests/test_wkb.py
++++ b/tests/test_wkb.py
+@@ -1,4 +1,6 @@
+ import binascii
++import struct
++import sys
+
+ import pytest
+
+@@ -17,18 +19,47 @@ def hex2bin(value):
+ return binascii.a2b_hex(value)
+
+
++def hostorder(fmt, value):
++ """Re-pack a hex WKB value to native endianness if needed
++
++ This routine does not understand WKB format, so it must be provided a
++ struct module format string, without initial indicator character
("@=<>!"),
++ which will be interpreted as big- or little-endian with standard sizes
++ depending on the endian flag in the first byte of the value.
++ """
++
++ if fmt and fmt[0] in "@=<>!":
++ raise ValueError("Initial indicator character, one of @=<>!, in
fmt")
++ if not fmt or fmt[0] not in "cbB":
++ raise ValueError("Missing endian flag in fmt")
++
++ (hexendian,) = struct.unpack(fmt[0], hex2bin(value[:2]))
++ hexorder = {0: ">", 1: "<"}[hexendian]
++ sysorder = {"little": "<", "big":
">"}[sys.byteorder]
++ if hexorder == sysorder:
++ return value # Nothing to do
++
++ return bin2hex(struct.pack(
++ sysorder + fmt,
++ {">": 0, "<": 1}[sysorder],
++ *struct.unpack(hexorder + fmt, hex2bin(value))[1:]))
++
++
+ def test_dumps_srid():
+ p1 = Point(1.2, 3.4)
+ result = dumps(p1)
+- assert bin2hex(result) == "0101000000333333333333F33F3333333333330B40"
++ assert bin2hex(result) == hostorder(
++ "BIdd", "0101000000333333333333F33F3333333333330B40")
+ result = dumps(p1, srid=4326)
+- assert bin2hex(result) ==
"0101000020E6100000333333333333F33F3333333333330B40"
++ assert bin2hex(result) == hostorder(
++ "BIIdd",
"0101000020E6100000333333333333F33F3333333333330B40")
+
+
+ def test_dumps_endianness():
+ p1 = Point(1.2, 3.4)
+ result = dumps(p1)
+- assert bin2hex(result) == "0101000000333333333333F33F3333333333330B40"
++ assert bin2hex(result) == hostorder(
++ "BIdd", "0101000000333333333333F33F3333333333330B40")
+ result = dumps(p1, big_endian=False)
+ assert bin2hex(result) == "0101000000333333333333F33F3333333333330B40"
+ result = dumps(p1, big_endian=True)
+@@ -38,8 +69,9 @@ def test_dumps_endianness():
+ def test_dumps_hex():
+ p1 = Point(1.2, 3.4)
+ result = dumps(p1, hex=True)
+- assert result == "0101000000333333333333F33F3333333333330B40"
+-
++ assert result == hostorder(
++ "BIdd", "0101000000333333333333F33F3333333333330B40")
++
+
+ def test_loads_srid():
+ # load a geometry which includes an srid
+@@ -48,13 +80,16 @@ def test_loads_srid():
+ assert geom.coords[:] == [(1.2, 3.4)]
+ # by default srid is not exported
+ result = dumps(geom)
+- assert bin2hex(result) == "0101000000333333333333F33F3333333333330B40"
++ assert bin2hex(result) == hostorder(
++ "BIdd", "0101000000333333333333F33F3333333333330B40")
+ # include the srid in the output
+ result = dumps(geom, include_srid=True)
+- assert bin2hex(result) ==
"0101000020E6100000333333333333F33F3333333333330B40"
++ assert bin2hex(result) == hostorder(
++ "BIIdd",
"0101000020E6100000333333333333F33F3333333333330B40")
+ # replace geometry srid with another
+ result = dumps(geom, srid=27700)
+- assert bin2hex(result) ==
"0101000020346C0000333333333333F33F3333333333330B40"
++ assert bin2hex(result) == hostorder(
++ "BIIdd",
"0101000020346C0000333333333333F33F3333333333330B40")
+
+
+ requires_geos_39 = pytest.mark.xfail(
+@@ -64,11 +99,12 @@ requires_geos_39 = pytest.mark.xfail(
+ @requires_geos_39
+ def test_point_empty():
+ g = wkt.loads("POINT EMPTY")
+- assert g.wkb_hex == "0101000000000000000000F87F000000000000F87F"
++ assert g.wkb_hex == hostorder(
++ "BIdd", "0101000000000000000000F87F000000000000F87F")
+
+
+ @requires_geos_39
+ def test_point_z_empty():
+ g = wkt.loads("POINT Z EMPTY")
+- assert g.wkb_hex == \
+- "0101000080000000000000F87F000000000000F87F000000000000F87F"
++ assert g.wkb_hex == hostorder(
++ "BIddd",
"0101000080000000000000F87F000000000000F87F000000000000F87F")
commit e0829e2aafe6663a988316dbb3633b7b30d0a576
Author: Benjamin A. Beasley <code(a)musicinmybrain.net>
Date: Fri Mar 12 09:16:04 2021 -0500
Fix skipped tests for vectorized extensions
diff --git a/python-shapely.spec b/python-shapely.spec
index 399f131..58e38f8 100644
--- a/python-shapely.spec
+++ b/python-shapely.spec
@@ -98,6 +98,12 @@ rm -vf docs/_build/html/.buildinfo
%check
+# Ensure the “un-built” package is not imported. Otherwise compiled extensions
+# cannot be tested.
+mkdir empty
+cd empty
+ln -s ../tests/
+
%if %{without failing_s390x_tests}
%ifarch s390x
k="not test_dumps_srid and not test_dumps_endianness and not test_dumps_hex \
@@ -144,6 +150,7 @@ find %{buildroot}%{python3_sitearch}/shapely \
%changelog
* Thu Mar 11 2021 Benjamin A. Beasley <code(a)musicinmybrain.net> - 1.7.1-7
- Rename bootstrap conditional to “descartes”
+- Fix skipped tests for vectorized extensions
* Thu Mar 11 2021 Benjamin A. Beasley <code(a)musicinmybrain.net> - 1.7.1-6
- Switch to python3dist(…) style BR’s
commit 4f2d42147926be8da2694a863d2e97701f9f9692
Author: Benjamin A. Beasley <code(a)musicinmybrain.net>
Date: Thu Mar 11 08:44:59 2021 -0500
Rename bootstrap conditional to “descartes”
diff --git a/python-shapely.spec b/python-shapely.spec
index 6e7f457..399f131 100644
--- a/python-shapely.spec
+++ b/python-shapely.spec
@@ -1,12 +1,10 @@
%bcond_with failing_s390x_tests
-# The function of bootstrap is that it breaks a circular dependency on
-# python-descartes, which is used only for the documentation.
-%bcond_with bootstrap
+%bcond_without descartes
Name: python-shapely
Version: 1.7.1
-Release: 6%{?dist}
+Release: 7%{?dist}
Summary: Manipulation and analysis of geometric objects in the Cartesian plane
License: BSD
@@ -44,7 +42,7 @@ BuildRequires: python3dist(matplotlib)
# Documentation
BuildRequires: make
BuildRequires: python3dist(sphinx)
-%if 0%{?without bootstrap}
+%if %{with descartes}
BuildRequires: python3dist(descartes) >= 1.0.1
%endif
@@ -144,6 +142,9 @@ find %{buildroot}%{python3_sitearch}/shapely \
%changelog
+* Thu Mar 11 2021 Benjamin A. Beasley <code(a)musicinmybrain.net> - 1.7.1-7
+- Rename bootstrap conditional to “descartes”
+
* Thu Mar 11 2021 Benjamin A. Beasley <code(a)musicinmybrain.net> - 1.7.1-6
- Switch to python3dist(…) style BR’s
commit 0b52e1ca3068ac3ff65549c2ead7ca32279f9521
Author: Benjamin A. Beasley <code(a)musicinmybrain.net>
Date: Thu Mar 11 08:20:01 2021 -0500
Switch to python3dist(…) style BR’s
diff --git a/python-shapely.spec b/python-shapely.spec
index 8129122..6e7f457 100644
--- a/python-shapely.spec
+++ b/python-shapely.spec
@@ -6,7 +6,7 @@
Name: python-shapely
Version: 1.7.1
-Release: 5%{?dist}
+Release: 6%{?dist}
Summary: Manipulation and analysis of geometric objects in the Cartesian plane
License: BSD
@@ -27,24 +27,25 @@ BuildRequires: gcc
BuildRequires: geos-devel
BuildRequires: python3-devel
-BuildRequires: python3-Cython
-BuildRequires: python3-setuptools
+BuildRequires: python3dist(setuptools)
+BuildRequires: python3dist(cython)
# Vendored upstream, but we remove the vendored copy:
-BuildRequires: python3-packaging
+BuildRequires: python3dist(packaging)
# Vectorize extra (and tests)
-BuildRequires: python3-numpy
+BuildRequires: python3dist(numpy)
# Tests
-BuildRequires: python3-pytest
-BuildRequires: python3-matplotlib
+BuildRequires: python3dist(pytest)
+
+# Tests and documentation
+BuildRequires: python3dist(matplotlib)
# Documentation
BuildRequires: make
-BuildRequires: python3-sphinx
-BuildRequires: python3-matplotlib
+BuildRequires: python3dist(sphinx)
%if 0%{?without bootstrap}
-BuildRequires: python3-descartes >= 1.0.1
+BuildRequires: python3dist(descartes) >= 1.0.1
%endif
%global _description %{expand:
@@ -143,6 +144,9 @@ find %{buildroot}%{python3_sitearch}/shapely \
%changelog
+* Thu Mar 11 2021 Benjamin A. Beasley <code(a)musicinmybrain.net> - 1.7.1-6
+- Switch to python3dist(…) style BR’s
+
* Thu Mar 11 2021 Benjamin A. Beasley <code(a)musicinmybrain.net> - 1.7.1-5
- Add bootstrap conditional to break circular dependency with python-descartes,
used for HTML documentation
commit c75bd8bbe73e66e621c77fc4db8fd68752e8417d
Author: Benjamin A. Beasley <code(a)musicinmybrain.net>
Date: Thu Mar 11 08:15:30 2021 -0500
Add bootstrap conditional to break circular dependency with python-descartes, used for
HTML documentation
diff --git a/python-shapely.spec b/python-shapely.spec
index ce71241..8129122 100644
--- a/python-shapely.spec
+++ b/python-shapely.spec
@@ -1,8 +1,12 @@
%bcond_with failing_s390x_tests
+# The function of bootstrap is that it breaks a circular dependency on
+# python-descartes, which is used only for the documentation.
+%bcond_with bootstrap
+
Name: python-shapely
Version: 1.7.1
-Release: 4%{?dist}
+Release: 5%{?dist}
Summary: Manipulation and analysis of geometric objects in the Cartesian plane
License: BSD
@@ -39,7 +43,9 @@ BuildRequires: python3-matplotlib
BuildRequires: make
BuildRequires: python3-sphinx
BuildRequires: python3-matplotlib
+%if 0%{?without bootstrap}
BuildRequires: python3-descartes >= 1.0.1
+%endif
%global _description %{expand:
Shapely is a package for creation, manipulation, and analysis of planar
@@ -137,6 +143,10 @@ find %{buildroot}%{python3_sitearch}/shapely \
%changelog
+* Thu Mar 11 2021 Benjamin A. Beasley <code(a)musicinmybrain.net> - 1.7.1-5
+- Add bootstrap conditional to break circular dependency with python-descartes,
+ used for HTML documentation
+
* Wed Mar 10 2021 Benjamin A. Beasley <code(a)musicinmybrain.net> - 1.7.1-4
- Use %%url macro to shorten Source0 URL
- Use expand: to clean up description macro