Version 1.13.0

- Drop unnecessary circuitplot patch
- Drop upstreamed incompatible-pointer patch
- Link duplicate documentation files
- Run tests on all architectures
This commit is contained in:
Jerry James 2024-07-11 10:51:05 -06:00
parent 29d55a4f0e
commit c93a0ad438
4 changed files with 47 additions and 105 deletions

View File

@ -1 +1 @@
SHA512 (sympy-1.12.1.tar.gz) = 5e7642b6e70332f521a3bc58a9c19a64f8eb3e9a6cc6cab63a3e02a9343e31a616f6f437b6c9af601f05fb4f3f69efee1b9811370721a456c14264b97697c965
SHA512 (sympy-1.13.0.tar.gz) = 864e0be68bf0c63187d7eeaaa9455a3cea27718e5cf75105e411c7bfadc671928544ec49babe4a513630e8b5d6d45a63c19fc9551ca4ef7c7a0d84c4d62a6e2c

View File

@ -1,13 +0,0 @@
--- sympy-sympy-1.8/sympy/physics/quantum/tests/test_circuitplot.py.orig 2021-04-09 16:29:50.000000000 -0600
+++ sympy-sympy-1.8/sympy/physics/quantum/tests/test_circuitplot.py 2021-04-12 13:27:55.241417177 -0600
@@ -4,7 +4,9 @@ from sympy.physics.quantum.gate import C
from sympy.external import import_module
from sympy.testing.pytest import skip
-mpl = import_module('matplotlib')
+mpl = import_module(
+ 'matplotlib', import_kwargs={'fromlist': ['pyplot']},
+ catch=(RuntimeError,)) # This is raised in environments that have no display.
def test_render_label():
assert render_label('q0') == r'$\left|q0\right\rangle$'

View File

