Compare commits

..

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

11 changed files with 313 additions and 475 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.2.tar.gz) = e9b1089d6bc897436b1888d1a21324b5086c19cbf7d857514688e25b1a3c7fcf7c36a2ae9a7121d88acf73b6cb66e97c5591fe3e575089b41138a21086286328

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

20
sympy-doc.patch Normal file
View File

@ -0,0 +1,20 @@
--- sympy-sympy-1.2/README.rst.orig 2018-07-09 10:27:56.000000000 -0600
+++ sympy-sympy-1.2/README.rst 2018-07-21 11:13:46.598313453 -0600
@@ -138,7 +138,7 @@ To test pull requests, use `sympy-bot <h
Regenerate Experimental `\LaTeX` Parser/Lexer
---------------------------------------------
-The parser and lexer generated with the `ANTLR4 <http://antlr4.org`_ toolchain
+The parser and lexer generated with the `ANTLR4 <http://antlr4.org>`_ toolchain
in `sympy/parsing/latex/_antlr` and checked into the repo. Presently, most
users should not need to regenerate these files, but if you plan to work on
this feature, you will need the `antlr4` command line tool available. One way
@@ -239,7 +239,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},

24
sympy-float.patch Normal file
View File

@ -0,0 +1,24 @@
--- sympy-sympy-1.2/sympy/core/tests/test_sympify.py.orig 2018-07-09 10:27:56.000000000 -0600
+++ sympy-sympy-1.2/sympy/core/tests/test_sympify.py 2018-07-11 19:05:43.077799326 -0600
@@ -583,8 +583,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))
@@ -595,12 +593,6 @@ def test_sympify_numpy():
except AttributeError: #float96 does not exist on all platforms
pass
- try:
- assert equal(sympify(np.float128(1.123456789123)),
- Float(1.123456789123, precision=80))
- except AttributeError: #float128 does not exist on all platforms
- pass
-
@XFAIL
def test_sympify_rational_numbers_set():

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

View File

@ -0,0 +1,52 @@
--- sympy-sympy-1.2/sympy/utilities/lambdify.py.orig 2018-08-14 12:45:57.659778760 +0200
+++ sympy-sympy-1.2/sympy/utilities/lambdify.py 2018-08-14 12:46:12.412849733 +0200
@@ -741,8 +741,7 @@
return argstrs, expr
- @staticmethod
- def _subexpr(expr, dummies_dict):
+ def _subexpr(self, expr, dummies_dict):
from sympy.matrices import DeferredVector
from sympy import sympify
@@ -752,13 +751,13 @@
if isinstance(expr, DeferredVector):
pass
elif isinstance(expr, dict):
- k = [sub_expr(sympify(a), dummies_dict) for a in expr.keys()]
- v = [sub_expr(sympify(a), dummies_dict) for a in expr.values()]
+ k = [self._subexpr(sympify(a), dummies_dict) for a in expr.keys()]
+ v = [self._subexpr(sympify(a), dummies_dict) for a in expr.values()]
expr = dict(zip(k, v))
elif isinstance(expr, tuple):
- expr = tuple(sub_expr(sympify(a), dummies_dict) for a in expr)
+ expr = tuple(self._subexpr(sympify(a), dummies_dict) for a in expr)
elif isinstance(expr, list):
- expr = [sub_expr(sympify(a), dummies_dict) for a in expr]
+ expr = [self._subexpr(sympify(a), dummies_dict) for a in expr]
return expr
def _print_funcargwrapping(self, args):
--- sympy-sympy-1.2/sympy/utilities/tests/test_lambdify.py.orig 2018-08-14 12:46:10.396840035 +0200
+++ sympy-sympy-1.2/sympy/utilities/tests/test_lambdify.py 2018-08-14 12:46:12.413849738 +0200
@@ -883,3 +883,18 @@
# Test that inspect.getsource works but don't hard-code implementation
# details
assert 'x**2' in inspect.getsource(f)
+
+def test_issue_14941():
+ x, y = Dummy(), Dummy()
+
+ # test dict
+ f1 = lambdify([x, y], {x: 3, y: 3}, 'sympy')
+ assert f1(2, 3) == {2: 3, 3: 3}
+
+ # test tuple
+ f2 = lambdify([x, y], (y, x), 'sympy')
+ assert f2(2, 3) == (3, 2)
+
+ # test list
+ f3 = lambdify([x, y], [y, x], 'sympy')
+ assert f3(2, 3) == [3, 2]

