The package rpms/python-mathics3.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-mathics3.git/commit/?id=ad...
https://src.fedoraproject.org/cgit/rpms/python-mathics3.git/commit/?id=16....
Change:
-%ifarch s390x
+%ifarch s390x
Thanks.
Full change:
============
commit adbafe54c6a02ec751e86cd99411bfa604bb15a2
Author: Davide Cavalca <dcavalca(a)fedoraproject.org>
Date: Sun Jan 22 14:53:07 2023 -0800
Backport upstream bugfixes and add extras subpackages
diff --git a/b3e5e34622c8080c52af32a6325fce6f5753ffc9.patch
b/b3e5e34622c8080c52af32a6325fce6f5753ffc9.patch
new file mode 100644
index 0000000..6d7eba0
--- /dev/null
+++ b/b3e5e34622c8080c52af32a6325fce6f5753ffc9.patch
@@ -0,0 +1,21 @@
+From b3e5e34622c8080c52af32a6325fce6f5753ffc9 Mon Sep 17 00:00:00 2001
+From: Davide Cavalca <dcavalca(a)fedoraproject.org>
+Date: Sat, 21 Jan 2023 18:02:12 -0800
+Subject: [PATCH] Add setuptools to install requirements
+
+---
+ setup.py | 1 +
+ 1 file changed, 1 insertion(+)
+
+diff --git a/setup.py b/setup.py
+index 40ee7dec9..61078c28c 100644
+--- a/setup.py
++++ b/setup.py
+@@ -149,6 +149,7 @@ def read(*rnames):
+ "pint",
+ "python-dateutil",
+ "requests",
++ "setuptools",
+ ]
+
+ print(f'Installation requires "{", ".join(INSTALL_REQUIRES)}')
diff --git a/733.patch b/fdd29ecdd8a71d6154571dab392d0480b53419d3.patch
similarity index 100%
rename from 733.patch
rename to fdd29ecdd8a71d6154571dab392d0480b53419d3.patch
diff --git a/mathics-big-endian-test-fix.patch b/mathics-big-endian-test-fix.patch
new file mode 100644
index 0000000..19816b1
--- /dev/null
+++ b/mathics-big-endian-test-fix.patch
@@ -0,0 +1,90 @@
+diff -Naur a/test/test_evaluation.py b/test/test_evaluation.py
+--- a/test/test_evaluation.py 2022-07-10 13:42:57.000000000 -0700
++++ b/test/test_evaluation.py 2023-01-22 14:20:24.368492721 -0800
+@@ -1,5 +1,5 @@
+ # -*- coding: utf-8 -*-
+-from .helper import evaluate, check_evaluation
++from .helper import evaluate, check_evaluation, session
+
+ import sys
+ import pytest
+@@ -199,37 +199,55 @@
+ Close[str]; res]
+ """
+ )
+- for str_expr, str_expected, message in (
++
++ test_input_and_name = (
+ (
+- r'WRb[{1885507541, 4157323149}, Table["UnsignedInteger32",
{2}]]',
+- r"{213, 143, 98, 112, 141, 183, 203, 247}",
++ 'WRb[{1885507541, 4157323149}, Table["UnsignedInteger32",
{2}]]',
+ "UnsignedInteger32",
+ ),
+ (
+- r'WRb[{384206740, 1676316040}, Table["UnsignedInteger32",
{2}]]',
+- r"{148, 135, 230, 22, 136, 141, 234, 99}",
++ 'WRb[{384206740, 1676316040}, Table["UnsignedInteger32",
{2}]]',
+ "UnsignedInteger32 - 2nd test",
+ ),
+ (
+- r'WRb[7079445437368829279, "UnsignedInteger64"]',
+- r"{95, 5, 33, 229, 29, 62, 63, 98}",
++ 'WRb[7079445437368829279, "UnsignedInteger64"]',
+ "UnsignedInteger64",
+ ),
+ (
+- r'WRb[5381171935514265990, "UnsignedInteger64"]',
+- r"{134, 9, 161, 91, 93, 195, 173, 74}",
++ 'WRb[5381171935514265990, "UnsignedInteger64"]',
+ "UnsignedInteger64 - 2nd test",
+ ),
+ (
+- r'WRb[293382001665435747348222619884289871468,
"UnsignedInteger128"]',
+- r"{108, 78, 217, 150, 88, 126, 152, 101, 231, 134, 176, 140, 118,
81, 183, 220}",
++ 'WRb[293382001665435747348222619884289871468,
"UnsignedInteger128"]',
+ "UnsignedInteger128",
+ ),
+ (
+- r'WRb[253033302833692126095975097811212718901,
"UnsignedInteger128"]',
+- r"{53, 83, 116, 79, 81, 100, 60, 126, 202, 52, 241, 48, 5, 113, 92,
190}",
++ 'WRb[253033302833692126095975097811212718901,
"UnsignedInteger128"]',
+ "UnsignedInteger128 - 2nd test",
+ ),
++ )
++
++ is_little_endian = session.evaluate("$ByteOrdering").value == -1
++ if is_little_endian:
++ expected = (
++ "{213, 143, 98, 112, 141, 183, 203, 247}",
++ "{148, 135, 230, 22, 136, 141, 234, 99}",
++ "{95, 5, 33, 229, 29, 62, 63, 98}",
++ "{134, 9, 161, 91, 93, 195, 173, 74}",
++ "{108, 78, 217, 150, 88, 126, 152, 101, 231, 134, 176, 140, 118,
81, 183, 220}",
++ "{53, 83, 116, 79, 81, 100, 60, 126, 202, 52, 241, 48, 5, 113, 92,
190}",
++ )
++ else:
++ expected = (
++ "{112, 98, 143, 213, 247, 203, 183, 141}",
++ "{22, 230, 135, 148, 99, 234, 141, 136}",
++ "{98, 63, 62, 29, 229, 33, 5, 95}",
++ "{74, 173, 195, 93, 91, 161, 9, 134}",
++ "{101, 152, 126, 88, 150, 217, 78, 108, 220, 183, 81, 118, 140,
176, 134, 231}",
++ "{126, 60, 100, 81, 79, 116, 83, 53, 190, 92, 113, 5, 48, 241, 52,
202}",
++ )
++
++ for i, (str_expr, message) in enumerate(test_input_and_name):
+ # This works but the $Precision is coming out UnsignedInt128 rather tha
+ # UnsignedInt32
+ # (
+@@ -239,9 +257,7 @@
+ # " {-0.0832756, 0.765142, 0.638454}}",
+ # "Eigenvalues via mpmath",
+ # ),
+- ):
+-
+- check_evaluation(str_expr, str_expected, message)
++ check_evaluation(str_expr, expected[i], message)
+
+
+ # import os.path as osp
diff --git a/python-mathics3.spec b/python-mathics3.spec
index 367fd27..a12d579 100644
--- a/python-mathics3.spec
+++ b/python-mathics3.spec
@@ -1,4 +1,5 @@
%global srcname Mathics3
+%global forgeurl
https://github.com/Mathics3/mathics-core
Name: python-mathics3
Version: 5.0.2
@@ -13,11 +14,15 @@ URL:
https://mathics.org
Source: %{srcname}-%{version}.tar.gz
Source: mathics-repackage-source.sh
# ExampleData: update copyright byline for Namespaces.xml
-Patch:
https://github.com/Mathics3/mathics-core/pull/733.patch
+Patch: %{forgeurl}/commit/fdd29ecdd8a71d6154571dab392d0480b53419d3.patch
+# Add setuptools to install requirements
+Patch: %{forgeurl}/commit/b3e5e34622c8080c52af32a6325fce6f5753ffc9.patch
+# Adjust test so it works on BigEndian systems
+# Backport of
https://github.com/Mathics3/mathics-core/pull/762
+Patch: mathics-big-endian-test-fix.patch
BuildRequires: gcc
BuildRequires: python3-devel
-BuildRequires: python3-Cython
BuildRequires: python3-pytest
%global _description %{expand:
@@ -29,15 +34,16 @@ open-source alternative to Mathematica.}
%package -n mathics
Summary: %{summary}
License: GPL-3.0-only
+Recommends: python3dist(mathics[cython]) = %{version}-%{release}
+Recommends: python3dist(mathics[full]) = %{version}-%{release}
Recommends: mathics-data = %{version}-%{release}
Provides: python-mathics3 = %{version}-%{release}
Provides: mathics3 = %{version}-%{release}
-# Needed for pkg_resources which is used in mathics/settings.py
-Requires: python3dist(setuptools)
-
%description -n mathics %_description
+%pyproject_extras_subpkg -n mathics cython full
+
%package -n mathics-data
Summary: Example data files for Mathics
# From mathics/data/ExampleData/copyright.csv
@@ -59,7 +65,7 @@ chmod -x mathics/data/ExampleData/{InventionNo1.xml,numberdata.csv}
export USE_CYTHON=1
%generate_buildrequires
-%pyproject_buildrequires
+%pyproject_buildrequires -x cython -x full
%build
export USE_CYTHON=1
@@ -72,13 +78,10 @@ export USE_CYTHON=1
%check
# test_string_split:
https://github.com/Mathics3/mathics-core/issues/743
-# test_system_specific_long_integer:
-#
https://github.com/Mathics3/mathics-core/issues/760
+# test_image: disabled because it doesn't run in mock
%pytest \
-%ifarch s390x
- --deselect=test/test_evaluation.py::test_system_specific_long_integer \
-%endif
- --deselect=test/test_strings.py::test_string_split
+ --deselect=test/test_strings.py::test_string_split \
+
--deselect=test/builtin/image/test_image.py::test_image[BinaryImageQ[Binarize[img]]-True-]
%files -n mathics -f %{pyproject_files}
%license COPYING.txt
commit e545e51a5205a4dc4cc3d9a8ffe6ec295e5d3ed1
Author: Davide Cavalca <dcavalca(a)fedoraproject.org>
Date: Sat Jan 21 17:52:39 2023 -0800
Add missing Requires on setuptools
diff --git a/python-mathics3.spec b/python-mathics3.spec
index a5245d9..367fd27 100644
--- a/python-mathics3.spec
+++ b/python-mathics3.spec
@@ -33,6 +33,9 @@ Recommends: mathics-data = %{version}-%{release}
Provides: python-mathics3 = %{version}-%{release}
Provides: mathics3 = %{version}-%{release}
+# Needed for pkg_resources which is used in mathics/settings.py
+Requires: python3dist(setuptools)
+
%description -n mathics %_description
%package -n mathics-data
commit 1646ccc9bcd2b6c32460b88d708f0d271893bbd6
Author: Davide Cavalca <dcavalca(a)fedoraproject.org>
Date: Sat Jan 21 16:44:48 2023 -0800
Gate out broken test on s390x
diff --git a/python-mathics3.spec b/python-mathics3.spec
index a6cadac..a5245d9 100644
--- a/python-mathics3.spec
+++ b/python-mathics3.spec
@@ -68,8 +68,14 @@ export USE_CYTHON=1
%pyproject_save_files mathics
%check
-# TODO: file an upstream bug for this
-%pytest --deselect=test/test_strings.py::test_string_split
+# test_string_split:
https://github.com/Mathics3/mathics-core/issues/743
+# test_system_specific_long_integer:
+#
https://github.com/Mathics3/mathics-core/issues/760
+%pytest \
+%ifarch s390x
+ --deselect=test/test_evaluation.py::test_system_specific_long_integer \
+%endif
+ --deselect=test/test_strings.py::test_string_split
%files -n mathics -f %{pyproject_files}
%license COPYING.txt
commit ec9785c9f1597f0f9267821e759087d2cf406bf4
Author: Davide Cavalca <dcavalca(a)fedoraproject.org>
Date: Sat Jan 21 16:21:17 2023 -0800
Initial import; Fixes: RHBZ#2158697
diff --git a/.gitignore b/.gitignore
new file mode 100644
index 0000000..0fad97f
--- /dev/null
+++ b/.gitignore
@@ -0,0 +1 @@
+/Mathics3-5.0.2.tar.gz
diff --git a/733.patch b/733.patch
new file mode 100644
index 0000000..60a0a77
--- /dev/null
+++ b/733.patch
@@ -0,0 +1,21 @@
+From fdd29ecdd8a71d6154571dab392d0480b53419d3 Mon Sep 17 00:00:00 2001
+From: Davide Cavalca <dcavalca(a)fedoraproject.org>
+Date: Sun, 8 Jan 2023 15:16:49 -0800
+Subject: [PATCH] ExampleData: update copyright byline for Namespaces.xml
+
+---
+ mathics/data/ExampleData/copyright.csv | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/mathics/data/ExampleData/copyright.csv
b/mathics/data/ExampleData/copyright.csv
+index 4f1a59c5e..d2e1fa8e6 100644
+--- a/mathics/data/ExampleData/copyright.csv
++++ b/mathics/data/ExampleData/copyright.csv
+@@ -12,6 +12,6 @@ numberdata.csv GNU Free Documentation License 1.2 Own Work Created By
Angus Grif
+ colors.json GNU Free Documentation License 1.2 Own Work Created Manually By Angus
Griffith
+ Testosterone.svg Public Domain
http://en.wikipedia.org/wiki/File:Testosteron.svg Taken
from
http://en.wikipedia.org/wiki/Testosterone on 2013/03/03
+ InventionNo1.xml GNU Free Documentation
License
http://openmusicscore.org/index.php?option=com_content&view=article&a...
+-Namespaces.xml CC BY-NC-SA License
http://edutechwiki.unige.ch/en/XML_namespace "A
larger example of namespace scoping" with comments removed
++Namespaces.xml W3C License
https://www.w3.org/TR/REC-xml-names/#defaulting "A
larger example of namespace scoping" with comments removed
+ Middlemarch.txt The Project Gutenberg License
https://archive.org/details/middlemarch00145gut Chapter 75 of George Eliot's novel
Middlemarch in ISO Latin 1 (8859-1) encoding
+ PrimeMeridian.html CC-BY-SA and GFDL
https://en.wikipedia.org/wiki/Prime_meridian
HTML of the English Wikipedia entry for "Prime Meridian" as of 2016/11/02; also
see
https://en.wikipedia.org/wiki/Wikipedia:Reusing_Wikipedia_content
diff --git a/mathics-repackage-source.sh b/mathics-repackage-source.sh
new file mode 100755
index 0000000..5a0751b
--- /dev/null
+++ b/mathics-repackage-source.sh
@@ -0,0 +1,20 @@
+#!/bin/sh
+
+set -eu
+
+name="Mathics3"
+version="$(rpm -q --qf '%{VERSION}\n' --specfile python-mathics3.spec | head
-1)"
+srcdir="${name}-${version}"
+tarball="${srcdir}.tar.gz"
+url="https://files.pythonhosted.org/packages/source/M/${name}/${tarball}"
+
+curdir="$PWD"
+workdir="$(mktemp -d)"
+trap 'rm -rf "$workdir"' EXIT
+
+wget -O "${workdir}/${tarball}" "$url"
+tar xvzf "$workdir/$tarball" -C "$workdir"
+#
https://github.com/Mathics3/mathics-core/pull/731
+rm "${workdir}/${srcdir}/mathics/data/ExampleData/lena.tif"
+wget -O ${workdir}/${srcdir}/mathics/data/ExampleData/hedy.tif
https://github.com/Mathics3/mathics-core/raw/46e8a073b066dd273c8afc5ec67b...
+(cd "$workdir"; tar cvzf "${curdir}/${tarball}"
"${srcdir}")
diff --git a/python-mathics3.spec b/python-mathics3.spec
new file mode 100644
index 0000000..a6cadac
--- /dev/null
+++ b/python-mathics3.spec
@@ -0,0 +1,85 @@
+%global srcname Mathics3
+
+Name: python-mathics3
+Version: 5.0.2
+Release: %autorelease
+Summary: General-purpose computer algebra system
+
+# mathics3 itself is GPLv3, the other licenses are for the data files (see below)
+License: GPL-3.0-only AND Public Domain AND CC-BY-SA-3.0 AND W3C
+URL:
https://mathics.org
+# Fetched from PyPI and repackaged with mathics-repackage-source.sh due to
+#
https://github.com/Mathics3/mathics-core/issues/728
+Source: %{srcname}-%{version}.tar.gz
+Source: mathics-repackage-source.sh
+# ExampleData: update copyright byline for Namespaces.xml
+Patch:
https://github.com/Mathics3/mathics-core/pull/733.patch
+
+BuildRequires: gcc
+BuildRequires: python3-devel
+BuildRequires: python3-Cython
+BuildRequires: python3-pytest
+
+%global _description %{expand:
+Mathics is a general-purpose computer algebra system (CAS) providing a free,
+open-source alternative to Mathematica.}
+
+%description %_description
+
+%package -n mathics
+Summary: %{summary}
+License: GPL-3.0-only
+Recommends: mathics-data = %{version}-%{release}
+Provides: python-mathics3 = %{version}-%{release}
+Provides: mathics3 = %{version}-%{release}
+
+%description -n mathics %_description
+
+%package -n mathics-data
+Summary: Example data files for Mathics
+# From mathics/data/ExampleData/copyright.csv
+License: Public Domain AND CC-BY-SA-3.0 AND W3C
+
+%description -n mathics-data
+This package provides example data files for Mathics.
+
+%prep
+%autosetup -p1 -n %{srcname}-%{version}
+
+# Relax sympy version requirement
+#
https://github.com/Mathics3/mathics-core/commit/c031eb7e487f789dddccb8c41...
+sed -i 's:"sympy.*":"sympy":' setup.py
+
+# Fix permissions
+#
https://github.com/Mathics3/mathics-core/pull/729
+chmod -x mathics/data/ExampleData/{InventionNo1.xml,numberdata.csv}
+
+export USE_CYTHON=1
+%generate_buildrequires
+%pyproject_buildrequires
+
+%build
+export USE_CYTHON=1
+%pyproject_wheel
+
+%install
+export USE_CYTHON=1
+%pyproject_install
+%pyproject_save_files mathics
+
+%check
+# TODO: file an upstream bug for this
+%pytest --deselect=test/test_strings.py::test_string_split
+
+%files -n mathics -f %{pyproject_files}
+%license COPYING.txt
+%doc README.rst FUTURE.rst AUTHORS.txt CHANGES.rst ChangeLog
+%{_bindir}/mathics
+%exclude %{python3_sitearch}/mathics/data
+
+%files -n mathics-data
+%license mathics/data/ExampleData/copyright.csv
+%{python3_sitearch}/mathics/data
+
+%changelog
+%autochangelog
diff --git a/sources b/sources
new file mode 100644
index 0000000..0ecd26c
--- /dev/null
+++ b/sources
@@ -0,0 +1 @@
+SHA512 (Mathics3-5.0.2.tar.gz) =
8015307ee71bacd584ef0b2f7b54446f0b640c1b378971b3838788bcd990af2fbcc353d19004c2369cf46d5a81bea584ddaa934825df6c935e0c2249fb99c459