Compare commits

..

No commits in common. "rawhide" and "f30" have entirely different histories.
rawhide ... f30

10 changed files with 209 additions and 447 deletions

View File

@ -1,8 +0,0 @@
# sympy
SymPy is a Python library for symbolic mathematics. It aims to become a
full-featured computer algebra system (CAS) while keeping the code as
simple as possible in order to be comprehensible and easily extensible.
SymPy is written entirely in Python.
See [the home page](https://www.sympy.org/) for more information.

View File

@ -1 +1 @@
SHA512 (sympy-1.12.tar.gz) = 96a89b88f6912d70c56f5bd1903dd3c518963118ff25d033cdcb7da2f260b8ee209d3ab4a4394dd2b5dc0b4585b71ccd55d55c8e5c6e28024cccbedf07ee4360
SHA512 (sympy-1.4.tar.gz) = fdf2113478393ac71c08a440c97ded1d11e2cb630da237a4e32d03a54fda1bb51c6317a757e5d51683fc1ff7ed865cf3b4c02927bec5974eb68bacc5b88f865a

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$'

11
sympy-doc.patch Normal file
View File

@ -0,0 +1,11 @@
--- sympy-sympy-1.4/README.rst.orig 2019-04-09 18:29:25.000000000 -0600
+++ sympy-sympy-1.4/README.rst 2019-04-17 14:31:01.408877172 -0600
@@ -240,7 +240,7 @@ To cite SymPy in publications use
A BibTeX entry for LaTeX users is
-.. code-block:: none
+.. code-block:: BibTeX
@article{10.7717/peerj-cs.103,
title = {SymPy: symbolic computing in Python},

36
sympy-float.patch Normal file
View File

@ -0,0 +1,36 @@
--- sympy-sympy-1.4/sympy/core/tests/test_numbers.py.orig 2019-04-09 18:29:25.000000000 -0600
+++ sympy-sympy-1.4/sympy/core/tests/test_numbers.py 2019-04-17 19:54:46.128555214 -0600
@@ -1860,11 +1860,6 @@ def test_numpy_to_float():
check_prec_and_relerr(np.float16(2.0/3), S(2)/3)
check_prec_and_relerr(np.float32(2.0/3), S(2)/3)
check_prec_and_relerr(np.float64(2.0/3), S(2)/3)
- # extended precision, on some arch/compilers:
- x = np.longdouble(2)/3
- check_prec_and_relerr(x, S(2)/3)
- y = Float(x, precision=10)
- assert same_and_same_prec(y, Float(S(2)/3, precision=10))
raises(TypeError, lambda: Float(np.complex64(1+2j)))
raises(TypeError, lambda: Float(np.complex128(1+2j)))
--- sympy-sympy-1.4/sympy/core/tests/test_sympify.py.orig 2019-04-09 18:29:25.000000000 -0600
+++ sympy-sympy-1.4/sympy/core/tests/test_sympify.py 2019-04-17 14:29:48.765055139 -0600
@@ -590,8 +590,6 @@ def test_sympify_numpy():
assert equal(sympify(np.float32(1.123456)), Float(1.123456, precision=24))
assert equal(sympify(np.float64(1.1234567891234)),
Float(1.1234567891234, precision=53))
- assert equal(sympify(np.longdouble(1.123456789)),
- Float(1.123456789, precision=80))
assert equal(sympify(np.complex64(1 + 2j)), S(1.0 + 2.0*I))
assert equal(sympify(np.complex128(1 + 2j)), S(1.0 + 2.0*I))
assert equal(sympify(np.longcomplex(1 + 2j)), S(1.0 + 2.0*I))
@@ -600,10 +598,6 @@ def test_sympify_numpy():
if hasattr(np, 'float96'):
assert equal(sympify(np.float96(1.123456789)),
Float(1.123456789, precision=80))
- #float128 does not exist on all platforms
- if hasattr(np, 'float128'):
- assert equal(sympify(np.float128(1.123456789123)),
- Float(1.123456789123, precision=80))
@XFAIL

View File

@ -1,38 +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
--- sympy-sympy-1.12/sympy/utilities/autowrap.py.orig 2023-05-09 17:42:05.000000000 -0600
+++ sympy-sympy-1.12/sympy/utilities/autowrap.py 2023-11-30 13:26:06.612852361 -0700
@@ -714,7 +714,7 @@ static PyMethodDef ${module}Methods[] =
_ufunc_outcalls = Template("*((double *)out${outnum}) = ${funcname}(${call_args});")
_ufunc_body = Template("""\
-static void ${funcname}_ufunc(char **args, npy_intp *dimensions, npy_intp* steps, void* data)
+static void ${funcname}_ufunc(char **args, const npy_intp *dimensions, const npy_intp* steps, void* data)
{
npy_intp i;
npy_intp n = dimensions[0];
--- sympy-sympy-1.12/sympy/utilities/tests/test_autowrap.py.orig 2023-05-09 17:42:05.000000000 -0600
+++ sympy-sympy-1.12/sympy/utilities/tests/test_autowrap.py 2023-11-30 12:42:03.489842964 -0700
@@ -284,7 +284,7 @@ static PyMethodDef wrapper_module_%(num)
{NULL, NULL, 0, NULL}
};
-static void test_ufunc(char **args, npy_intp *dimensions, npy_intp* steps, void* data)
+static void test_ufunc(char **args, const npy_intp *dimensions, const npy_intp* steps, void* data)
{
npy_intp i;
npy_intp n = dimensions[0];
@@ -378,7 +378,7 @@ static PyMethodDef wrapper_module_%(num)
{NULL, NULL, 0, NULL}
};
-static void multitest_ufunc(char **args, npy_intp *dimensions, npy_intp* steps, void* data)
+static void multitest_ufunc(char **args, const npy_intp *dimensions, const npy_intp* steps, void* data)
{
npy_intp i;
npy_intp n = dimensions[0];

View File

@ -1,103 +0,0 @@
--- sympy-sympy-1.12/sympy/logic/boolalg.py.orig 2023-05-09 17:42:05.000000000 -0600
+++ sympy-sympy-1.12/sympy/logic/boolalg.py 2023-06-29 16:38:14.568908065 -0600
@@ -1012,7 +1012,7 @@ class Xor(BooleanFunction):
for j in range(i + 1, len(rel)):
rj, cj = rel[j][:2]
if cj == nc:
- odd = ~odd
+ odd = not odd
break
elif cj == c:
break
--- sympy-sympy-1.12/sympy/parsing/ast_parser.py.orig 2023-05-09 17:42:05.000000000 -0600
+++ sympy-sympy-1.12/sympy/parsing/ast_parser.py 2023-06-29 17:12:19.620751353 -0600
@@ -23,7 +23,7 @@ from sympy.core.basic import Basic
from sympy.core.sympify import SympifyError
from ast import parse, NodeTransformer, Call, Name, Load, \
- fix_missing_locations, Str, Tuple
+ fix_missing_locations, Constant, Tuple
class Transform(NodeTransformer):
@@ -52,7 +52,7 @@ class Transform(NodeTransformer):
elif node.id in ['True', 'False']:
return node
return fix_missing_locations(Call(func=Name('Symbol', Load()),
- args=[Str(node.id)], keywords=[]))
+ args=[Constant(node.id)], keywords=[]))
def visit_Lambda(self, node):
args = [self.visit(arg) for arg in node.args.args]
--- sympy-sympy-1.12/sympy/parsing/sympy_parser.py.orig 2023-05-09 17:42:05.000000000 -0600
+++ sympy-sympy-1.12/sympy/parsing/sympy_parser.py 2023-06-29 17:42:24.574014070 -0600
@@ -627,7 +627,9 @@ def factorial_notation(tokens: List[TOKE
result: List[TOKEN] = []
nfactorial = 0
for toknum, tokval in tokens:
- if toknum == ERRORTOKEN:
+ if toknum == OP and tokval == "!":
+ nfactorial += 1
+ elif toknum == ERRORTOKEN:
op = tokval
if op == '!':
nfactorial += 1
@@ -1135,7 +1137,7 @@ class EvaluateFalseTransformer(ast.NodeT
new_node = ast.Call(
func=ast.Name(id=sympy_class, ctx=ast.Load()),
args=[left, right],
- keywords=[ast.keyword(arg='evaluate', value=ast.NameConstant(value=False, ctx=ast.Load()))],
+ keywords=[ast.keyword(arg='evaluate', value=ast.Constant(value=False, ctx=ast.Load()))],
starargs=None,
kwargs=None
)
@@ -1167,8 +1169,8 @@ class EvaluateFalseTransformer(ast.NodeT
if isinstance(node.op, ast.Sub):
right = ast.Call(
func=ast.Name(id='Mul', ctx=ast.Load()),
- args=[ast.UnaryOp(op=ast.USub(), operand=ast.Num(1)), right],
- keywords=[ast.keyword(arg='evaluate', value=ast.NameConstant(value=False, ctx=ast.Load()))],
+ args=[ast.UnaryOp(op=ast.USub(), operand=ast.Constant(1)), right],
+ keywords=[ast.keyword(arg='evaluate', value=ast.Constant(value=False, ctx=ast.Load()))],
starargs=None,
kwargs=None
)
@@ -1178,16 +1180,16 @@ class EvaluateFalseTransformer(ast.NodeT
rev = True
left = ast.Call(
func=ast.Name(id='Pow', ctx=ast.Load()),
- args=[left, ast.UnaryOp(op=ast.USub(), operand=ast.Num(1))],
- keywords=[ast.keyword(arg='evaluate', value=ast.NameConstant(value=False, ctx=ast.Load()))],
+ args=[left, ast.UnaryOp(op=ast.USub(), operand=ast.Constant(1))],
+ keywords=[ast.keyword(arg='evaluate', value=ast.Constant(value=False, ctx=ast.Load()))],
starargs=None,
kwargs=None
)
else:
right = ast.Call(
func=ast.Name(id='Pow', ctx=ast.Load()),
- args=[right, ast.UnaryOp(op=ast.USub(), operand=ast.Num(1))],
- keywords=[ast.keyword(arg='evaluate', value=ast.NameConstant(value=False, ctx=ast.Load()))],
+ args=[right, ast.UnaryOp(op=ast.USub(), operand=ast.Constant(1))],
+ keywords=[ast.keyword(arg='evaluate', value=ast.Constant(value=False, ctx=ast.Load()))],
starargs=None,
kwargs=None
)
@@ -1197,7 +1199,7 @@ class EvaluateFalseTransformer(ast.NodeT
new_node = ast.Call(
func=ast.Name(id=sympy_class, ctx=ast.Load()),
args=[left, right],
- keywords=[ast.keyword(arg='evaluate', value=ast.NameConstant(value=False, ctx=ast.Load()))],
+ keywords=[ast.keyword(arg='evaluate', value=ast.Constant(value=False, ctx=ast.Load()))],
starargs=None,
kwargs=None
)
@@ -1212,7 +1214,7 @@ class EvaluateFalseTransformer(ast.NodeT
def visit_Call(self, node):
new_node = self.generic_visit(node)
if isinstance(node.func, ast.Name) and node.func.id in self.functions:
- new_node.keywords.append(ast.keyword(arg='evaluate', value=ast.NameConstant(value=False, ctx=ast.Load())))
+ new_node.keywords.append(ast.keyword(arg='evaluate', value=ast.Constant(value=False, ctx=ast.Load())))
return new_node

51
sympy-python3.patch Normal file
View File

@ -0,0 +1,51 @@
--- sympy-sympy-1.4/sympy/utilities/autowrap.py.orig 2019-04-09 18:29:25.000000000 -0600
+++ sympy-sympy-1.4/sympy/utilities/autowrap.py 2019-04-17 14:34:26.580374579 -0600
@@ -228,6 +228,8 @@ except ImportError:
from distutils.extension import Extension
from Cython.Build import cythonize
cy_opts = {cythonize_options}
+if 'language_level' not in cy_opts or cy_opts['language_level'] == None:
+ cy_opts['language_level'] = 3
{np_import}
ext_mods = [Extension(
{ext_args},
--- sympy-sympy-1.4/sympy/utilities/_compilation/compilation.py.orig 2019-04-09 18:29:25.000000000 -0600
+++ sympy-sympy-1.4/sympy/utilities/_compilation/compilation.py 2019-04-17 14:34:26.581374576 -0600
@@ -292,6 +292,8 @@ def simple_cythonize(src, destdir=None,
try:
cy_options = CompilationOptions(default_options)
cy_options.__dict__.update(cy_kwargs)
+ if cy_options.__dict__['language_level'] == None:
+ cy_options.__dict__['language_level'] = 3
cy_result = cy_compile([src], cy_options)
if cy_result.num_errors > 0:
raise ValueError("Cython compilation failed.")
--- sympy-sympy-1.4/sympy/utilities/tests/test_autowrap.py.orig 2019-04-09 18:29:25.000000000 -0600
+++ sympy-sympy-1.4/sympy/utilities/tests/test_autowrap.py 2019-04-17 14:34:26.581374576 -0600
@@ -100,6 +100,8 @@ except ImportError:
from distutils.extension import Extension
from Cython.Build import cythonize
cy_opts = {}
+if 'language_level' not in cy_opts or cy_opts['language_level'] == None:
+ cy_opts['language_level'] = 3
ext_mods = [Extension(
'wrapper_module_%(num)s', ['wrapper_module_%(num)s.pyx', 'wrapped_code_%(num)s.c'],
@@ -138,6 +140,8 @@ except ImportError:
from distutils.extension import Extension
from Cython.Build import cythonize
cy_opts = {'compiler_directives': {'boundscheck': False}}
+if 'language_level' not in cy_opts or cy_opts['language_level'] == None:
+ cy_opts['language_level'] = 3
ext_mods = [Extension(
'wrapper_module_%(num)s', ['wrapper_module_%(num)s.pyx', 'wrapped_code_%(num)s.c'],
@@ -164,6 +168,8 @@ except ImportError:
from distutils.extension import Extension
from Cython.Build import cythonize
cy_opts = {'compiler_directives': {'boundscheck': False}}
+if 'language_level' not in cy_opts or cy_opts['language_level'] == None:
+ cy_opts['language_level'] = 3
import numpy as np
ext_mods = [Extension(

11
sympy-sympify.patch Normal file
View File

@ -0,0 +1,11 @@
--- sympy-sympy-1.4/sympy/core/sympify.py.orig 2019-04-09 18:29:25.000000000 -0600
+++ sympy-sympy-1.4/sympy/core/sympify.py 2019-04-17 14:36:06.028059616 -0600
@@ -382,7 +382,7 @@ def sympify(a, locals=None, convert_xor=
try:
a = a.replace('\n', '')
expr = parse_expr(a, local_dict=locals, transformations=transformations, evaluate=evaluate)
- except (TokenError, SyntaxError) as exc:
+ except (TokenError, SyntaxError, TypeError) as exc:
raise SympifyError('could not parse %r' % a, exc)
return expr

View File

@ -1,73 +1,44 @@
# We used to build with Theano support. However, we no longer have a compatible
# version of Theano in Fedora. If aesara is ever packaged for Fedora, we can
# use it instead.
# We are archful (see below), but there are no ELF objects in the binary RPM.
%global debug_package %{nil}
Name: sympy
Version: 1.12
Release: 3%{?dist}
Version: 1.4
Release: 1%{?dist}
Summary: A Python library for symbolic mathematics
# The project as a whole is BSD-3-Clause.
# The files in sympy/parsing/latex are MIT.
License: BSD-3-Clause AND MIT
URL: https://sympy.org/
License: BSD
URL: http://sympy.org/
Source0: https://github.com/%{name}/%{name}/archive/%{name}-%{version}.tar.gz
# Skip tests that require a display
Patch0: %{name}-circuitplot.patch
# Adapt to python 3.12
Patch1: %{name}-python3.12.patch
# Fix incompatible pointers, which are an error with GCC 14
Patch2: %{name}-incompatible-pointer.patch
# Remove tests that fail on non-x86 architectures
Patch0: %{name}-float.patch
# Fix a documentation typo
Patch1: %{name}-doc.patch
# Default to python3 in the Cython backend
Patch2: %{name}-python3.patch
# Convert TypeError to SympifyError inside sympify()
Patch3: %{name}-sympify.patch
# 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
# available on i686. When we can stop building on i686 altogether, we can bring
# this back. In the meantime, we cannot claim to be noarch, because the i686
# build is different from the other arches in lacking BuildRequires: antlr4.
# BuildArch: noarch
BuildArch: noarch
%ifarch %{java_arches}
BuildRequires: antlr4
%endif
BuildRequires: gcc
BuildRequires: gcc-c++
BuildRequires: gcc-gfortran
BuildRequires: python3-devel
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: python3-numpy-f2py
BuildRequires: %{py3_dist scipy}
BuildRequires: %{py3_dist wurlitzer}
# Documentation
BuildRequires: gettext
BuildRequires: graphviz
BuildRequires: ImageMagick
BuildRequires: librsvg2-tools
BuildRequires: make
BuildRequires: %{py3_dist furo}
BuildRequires: %{py3_dist linkify-it-py}
BuildRequires: %{py3_dist mpmath}
BuildRequires: %{py3_dist numpydoc}
BuildRequires: %{py3_dist sphinx-autobuild}
BuildRequires: %{py3_dist sphinx-copybutton}
BuildRequires: %{py3_dist sphinx-math-dollar}
BuildRequires: %{py3_dist sphinx-reredirects}
BuildRequires: %{py3_dist sphinxcontrib-jquery}
BuildRequires: python-mpmath-doc
BuildRequires: parallel
BuildRequires: procps
BuildRequires: python3-devel
BuildRequires: python3dist(cython)
BuildRequires: python3dist(docutils)
BuildRequires: python3dist(fastcache)
BuildRequires: python3dist(gmpy2)
BuildRequires: python3dist(matplotlib)
BuildRequires: python3dist(mpmath)
BuildRequires: python3dist(numpy)
BuildRequires: python3-numpy-f2py
BuildRequires: python3dist(scipy)
BuildRequires: python3dist(sphinx)
BuildRequires: python3dist(theano)
BuildRequires: tex(latex)
BuildRequires: tex-dvipng
# Tests
BuildRequires: parallel
BuildRequires: %{py3_dist autowrap}
BuildRequires: xorg-x11-fonts-Type1
BuildRequires: xorg-x11-server-Xvfb
@ -81,24 +52,19 @@ Python and does not require any external libraries.
%package -n python3-%{name}
Summary: A Python3 library for symbolic mathematics
Recommends: tex(latex)
Recommends: tex(amsfonts.sty)
Recommends: tex(amsmath.sty)
Recommends: tex(euler.sty)
Recommends: tex(eulervm.sty)
Recommends: tex(standalone.cls)
%ifarch %{java_arches}
Recommends: %{py3_dist antlr4-python3-runtime}
%endif
Recommends: %{py3_dist cython}
Recommends: %{py3_dist gmpy2}
Recommends: %{py3_dist matplotlib}
Recommends: %{py3_dist numexpr}
Recommends: %{py3_dist pyglet}
Recommends: %{py3_dist scipy}
Requires: mesa-libGLU
Requires: python3dist(cython)
Requires: python3dist(fastcache)
Requires: python3dist(gmpy2)
Requires: python3dist(matplotlib)
Requires: python3dist(pyglet)
# This can be removed when F38 reaches EOL
Obsoletes: sympy-texmacs < 1.8
Recommends: python3dist(scipy)
Recommends: python3dist(theano)
# This can be removed when F29 reaches EOL
Obsoletes: python2-%{name} < 1.3
Provides: python2-%{name} = %{version}-%{release}
%description -n python3-%{name}
SymPy aims to become a full-featured computer algebra system (CAS)
@ -106,8 +72,15 @@ while keeping the code as simple as possible in order to be
comprehensible and easily extensible. SymPy is written entirely in
Python and does not require any external libraries.
%package texmacs
Summary: TeXmacs integration for sympy
Requires: %{name} = %{version}-%{release}
Requires: texmacs
%description texmacs
This package contains a TeXmacs plugin for sympy.
%package examples
License: BSD-3-Clause
Summary: Sympy examples
Requires: python3-%{name} = %{version}-%{release}
@ -115,31 +88,8 @@ Requires: python3-%{name} = %{version}-%{release}
This package contains example input for sympy.
%package doc
# This project is BSD-3-Clause. Other files bundled with the documentation
# have the following licenses:
# - searchindex.js: BSD-2-Clause
# - _static/basic.css: BSD-2-Clause
# - _static/clipboard.min.js: MIT
# - _static/copy*: MIT
# - _static/doctools.js: BSD-2-Clause
# - _static/graphviz.js: BSD-2-Clause
# - _static/jquery*.js: MIT
# - _static/language_data.js: BSD-2-Clause
# - _static/plot_directive.css: PSF-2.0 (see note)
# - _static/pygments.css: BSD-2-Clause
# - _static/scripts/*: MIT
# - _static/searchtools.js: BSD-2-Clause
# - _static/styles/*: MIT
# - _static/underscore*.js: MIT
#
# NOTE: The license of _static/plot_directive.css is the same as the license of
# matplotlib. The matplotlib license is functionally identical to PSF-2.0, but
# uses different organization and project names. I am using the PSF-2.0
# identifier for now, because there is no valid SPDX choice. Revisit this.
License: BSD-3-Clause AND BSD-2-Clause AND MIT AND PSF-2.0
Summary: Documentation for sympy
Provides: bundled(js-jquery)
Provides: bundled(js-underscore)
Provides: bundled(jquery)
%description doc
HTML documentation for sympy.
@ -147,59 +97,52 @@ HTML documentation for sympy.
%prep
%autosetup -p1 -n %{name}-%{name}-%{version}
fixtimestamp() {
touch -r $1.orig $1
rm -f $1.orig
}
# If running on a 32-bit system, disable a test that requires 64-bit integers.
%global maxpyint %(python3 -c 'import sys;print("%x" % sys.maxsize)')
if [ "%{maxpyint}" = "7fffffff" ]; then
sed -i '/issue 6393/,/assert b == -d/d' sympy/polys/tests/test_rootoftools.py
fi
# Allow building with a numpy that has a release candidate version number
sed -i 's/StrictVersion/LooseVersion/g' sympy/external/importtools.py
# 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
touch -r $fil.orig $fil
rm -f $fil.orig
done
# Remove bogus shebangs
for fil in sympy/physics/mechanics/models.py \
sympy/physics/optics/polarization.py; do
sed -i.orig '/env python/d' $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
%generate_buildrequires
%pyproject_buildrequires
%build
%ifarch %{java_arches}
# Regenerate the ANTLR files
%{python3} setup.py antlr
%endif
# Build
%pyproject_wheel
%py3_build
# Build the documentation
pushd doc
make html SPHINXOPTS=%{?_smp_mflags} PYTHON=%{python3}
sed -i 's/sphinx-build/&-%{python3_version}/' Makefile
make html SPHINXOPTS=%{?_smp_mflags} PYTHON=%{__python3}
make cheatsheet
popd
%install
%pyproject_install
%pyproject_save_files isympy sympy
%py3_install
## Remove extra files
rm -f %{buildroot}%{_bindir}/{,doc}test
## Install the TeXmacs integration
sed 's/python/python3/' data/TeXmacs/bin/tm_sympy > \
%{buildroot}%{_bindir}/tm_sympy
chmod a+x %{buildroot}%{_bindir}/tm_sympy
touch -r data/TeXmacs/bin/tm_sympy %{buildroot}%{_bindir}/tm_sympy
mkdir -p %{buildroot}%{_datadir}/TeXmacs/plugins/sympy
cp -a data/TeXmacs/progs %{buildroot}%{_datadir}/TeXmacs/plugins/sympy
chmod a-x %{buildroot}%{_datadir}/TeXmacs/plugins/sympy/progs/*.scm
# Don't let an executable script go into the documentation
chmod -R a-x+X examples
# Fix permissions
chmod 0755 %{buildroot}%{python3_sitelib}/sympy/benchmarks/bench_symbench.py \
%{buildroot}%{python3_sitelib}/sympy/testing/tests/diagnose_imports.py
# Convert the README to HTML
rst2html --no-datestamp README.rst README.html
# Install the HTML documentation
mkdir -p %{buildroot}%{_docdir}/%{name}-doc
@ -210,31 +153,38 @@ rm -fr %{buildroot}%{_docdir}/%{name}-doc/i18n
# Try to get rid of pyc files, which aren't useful for documentation
find examples/ -name '*.py[co]' -print -delete
# Fix some executable bits
chmod a+x \
%{buildroot}%{python3_sitelib}/sympy/benchmarks/bench_symbench.py \
%{buildroot}%{python3_sitelib}/sympy/physics/mechanics/models.py \
%{buildroot}%{python3_sitelib}/sympy/utilities/tests/diagnose_imports.py
%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))
let "dnum = $RANDOM % 90 + 10"
# 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
xvfb-run -a -n $dnum \
parallel %{?_smp_mflags} \
%{__python3} bin/test -v --split {}/$jobs \
::: $(bash -c "echo {1..$jobs}")
%files -n python3-%{name} -f %{pyproject_files}
%doc AUTHORS README.md
%doc doc/_build/cheatsheet/cheatsheet.pdf
%files -n python3-%{name}
%doc AUTHORS CODE_OF_CONDUCT.md README.html
%doc doc/_build/cheatsheet/combinatoric_cheatsheet.pdf
%license LICENSE
%{python3_sitelib}/isympy.*
%{python3_sitelib}/__pycache__/isympy.*
%{python3_sitelib}/sympy/
%{python3_sitelib}/sympy-%{version}-*.egg-info
%{_bindir}/isympy
%{_mandir}/man1/isympy.1*
%files texmacs
%license data/TeXmacs/LICENSE
%{_bindir}/tm_sympy
%{_datadir}/TeXmacs/plugins/sympy/
%files examples
%doc examples/*
@ -243,141 +193,6 @@ fi
%{_docdir}/%{name}-doc/html
%changelog
* Thu Nov 30 2023 Jerry James <loganjerry@gmail.com> - 1.12-3
- Fix incompatible pointer types for GCC 14 compatibility
* Sat Jul 22 2023 Fedora Release Engineering <releng@fedoraproject.org> - 1.12-2
- Rebuilt for https://fedoraproject.org/wiki/Fedora_39_Mass_Rebuild
* Thu Jun 29 2023 Jerry James <loganjerry@gmail.com> - 1.12-1
- Version 1.12
- Add patch for python 3.12 compatibility
* Thu Jun 29 2023 Python Maint <python-maint@redhat.com> - 1.11.1-5
- Rebuilt for Python 3.12
* Tue Feb 21 2023 Jerry James <loganjerry@gmail.com> - 1.11.1-4
- Fix the antlr4 Recommends (bz 2172030)
- Dynamically generate BuildRequires (to the extent possible)
* Sat Jan 21 2023 Fedora Release Engineering <releng@fedoraproject.org> - 1.11.1-3
- Rebuilt for https://fedoraproject.org/wiki/Fedora_38_Mass_Rebuild
* Tue Sep 27 2022 Jerry James <loganjerry@gmail.com> - 1.11.1-2
- Do not run antlr on i386 where it doesn't exist
- Be archful so we don't BR a package that doesn't exist on i386
* Tue Sep 6 2022 Jerry James <loganjerry@gmail.com> - 1.11.1-1
- Version 1.11.1
- Convert License tag to SPDX
- Drop upstreamed patches: -tests, -distutils, -signature
- Drop fastcache dependency
- Regenerate ANTLR4 files
* Sat Jul 23 2022 Fedora Release Engineering <releng@fedoraproject.org> - 1.10.1-3
- Rebuilt for https://fedoraproject.org/wiki/Fedora_37_Mass_Rebuild
* Wed Jun 15 2022 Python Maint <python-maint@redhat.com> - 1.10.1-2
- Rebuilt for Python 3.11
* Sat Mar 19 2022 Jerry James <loganjerry@gmail.com> - 1.10.1-1
- Version 1.10.1
* Thu Mar 17 2022 Jerry James <loganjerry@gmail.com> - 1.10-1
- Version 1.10
- Drop upstreamed patches: -python3, -png-decoder, -gmpy2-mpq,
and -rational-exponent
* Sat Jan 22 2022 Fedora Release Engineering <releng@fedoraproject.org> - 1.9-2
- Rebuilt for https://fedoraproject.org/wiki/Fedora_36_Mass_Rebuild
* Fri Oct 8 2021 Jerry James <loganjerry@gmail.com> - 1.9-1
- Version 1.9
- Drop theano support due to incompatibility with the Fedora version
- Add -tests, -distutils, -gmpy2-mpq, and -rational-exponent patches to
work around test failures
* Fri Jul 23 2021 Fedora Release Engineering <releng@fedoraproject.org> - 1.8-3
- Rebuilt for https://fedoraproject.org/wiki/Fedora_35_Mass_Rebuild
* Thu Jun 10 2021 Zbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl> - 1.8-2~bootstrap
- Build in bootstrap mode to work-around missing theano
* Fri Jun 04 2021 Python Maint <python-maint@redhat.com> - 1.8-2
- Rebuilt for Python 3.10
* Mon Apr 12 2021 Jerry James <loganjerry@gmail.com> - 1.8-1
- Version 1.8
- Drop the -float patch and only run tests on x86_64
- Add -circuitplot patch to skip tests that fail with no display
- Drop the -texmacs subpackage; the TeXmacs package ships its own sympy plugin
* Wed Jan 27 2021 Fedora Release Engineering <releng@fedoraproject.org> - 1.7.1-2
- Rebuilt for https://fedoraproject.org/wiki/Fedora_34_Mass_Rebuild
* Sat Dec 12 2020 Jerry James <loganjerry@gmail.com> - 1.7.1-1
- Version 1.7.1
* Thu Dec 10 2020 Jerry James <loganjerry@gmail.com> - 1.7-2
- Fix preview of PNG images (bz 1906363)
- Add missing Recommends needed to preview images (bz 1906363)
* Sat Nov 28 2020 Jerry James <loganjerry@gmail.com> - 1.7-1
- Version 1.7
* Thu Nov 26 2020 Jerry James <loganjerry@gmail.com> - 1.6.2-2
- Update Theano dependency for Theano-PyMC
- Add -theano-pymc patch to adapt
* Mon Aug 10 2020 Jerry James <loganjerry@gmail.com> - 1.6.2-1
- Version 1.6.2
* Wed Jul 29 2020 Fedora Release Engineering <releng@fedoraproject.org> - 1.6.1-2
- Rebuilt for https://fedoraproject.org/wiki/Fedora_33_Mass_Rebuild
* Thu Jul 2 2020 Jerry James <loganjerry@gmail.com> - 1.6.1-1
- Version 1.6.1
- Drop upstreamed -ast patch
* Wed Jun 24 2020 Jerry James <loganjerry@gmail.com> - 1.6-2
- Add setuptools BR
- Add -ast patch to fix compilation with python 3.9
* Fri May 29 2020 Jerry James <loganjerry@gmail.com> - 1.6-1
- Version 1.6
- Drop upstreamed -doc and -sample-set patches
- Disable testing on 32-bit systems; too many tests need 64-bit integers
* Tue May 26 2020 Miro Hrončok <mhroncok@redhat.com> - 1.5.1-4
- Rebuilt for Python 3.9
* Mon May 11 2020 Jerry James <loganjerry@gmail.com> - 1.5.1-3
- Add -sample-set patch to fix test failure with python 3.9
* Fri Jan 31 2020 Fedora Release Engineering <releng@fedoraproject.org> - 1.5.1-2
- Rebuilt for https://fedoraproject.org/wiki/Fedora_32_Mass_Rebuild
* Wed Jan 8 2020 Jerry James <loganjerry@gmail.com> - 1.5.1-1
- Update to 1.5.1
- Drop upstreamed patches
- Drop upstreamed workaround for numpy with a release candidate version
* Mon Nov 4 2019 Jerry James <loganjerry@gmail.com> - 1.4-6
- Fix broken dependencies in the -texmacs subpackage
- Recommend numexpr
* Fri Sep 13 2019 Jerry James <loganjerry@gmail.com> - 1.4-5
- Add one more patch to fix a python 3.8 warning
* Sat Aug 24 2019 Robert-André Mauchin <zebob.m@gmail.com> - 1.4-4
- Add patches to fix build with Python 3.8 and Numpy 1.17
* Mon Aug 19 2019 Miro Hrončok <mhroncok@redhat.com> - 1.4-3
- Rebuilt for Python 3.8
* Sat Jul 27 2019 Fedora Release Engineering <releng@fedoraproject.org> - 1.4-2
- Rebuilt for https://fedoraproject.org/wiki/Fedora_31_Mass_Rebuild
* Wed Apr 17 2019 Jerry James <loganjerry@gmail.com> - 1.4-1
- Update to 1.4
- Drop -factorial patch