View File

@ -0,0 +1,11 @@
--- sympy-sympy-1.2/sympy/utilities/tests/test_code_quality.py.orig 2018-07-09 10:27:56.000000000 -0600
+++ sympy-sympy-1.2/sympy/utilities/tests/test_code_quality.py 2018-07-11 19:39:24.848490432 -0600
@@ -227,6 +227,8 @@ def test_files():
# these two are import timing tests:
"%(sep)sbin%(sep)ssympy_time.py" % sepd,
"%(sep)sbin%(sep)ssympy_time_cache.py" % sepd,
+ # this is a glob in a comment
+ "%(sep)sbin%(sep)stest_external_imports.py" % sepd,
# Taken from Python stdlib:
"%(sep)sparsing%(sep)ssympy_tokenize.py" % sepd,
# this one should be fixed:

20
sympy-tex-encoding.patch Normal file
View File

@ -0,0 +1,20 @@
--- sympy-sympy-1.2/doc/cheatsheet/combinatoric_cheatsheet.tex.orig 2018-07-09 18:27:56.000000000 +0200
+++ sympy-sympy-1.2/doc/cheatsheet/combinatoric_cheatsheet.tex 2018-08-14 13:38:21.397200957 +0200
@@ -425,7 +425,7 @@
\verb!coset_factor(g, af=False)!\\
-Return GÔs (selfÕs) coset factorization, \verb!f,! of \verb!g!.
+Return G's (self's) coset factorization, \verb!f,! of \verb!g!.
@@ -458,7 +458,7 @@
\verb!generate_dimino(af=False)!\\
-Yield group elements using DiminoÕs algorithm
+Yield group elements using Dimino's algorithm
\verb!generate_schreier_sims(af=False)!\\

View File

