From 3018ce1e1bb6d19c23d29e74e5cc25f40728b883 Mon Sep 17 00:00:00 2001 From: Jerry James Date: Thu, 17 Mar 2022 15:51:37 -0600 Subject: [PATCH] Version 1.10. Drop upstreamed patches: -python3, -png-decoder, -gmpy2-mpq, and -rational-exponent. --- sources | 2 +- sympy-gmpy2-mpq.patch | 11 -------- sympy-png-decoder.patch | 22 --------------- sympy-python3.patch | 51 ----------------------------------- sympy-rational-exponent.patch | 14 ---------- sympy.rpmlintrc | 12 --------- sympy.spec | 38 +++++++++++++------------- 7 files changed, 20 insertions(+), 130 deletions(-) delete mode 100644 sympy-gmpy2-mpq.patch delete mode 100644 sympy-png-decoder.patch delete mode 100644 sympy-python3.patch delete mode 100644 sympy-rational-exponent.patch delete mode 100644 sympy.rpmlintrc diff --git a/sources b/sources index ca737ae..81c9459 100644 --- a/sources +++ b/sources @@ -1 +1 @@ -SHA512 (sympy-1.9.tar.gz) = 139712219ba6bf420ba89b3f8d086ab8883c5ab965e9308ba9ee665ac3ac69a9b16fa30c6f5dfbc77dd34873ff3ff95c0d058954d7f9d853f5e9537efc24dd3c +SHA512 (sympy-1.10.tar.gz) = 0107c68b38809fbcec597339447fa830a9cb3c55863799c41dfb5d122ac7564fdf7c685fe2eedaaa3b8d5c9160b196ef2484fff4c7e99aa17a5a562f3fb73be5 diff --git a/sympy-gmpy2-mpq.patch b/sympy-gmpy2-mpq.patch deleted file mode 100644 index b7e6b05..0000000 --- a/sympy-gmpy2-mpq.patch +++ /dev/null @@ -1,11 +0,0 @@ ---- a/sympy/external/tests/test_pythonmpq.py 2021-09-30 16:23:28.000000000 -0600 -+++ b/sympy/external/tests/test_pythonmpq.py 2021-10-08 11:06:59.453830335 -0600 -@@ -42,7 +42,7 @@ def test_PythonMPQ(): - assert check_Q(Q(Q(3, 5))) == (3, 5) - assert check_Q(Q(0.5)) == (1, 2) - assert check_Q(Q('0.5')) == (1, 2) -- assert check_Q(Q(Decimal('0.6'))) == (3, 5) -+ assert check_Q(Q(str(Decimal('0.6')))) == (3, 5) - assert check_Q(Q(Fraction(3, 5))) == (3, 5) - - # Invalid types diff --git a/sympy-png-decoder.patch b/sympy-png-decoder.patch deleted file mode 100644 index 5e365d4..0000000 --- a/sympy-png-decoder.patch +++ /dev/null @@ -1,22 +0,0 @@ -diff --git a/sympy/printing/preview.py b/sympy/printing/preview.py -index 52085e5e19..f9b1d2dd5c 100644 ---- a/sympy/printing/preview.py -+++ b/sympy/printing/preview.py -@@ -27,12 +27,12 @@ def _check_output_no_window(*args, **kwargs): - def _run_pyglet(fname, fmt): - from pyglet import window, image, gl - from pyglet.window import key -+ from pyglet.image.codecs import ImageDecodeException - -- if fmt == "png": -- from pyglet.image.codecs.png import PNGImageDecoder -- img = image.load(fname, decoder=PNGImageDecoder()) -- else: -- raise ValueError("pyglet preview works only for 'png' files.") -+ try: -+ img = image.load(fname) -+ except ImageDecodeException: -+ raise ValueError("pyglet preview does not work for '{}' files.".format(fmt)) - - offset = 25 - diff --git a/sympy-python3.patch b/sympy-python3.patch deleted file mode 100644 index 1eb35ff..0000000 --- a/sympy-python3.patch +++ /dev/null @@ -1,51 +0,0 @@ ---- 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 -@@ -229,6 +229,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 -@@ -291,6 +291,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( diff --git a/sympy-rational-exponent.patch b/sympy-rational-exponent.patch deleted file mode 100644 index 74a49a0..0000000 --- a/sympy-rational-exponent.patch +++ /dev/null @@ -1,14 +0,0 @@ ---- a/sympy/polys/ring_series.py 2021-09-30 16:23:28.000000000 -0600 -+++ b/sympy/polys/ring_series.py 2021-10-08 13:43:30.746068783 -0600 -@@ -989,6 +989,11 @@ def rs_nth_root(p, n, x, prec): - except ValueError: # as exponent - raise DomainError("The given series can't be expanded in " - "this domain.") -+ except TypeError: -+ try: -+ const = R(c**QQ(1, n)) -+ except ValueError: -+ raise DomainError("The given series can't be expanded in this domain.") - res = rs_nth_root(p/c, n, x, prec)*const - else: - res = _nth_root1(p, n, x, prec) diff --git a/sympy.rpmlintrc b/sympy.rpmlintrc deleted file mode 100644 index e01a271..0000000 --- a/sympy.rpmlintrc +++ /dev/null @@ -1,12 +0,0 @@ -# THIS FILE IS FOR WHITELISTING RPMLINT ERRORS AND WARNINGS IN TASKOTRON -# https://fedoraproject.org/wiki/Taskotron/Tasks/dist.rpmlint#Whitelisting_errors - -# This file is empty on purpose -addFilter(r'E: zero-length .*sympy/strategies/tests/test_strat\.py') - -# There really is no documentation for the TeXmacs plugin -addFilter(r'sympy-texmacs\.noarch: W: no-documentation') -addFilter(r'sympy-texmacs\.noarch: W: no-manual-page-for-binary tm_sympy') - -# We use the versions of jquery and js-underscore that sphinx gives us -addFilter(r'W: unversioned-explicit-provides bundled\((jquery|js-underscore)\)') diff --git a/sympy.spec b/sympy.spec index e0852d7..0a534dc 100644 --- a/sympy.spec +++ b/sympy.spec @@ -3,27 +3,18 @@ # use it instead. Name: sympy -Version: 1.9 -Release: 2%{?dist} +Version: 1.10 +Release: 1%{?dist} Summary: A Python library for symbolic mathematics License: BSD URL: https://sympy.org/ Source0: https://github.com/%{name}/%{name}/archive/%{name}-%{version}.tar.gz # Skip tests that require a display Patch0: %{name}-circuitplot.patch -# Default to python3 in the Cython backend -Patch1: %{name}-python3.patch -# Work around Fedora pyglet not including PNGImageDecoder -# https://github.com/sympy/sympy/pull/20600 -Patch2: %{name}-png-decoder.patch # Account for possible rounding error in some physics tests -Patch3: %{name}-tests.patch +Patch1: %{name}-tests.patch # Don't let deprecation warnings from distutils cause test failures -Patch4: %{name}-distutils.patch -# gmpy2 2.1.0 no longer converts Decimal directly to mpq -Patch5: %{name}-gmpy2-mpq.patch -# gmpy2 2.1.0 no longer accepts Rational as an exponent -Patch6: %{name}-rational-exponent.patch +Patch2: %{name}-distutils.patch BuildArch: noarch @@ -43,9 +34,11 @@ BuildRequires: %{py3_dist fastcache} BuildRequires: %{py3_dist gmpy2} BuildRequires: %{py3_dist matplotlib} BuildRequires: %{py3_dist mpmath} +BuildRequires: %{py3_dist myst-parser} BuildRequires: %{py3_dist numexpr} BuildRequires: %{py3_dist numpy} BuildRequires: python3-numpy-f2py +BuildRequires: %{py3_dist numpydoc} BuildRequires: %{py3_dist pip} BuildRequires: %{py3_dist scipy} BuildRequires: %{py3_dist setuptools} @@ -118,6 +111,12 @@ for fil in $(grep -rl "^#\![[:blank:]]*%{_bindir}/env" .); do rm -f $fil.orig done +# Fedora does not have this Sphinx extension +sed -i "s/ 'sphinx_reredirects',//" doc/src/conf.py + +# Fedora does not have linkify +sed -i 's/, "linkify"//' doc/src/conf.py + %build %pyproject_wheel @@ -129,6 +128,7 @@ popd %install %pyproject_install +%pyproject_save_files isympy sympy ## Remove extra files rm -f %{buildroot}%{_bindir}/{,doc}test @@ -163,14 +163,9 @@ if [ "$(uname -p)" = "x86_64" ]; then ::: $(bash -c "echo {1..$jobs}") fi -%files -n python3-%{name} +%files -n python3-%{name} -f %{pyproject_files} %doc AUTHORS README.md %doc doc/_build/cheatsheet/combinatoric_cheatsheet.pdf -%license LICENSE -%{python3_sitelib}/isympy.* -%{python3_sitelib}/__pycache__/isympy.* -%{python3_sitelib}/sympy/ -%{python3_sitelib}/sympy-%{version}.dist-info %{_bindir}/isympy %{_mandir}/man1/isympy.1* @@ -182,6 +177,11 @@ fi %{_docdir}/%{name}-doc/html %changelog +* Thu Mar 17 2022 Jerry James - 1.10-1 +- Version 1.10 +- Drop upstreamed patches: -python3, -png-decoder, -gmpy2-mpq, + and -rational-exponent + * Sat Jan 22 2022 Fedora Release Engineering - 1.9-2 - Rebuilt for https://fedoraproject.org/wiki/Fedora_36_Mass_Rebuild