@ -1,51 +0,0 @@
Fixes this error with GCC 14 and numpy 1.19.0 or later:
wrapper_module_15.c:32:60: error: initialization of void (*)(char **, const npy_intp *, const npy_intp *, void *) {aka void (*)(char **, const long int *, const long int *, void *)} from incompatible pointer type void (*)(char **, npy_intp *, npy_intp *, void *) {aka void (*)(char **, long int *, long int *, void *)}
32 | PyUFuncGenericFunction wrapped_281000935073472_funcs[1] = {&wrapped_281000935073472_ufunc};
| ^
error: command '/usr/bin/gcc' failed with exit code 1
diff --git a/sympy/utilities/autowrap.py b/sympy/utilities/autowrap.py
index 566fd2ee21..feff051ded 100644
--- a/sympy/utilities/autowrap.py
+++ b/sympy/utilities/autowrap.py
@@ -714,7 +714,11 @@ def binary_function(symfunc, expr, **kwargs):
_ufunc_outcalls = Template("*((double *)out${outnum}) = ${funcname}(${call_args});")
_ufunc_body = Template("""\
+#ifdef NPY_1_19_API_VERSION
+static void ${funcname}_ufunc(char **args, const npy_intp *dimensions, const npy_intp* steps, void* data)
+#else
static void ${funcname}_ufunc(char **args, npy_intp *dimensions, npy_intp* steps, void* data)
+#endif
{
npy_intp i;
npy_intp n = dimensions[0];
diff --git a/sympy/utilities/tests/test_autowrap.py b/sympy/utilities/tests/test_autowrap.py
index 2d6d1796d5..acb0e9a5ef 100644
--- a/sympy/utilities/tests/test_autowrap.py
+++ b/sympy/utilities/tests/test_autowrap.py
@@ -284,7 +284,11 @@ def test_ufuncify_source():
{NULL, NULL, 0, NULL}
};
+#ifdef NPY_1_19_API_VERSION
+static void test_ufunc(char **args, const npy_intp *dimensions, const npy_intp* steps, void* data)
+#else
static void test_ufunc(char **args, npy_intp *dimensions, npy_intp* steps, void* data)
+#endif
{
npy_intp i;
npy_intp n = dimensions[0];
@@ -378,7 +382,11 @@ def test_ufuncify_source_multioutput():
{NULL, NULL, 0, NULL}
};
+#ifdef NPY_1_19_API_VERSION
+static void multitest_ufunc(char **args, const npy_intp *dimensions, const npy_intp* steps, void* data)
+#else
static void multitest_ufunc(char **args, npy_intp *dimensions, npy_intp* steps, void* data)
+#endif
{
npy_intp i;
npy_intp n = dimensions[0];

View File

@ -5,8 +5,10 @@
# We are archful (see below), but there are no ELF objects in the binary RPM.
%global debug_package %{nil}
%global giturl https://github.com/sympy/sympy
Name: sympy
Version: 1.12.1
Version: 1.13.0
Release: %autorelease
Summary: A Python library for symbolic mathematics
@ -14,13 +16,8 @@ Summary: A Python library for symbolic mathematics
# The files in sympy/parsing/latex are MIT.
License: BSD-3-Clause AND MIT
URL: https://sympy.org/
VCS: https://github.com/sympy/sympy
Source0: %{vcs}/archive/%{name}-%{version}.tar.gz
# Skip tests that require a display
Patch0: %{name}-circuitplot.patch
# Fix incompatible pointers, which are an error with GCC 14
# https://github.com/sympy/sympy/pull/25968
Patch1: %{name}-incompatible-pointer.patch
VCS: git:%{giturl}.git
Source: %{giturl}/archive/%{name}-%{version}.tar.gz
# This package used to be noarch, and should still be noarch. However, because
# there is no JDK available on i686 anymore, the antlr4 package is also not
@ -31,21 +28,22 @@ Patch1: %{name}-incompatible-pointer.patch
%ifarch %{java_arches}
BuildRequires: antlr4
BuildRequires: %{py3_dist antlr4-python3-runtime}
%endif
BuildRequires: fdupes
BuildRequires: gcc
BuildRequires: gcc-c++
BuildRequires: gcc-gfortran
BuildRequires: python3-devel
BuildRequires: python3-clang
BuildRequires: %{py3_dist cython}
BuildRequires: %{py3_dist gmpy2}
BuildRequires: %{py3_dist llvmlite}
BuildRequires: %{py3_dist matplotlib}
BuildRequires: %{py3_dist matplotlib-inline}
BuildRequires: %{py3_dist myst-parser}
BuildRequires: %{py3_dist numexpr}
BuildRequires: %{py3_dist pycosat}
BuildRequires: python3-numpy-f2py
BuildRequires: %{py3_dist scipy}
BuildRequires: %{py3_dist wurlitzer}
# Documentation
BuildRequires: graphviz
@ -54,8 +52,10 @@ BuildRequires: librsvg2-tools
BuildRequires: make
BuildRequires: %{py3_dist furo}
BuildRequires: %{py3_dist linkify-it-py}
BuildRequires: %{py3_dist matplotlib-inline}
BuildRequires: %{py3_dist mpmath}
BuildRequires: %{py3_dist numpydoc}
BuildRequires: %{py3_dist myst-parser}
BuildRequires: %{py3_dist sphinx}
BuildRequires: %{py3_dist sphinx-copybutton}
BuildRequires: %{py3_dist sphinx-math-dollar}
BuildRequires: %{py3_dist sphinx-reredirects}
@ -65,10 +65,25 @@ BuildRequires: tex(latex)
BuildRequires: tex-dvipng
# Tests
BuildRequires: parallel
%ifarch x86_64
BuildRequires: lfortran
%endif
BuildRequires: %{py3_dist autowrap}
BuildRequires: xorg-x11-fonts-Type1
BuildRequires: xorg-x11-server-Xvfb
BuildRequires: %{py3_dist cloudpickle}
BuildRequires: %{py3_dist ipython}
# FIXME: parser failure in lark on ppc64le
%ifnarch ppc64le
BuildRequires: %{py3_dist lark}
%endif
# FIXME: Crashes in llvmlite on ppc64le and s390x
%ifnarch ppc64le s390x
BuildRequires: %{py3_dist llvmlite}
%endif
BuildRequires: %{py3_dist lxml}
BuildRequires: %{py3_dist pytest-split}
BuildRequires: %{py3_dist pytest-xdist}
BuildRequires: %{py3_dist wurlitzer}
BuildRequires: python3-z3
%global _description\
SymPy aims to become a full-featured computer algebra system (CAS)\
@ -93,6 +108,7 @@ Recommends: %{py3_dist cython}
Recommends: %{py3_dist gmpy2}
Recommends: %{py3_dist matplotlib}
Recommends: %{py3_dist numexpr}
Recommends: %{py3_dist pycosat}
Recommends: %{py3_dist pyglet}
Recommends: %{py3_dist scipy}
@ -148,12 +164,6 @@ fixtimestamp() {
rm -f $1.orig
}
# Do not depend on env
for fil in $(grep -rl "^#\![[:blank:]]*%{_bindir}/env" .); do
sed -i.orig 's,^\(#\![[:blank:]]*%{_bindir}/\)env python,\1python3,' $fil
fixtimestamp $fil
done
# Remove bogus shebangs
for fil in sympy/physics/mechanics/models.py \
sympy/physics/optics/polarization.py; do
@ -161,12 +171,22 @@ for fil in sympy/physics/mechanics/models.py \
fixtimestamp $fil
done
# Do not depend on env
for fil in $(grep -rl "^#\![[:blank:]]*%{_bindir}/env" .); do
sed -i.orig 's,^\(#\![[:blank:]]*%{_bindir}/\)env python,\1python3,' $fil
fixtimestamp $fil
done
# Use local objects.inv for intersphinx
sed -e "s|\('https://mpmath\.org/doc/current/', \)None|\1'%{_docdir}/python-mpmath-doc/html/objects.inv'|" \
-i doc/src/conf.py
# Permit use of antlr4 4.13
sed -i s'/4\.11/4.13/g' sympy/parsing/autolev/_parse_autolev_antlr.py \
sympy/parsing/latex/_parse_latex_antlr.py
%generate_buildrequires
%pyproject_buildrequires
%pyproject_buildrequires -x dev
%build
%ifarch %{java_arches}
@ -197,32 +217,18 @@ chmod -R a-x+X examples
chmod 0755 %{buildroot}%{python3_sitelib}/sympy/benchmarks/bench_symbench.py \
%{buildroot}%{python3_sitelib}/sympy/testing/tests/diagnose_imports.py
# Install the HTML documentation
# Install the HTML documentation and link duplicates
mkdir -p %{buildroot}%{_docdir}/%{name}-doc
cp -a doc/_build/html %{buildroot}%{_docdir}/%{name}-doc
rm -f %{buildroot}%{_docdir}/%{name}-doc/html/.buildinfo
rm -fr %{buildroot}%{_docdir}/%{name}-doc/i18n
%fdupes %{buildroot}%{_docdir}/%{name}-doc
# Try to get rid of pyc files, which aren't useful for documentation
find examples/ -name '*.py[co]' -print -delete
%check
# Many tests assume they are running on an x86_64 machine. Some assume that
# native 64-bit integers are available. Some assume that 80-bit floating point
# numbers are available. Some assume that certain operations always produce
# numpy float64 values (but produce float32 values on some architectures). I
# used to try to keep the test suite working on all architectures, but it has
# become too much of a burden. Only run tests if we happen to build on x86_64.
# We cannot use %%ifarch here because this is a noarch package.
if [ "$(uname -m)" = "x86_64" ]; then
# Split into many small chunks to reduce waiting in the end-game
jobs=%{?_smp_mflags}; jobs=${jobs#-j}; jobs=$((jobs * 3))
xvfb-run -d \
parallel %{?_smp_mflags} \
%{python3} bin/test -v --split {}/$jobs \
::: $(bash -c "echo {1..$jobs}")
fi
%{python3} bin/test -v --parallel
%files -n python3-%{name} -f %{pyproject_files}
%doc AUTHORS README.md