@ -1,75 +1,46 @@
# 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 Name: sympy
Version: 1.12 Version: 1.2
Release: 3%{?dist} Release: 2%{?dist}
Summary: A Python library for symbolic mathematics Summary: A Python library for symbolic mathematics
License: BSD
# The project as a whole is BSD-3-Clause. URL: http://sympy.org/
# The files in sympy/parsing/latex are MIT.
License: BSD-3-Clause AND MIT
URL: https://sympy.org/
Source0: https://github.com/%{name}/%{name}/archive/%{name}-%{version}.tar.gz Source0: https://github.com/%{name}/%{name}/archive/%{name}-%{version}.tar.gz
# Skip tests that require a display # Remove tests that fail on non-x86 architectures
Patch0: %{name}-circuitplot.patch Patch0: %{name}-float.patch
# Adapt to python 3.12 # The code quality tester bogusly fails on a comment
Patch1: %{name}-python3.12.patch Patch1: %{name}-test-code-quality.patch
# Fix incompatible pointers, which are an error with GCC 14 # Fix a couple of documentation typos
Patch2: %{name}-incompatible-pointer.patch Patch2: %{name}-doc.patch
# Fix _subexpr method in lambdify
# https://github.com/sympy/sympy/pull/14945
Patch3: %{name}-subexpr-lambdify.patch
# The TeX source has some weird symbols, we need to patch them out
Patch4: %{name}-tex-encoding.patch
# This package used to be noarch, and should still be noarch. However, because BuildArch: noarch
# 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
%ifarch %{java_arches}
BuildRequires: antlr4
%endif
BuildRequires: gcc
BuildRequires: gcc-c++
BuildRequires: gcc-gfortran BuildRequires: gcc-gfortran
BuildRequires: python3-devel BuildRequires: gettext
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: graphviz BuildRequires: graphviz
BuildRequires: ImageMagick BuildRequires: ImageMagick
BuildRequires: librsvg2-tools BuildRequires: librsvg2-tools
BuildRequires: make BuildRequires: python2-Cython python3-Cython
BuildRequires: %{py3_dist furo} BuildRequires: python2-devel python3-devel
BuildRequires: %{py3_dist linkify-it-py} BuildRequires: python3-docutils
BuildRequires: %{py3_dist mpmath} BuildRequires: python2-fastcache python3-fastcache
BuildRequires: %{py3_dist numpydoc} BuildRequires: python2-gmpy2 python3-gmpy2
BuildRequires: %{py3_dist sphinx-autobuild} BuildRequires: python2-matplotlib python3-matplotlib
BuildRequires: %{py3_dist sphinx-copybutton} BuildRequires: python2-mpmath python3-mpmath
BuildRequires: %{py3_dist sphinx-math-dollar} BuildRequires: python2-numpy python3-numpy
BuildRequires: %{py3_dist sphinx-reredirects} BuildRequires: python2-numpy-f2py python3-numpy-f2py
BuildRequires: %{py3_dist sphinxcontrib-jquery} BuildRequires: python2-scipy python3-scipy
BuildRequires: python-mpmath-doc BuildRequires: python3-sphinx
BuildRequires: python2-theano python3-theano
BuildRequires: tex(latex) BuildRequires: tex(latex)
BuildRequires: tex-dvipng BuildRequires: tex-dvipng
# Tests
BuildRequires: parallel
BuildRequires: %{py3_dist autowrap}
BuildRequires: xorg-x11-fonts-Type1 BuildRequires: xorg-x11-fonts-Type1
BuildRequires: xorg-x11-server-Xvfb BuildRequires: xorg-x11-server-Xvfb
BuildRequires: parallel
%global _description\ %global _description\
SymPy aims to become a full-featured computer algebra system (CAS)\ SymPy aims to become a full-featured computer algebra system (CAS)\
@ -79,26 +50,34 @@ Python and does not require any external libraries.
%description %_description %description %_description
%package -n python2-%{name}
Summary: %summary
Requires: mesa-libGLU
Requires: python2-fastcache
Requires: python2-gmpy2
Requires: python2-matplotlib
Requires: python2-mpmath
Requires: python2-pyglet
Recommends: python2-scipy
Recommends: python2-theano
%{?python_provide:%python_provide python2-%{name}}
# Remove before F30
Provides: sympy%{?_isa} = %{version}-%{release}
Obsoletes: sympy < %{version}-%{release}
%description -n python2-%{name} %_description
%package -n python3-%{name} %package -n python3-%{name}
Summary: A Python3 library for symbolic mathematics Summary: A Python3 library for symbolic mathematics
Recommends: tex(latex) Requires: mesa-libGLU
Recommends: tex(amsfonts.sty) Requires: python3-fastcache
Recommends: tex(amsmath.sty) Requires: python3-gmpy2
Recommends: tex(euler.sty) Requires: python3-matplotlib
Recommends: tex(eulervm.sty) Requires: python3-mpmath
Recommends: tex(standalone.cls) Requires: python3-pyglet
%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}
# This can be removed when F38 reaches EOL Recommends: python3-scipy
Obsoletes: sympy-texmacs < 1.8 Recommends: python3-theano
%description -n python3-%{name} %description -n python3-%{name}
SymPy aims to become a full-featured computer algebra system (CAS) SymPy aims to become a full-featured computer algebra system (CAS)
@ -106,297 +85,191 @@ while keeping the code as simple as possible in order to be
comprehensible and easily extensible. SymPy is written entirely in comprehensible and easily extensible. SymPy is written entirely in
Python and does not require any external libraries. 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 %package examples
License: BSD-3-Clause
Summary: Sympy examples Summary: Sympy examples
Requires: python3-%{name} = %{version}-%{release} Requires: %{name} = %{version}-%{release}
# once rich dependencies are allowed, add "or python3-sympy = %%{version}-%%{release}"
%description examples %description examples
This package contains example input for sympy. This package contains example input for sympy.
%package doc %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 Summary: Documentation for sympy
Provides: bundled(js-jquery) Requires: %{name} = %{version}-%{release}
Provides: bundled(js-underscore) Provides: bundled(jquery)
%description doc %description doc
HTML documentation for sympy. HTML documentation for sympy.
%prep %global sympydir %{name}-%{name}-%{version}
%autosetup -p1 -n %{name}-%{name}-%{version}
fixtimestamp() { %prep
touch -r $1.orig $1 %setup -q -c
rm -f $1.orig %patch0
} %patch1
%patch2
%patch3
%patch4
# 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' \
%{sympydir}/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' %{sympydir}/sympy/external/importtools.py
# Make a copy for building the python3 version
cp -a %{sympydir} python3
# Do not depend on env # Do not depend on env
for fil in $(grep -rl "^#\![[:blank:]]*%{_bindir}/env" .); do for fil in $(grep -rl "^#\![[:blank:]]*%{_bindir}/env" %{sympydir}); do
sed -i.orig 's,^\(#\![[:blank:]]*%{_bindir}/\)env python,\1python2,' $fil
touch -r $fil.orig $fil
rm -f $fil.orig
done
for fil in $(grep -rl "^#\![[:blank:]]*%{_bindir}/env" python3); do
sed -i.orig 's,^\(#\![[:blank:]]*%{_bindir}/\)env python,\1python3,' $fil sed -i.orig 's,^\(#\![[:blank:]]*%{_bindir}/\)env python,\1python3,' $fil
fixtimestamp $fil touch -r $fil.orig $fil
rm -f $fil.orig
done 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 %build
%ifarch %{java_arches} # Build the python2 version
# Regenerate the ANTLR files pushd %{sympydir}
%{python3} setup.py antlr %py2_build
%endif popd
# Build # Build the python3 version
%pyproject_wheel pushd python3
%py3_build
popd
# Build the documentation # Build the documentation
pushd doc pushd %{sympydir}/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
pushd python3/doc
make cheatsheet make cheatsheet
popd popd
%install %install
%pyproject_install # Install the python3 version
%pyproject_save_files isympy sympy pushd python3
%py3_install
mv %{buildroot}%{_bindir}/isympy %{buildroot}%{_bindir}/python3-isympy
mv %{buildroot}%{_mandir}/man1/isympy.1 \
%{buildroot}%{_mandir}/man1/python3-isympy.1
popd
# Install the python2 version
pushd %{sympydir}
%py2_install
popd
## Remove extra files ## Remove extra files
rm -f %{buildroot}%{_bindir}/{,doc}test rm -f %{buildroot}%{_bindir}/{,doc}test
## Install the TeXmacs integration
pushd %{sympydir}
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 # Don't let an executable script go into the documentation
chmod -R a-x+X examples chmod -R a-x+X examples
# Fix permissions # Convert the README to HTML
chmod 0755 %{buildroot}%{python3_sitelib}/sympy/benchmarks/bench_symbench.py \ rst2html --no-datestamp README.rst README.html
%{buildroot}%{python3_sitelib}/sympy/testing/tests/diagnose_imports.py
# Install the HTML documentation # Install the HTML documentation
mkdir -p %{buildroot}%{_docdir}/%{name}-doc mkdir -p %{buildroot}%{_docdir}/%{name}-doc
cp -a doc/_build/html %{buildroot}%{_docdir}/%{name}-doc cp -a doc/_build/html %{buildroot}%{_docdir}/%{name}-doc
rm -f %{buildroot}%{_docdir}/%{name}-doc/html/.buildinfo rm -f %{buildroot}%{_docdir}/%{name}-doc/html/.buildinfo
rm -fr %{buildroot}%{_docdir}/%{name}-doc/i18n rm -fr %{buildroot}%{_docdir}/%{name}-doc/i18n
popd
# Try to get rid of pyc files, which aren't useful for documentation # Try to get rid of pyc files, which aren't useful for documentation
find examples/ -name '*.py[co]' -print -delete find %{sympydir}/examples/ -name '*.py[co]' -print -delete
# Fix some executable bits
chmod a+x \
%{buildroot}%{python2_sitelib}/sympy/benchmarks/bench_symbench.py \
%{buildroot}%{python2_sitelib}/sympy/physics/mechanics/models.py \
%{buildroot}%{python2_sitelib}/sympy/utilities/tests/diagnose_imports.py \
%{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 %check
# Many tests assume they are running on an x86_64 machine. Some assume that let "dnum = $RANDOM % 90 + 10"
# native 64-bit integers are available. Some assume that 80-bit floating point # Split into many small chunks to reduce waiting in the end-game
# numbers are available. Some assume that certain operations always produce jobs=%{?_smp_mflags}; jobs=${jobs#-j}; jobs=$((jobs * 3))
# 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 \ pushd %{sympydir}
parallel %{?_smp_mflags} \ xvfb-run -a -n $dnum \
%{python3} bin/test -v --split {}/$jobs \ parallel %{?_smp_mflags} \
::: $(bash -c "echo {1..$jobs}") %{__python2} bin/test -v --split {}/$jobs \
fi ::: $(bash -c "echo {1..$jobs}")
popd
%files -n python3-%{name} -f %{pyproject_files} pushd python3
%doc AUTHORS README.md xvfb-run -a -n $dnum \
%doc doc/_build/cheatsheet/cheatsheet.pdf parallel %{?_smp_mflags} \
%doc doc/_build/cheatsheet/combinatoric_cheatsheet.pdf %{__python3} bin/test -v --split {}/$jobs \
::: $(bash -c "echo {1..$jobs}")
popd
%files -n python2-%{name}
%doc %{sympydir}/AUTHORS %{sympydir}/CODE_OF_CONDUCT.md %{sympydir}/README.html
%doc %{sympydir}/doc/_build/cheatsheet/combinatoric_cheatsheet.pdf
%license %{sympydir}/LICENSE
%{python2_sitelib}/isympy.*
%{python2_sitelib}/sympy/
%{python2_sitelib}/sympy-%{version}-*.egg-info
%{_bindir}/isympy %{_bindir}/isympy
%{_mandir}/man1/isympy.1* %{_mandir}/man1/isympy.1*
%files -n python3-%{name}
%doc python3/AUTHORS python3/CODE_OF_CONDUCT.md %{sympydir}/README.html
%doc python3/doc/_build/cheatsheet/combinatoric_cheatsheet.pdf
%license python3/LICENSE
%{python3_sitelib}/isympy.*
%{python3_sitelib}/__pycache__/isympy.*
%{python3_sitelib}/sympy/
%{python3_sitelib}/sympy-%{version}-*.egg-info
%{_bindir}/python3-isympy
%{_mandir}/man1/python3-isympy.1*
%files texmacs
%license %{sympydir}/data/TeXmacs/LICENSE
%{_bindir}/tm_sympy
%{_datadir}/TeXmacs/plugins/sympy/
%files examples %files examples
%doc examples/* %doc %{sympydir}/examples/*
%files doc %files doc
%docdir %{_docdir}/%{name}-doc/html %docdir %{_docdir}/%{name}-doc/html
%{_docdir}/%{name}-doc/html %{_docdir}/%{name}-doc/html
%changelog %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
* Sun Feb 03 2019 Fedora Release Engineering <releng@fedoraproject.org> - 1.3-3
- Rebuilt for https://fedoraproject.org/wiki/Fedora_30_Mass_Rebuild
* Wed Jan 30 2019 Jerry James <loganjerry@gmail.com> - 1.3-2
- Add -sympify and -factorial patches to work around test failures
* Mon Jan 14 2019 Jerry James <loganjerry@gmail.com> - 1.3-2
- Drop Requires from the -doc subpackage (bz 1665767)
* Sat Oct 6 2018 Jerry James <loganjerry@gmail.com> - 1.3-1
- Update to 1.3
- Drop upstreamed patches: subexpr-lambdify, test-code-quality, tex-encoding
- Drop the python2 subpackage
- Add -python3 patch to ask cython to generate python 3 code
* Tue Aug 14 2018 Miro Hrončok <mhroncok@redhat.com> - 1.2-2 * Tue Aug 14 2018 Miro Hrončok <mhroncok@redhat.com> - 1.2-2
- Fix _subexpr method in lambdify - Fix _subexpr method in lambdify