Update to 1.3.

Also:
- 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.
This commit is contained in:
Jerry James 2018-10-13 13:34:09 -06:00
parent 5125b8335b
commit cbc69b9ce4
8 changed files with 110 additions and 223 deletions

View File

@ -1 +1 @@
SHA512 (sympy-1.2.tar.gz) = e9b1089d6bc897436b1888d1a21324b5086c19cbf7d857514688e25b1a3c7fcf7c36a2ae9a7121d88acf73b6cb66e97c5591fe3e575089b41138a21086286328
SHA512 (sympy-1.3.tar.gz) = 153af141b2fa30a9fcea94630bfe985cda279380f789be745c29f23be253bcff1a40a9eacf8c81621b2eed05d4d32d1918e5a00563fcabe4b354ec15a7e1d0fa

View File

@ -1,15 +1,6 @@
--- 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
--- sympy-sympy-1.3/README.rst.orig 2018-09-14 12:51:02.000000000 -0600
+++ sympy-sympy-1.3/README.rst 2018-10-07 09:34:14.231369432 -0600
@@ -240,7 +240,7 @@ To cite SymPy in publications use
A BibTeX entry for LaTeX users is

View File

@ -1,6 +1,6 @@
--- 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():
--- sympy-sympy-1.3/sympy/core/tests/test_sympify.py.orig 2018-09-14 12:51:02.000000000 -0600
+++ sympy-sympy-1.3/sympy/core/tests/test_sympify.py 2018-10-07 09:57:01.908641658 -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))
@ -9,7 +9,7 @@
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():
@@ -602,12 +600,6 @@ def test_sympify_numpy():
except AttributeError: #float96 does not exist on all platforms
pass

51
sympy-python3.patch Normal file
View File

@ -0,0 +1,51 @@
--- sympy-sympy-1.3/sympy/utilities/autowrap.py.orig 2018-09-14 12:51:02.000000000 -0600
+++ sympy-sympy-1.3/sympy/utilities/autowrap.py 2018-10-07 20:17:40.375409612 -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.3/sympy/utilities/_compilation/compilation.py.orig 2018-09-14 12:51:02.000000000 -0600
+++ sympy-sympy-1.3/sympy/utilities/_compilation/compilation.py 2018-10-07 20:16:40.951549612 -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.3/sympy/utilities/tests/test_autowrap.py.orig 2018-09-14 12:51:02.000000000 -0600
+++ sympy-sympy-1.3/sympy/utilities/tests/test_autowrap.py 2018-10-07 21:25:06.458000421 -0600
@@ -104,6 +104,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'],
@@ -141,6 +143,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'],
@@ -167,6 +171,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(

View File

@ -1,52 +0,0 @@
--- 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

@ -1,11 +0,0 @@
--- 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:

View File

@ -1,20 +0,0 @@
--- 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,41 +1,38 @@
Name: sympy
Version: 1.2
Release: 2%{?dist}
Version: 1.3
Release: 1%{?dist}
Summary: A Python library for symbolic mathematics
License: BSD
URL: http://sympy.org/
Source0: https://github.com/%{name}/%{name}/archive/%{name}-%{version}.tar.gz
# Remove tests that fail on non-x86 architectures
Patch0: %{name}-float.patch
# The code quality tester bogusly fails on a comment
Patch1: %{name}-test-code-quality.patch
# Fix a couple of documentation typos
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
Patch1: %{name}-doc.patch
# Default to python3 in the Cython backend
Patch2: %{name}-python3.patch
BuildArch: noarch
BuildRequires: gcc
BuildRequires: gcc-c++
BuildRequires: gcc-gfortran
BuildRequires: gettext
BuildRequires: graphviz
BuildRequires: ImageMagick
BuildRequires: librsvg2-tools
BuildRequires: python2-Cython python3-Cython
BuildRequires: python2-devel python3-devel
BuildRequires: python3-docutils
BuildRequires: python2-fastcache python3-fastcache
BuildRequires: python2-gmpy2 python3-gmpy2
BuildRequires: python2-matplotlib python3-matplotlib
BuildRequires: python2-mpmath python3-mpmath
BuildRequires: python2-numpy python3-numpy
BuildRequires: python2-numpy-f2py python3-numpy-f2py
BuildRequires: python2-scipy python3-scipy
BuildRequires: python3-sphinx
BuildRequires: python2-theano python3-theano
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
BuildRequires: xorg-x11-fonts-Type1
@ -50,34 +47,22 @@ Python and does not require any external libraries.
%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}
Summary: A Python3 library for symbolic mathematics
Requires: mesa-libGLU
Requires: python3-fastcache
Requires: python3-gmpy2
Requires: python3-matplotlib
Requires: python3-mpmath
Requires: python3-pyglet
Requires: python3dist(cython)
Requires: python3dist(fastcache)
Requires: python3dist(gmpy2)
Requires: python3dist(matplotlib)
Requires: python3dist(mpmath)
Requires: python3dist(pyglet)
Recommends: python3-scipy
Recommends: python3-theano
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)
@ -95,8 +80,7 @@ This package contains a TeXmacs plugin for sympy.
%package examples
Summary: Sympy examples
Requires: %{name} = %{version}-%{release}
# once rich dependencies are allowed, add "or python3-sympy = %%{version}-%%{release}"
Requires: python3-%{name} = %{version}-%{release}
%description examples
This package contains example input for sympy.
@ -109,81 +93,42 @@ Provides: bundled(jquery)
%description doc
HTML documentation for sympy.
%global sympydir %{name}-%{name}-%{version}
%prep
%setup -q -c
%patch0
%patch1
%patch2
%patch3
%patch4
%autosetup -p1 -n %{name}-%{name}-%{version}
# 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
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' %{sympydir}/sympy/external/importtools.py
# Make a copy for building the python3 version
cp -a %{sympydir} python3
sed -i 's/StrictVersion/LooseVersion/g' sympy/external/importtools.py
# Do not depend on env
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
for fil in $(grep -rl "^#\![[:blank:]]*%{_bindir}/env" .); do
sed -i.orig 's,^\(#\![[:blank:]]*%{_bindir}/\)env python,\1python3,' $fil
touch -r $fil.orig $fil
rm -f $fil.orig
done
%build
# Build the python2 version
pushd %{sympydir}
%py2_build
popd
# Build the python3 version
pushd python3
%py3_build
popd
# Build the documentation
pushd %{sympydir}/doc
pushd doc
sed -i 's/sphinx-build/&-%{python3_version}/' Makefile
make html SPHINXOPTS=%{?_smp_mflags} PYTHON=%{__python3}
make cheatsheet
popd
pushd python3/doc
make cheatsheet
popd
%install
# Install the python3 version
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
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
@ -203,16 +148,12 @@ 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
popd
# Try to get rid of pyc files, which aren't useful for documentation
find %{sympydir}/examples/ -name '*.py[co]' -print -delete
find 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
@ -222,54 +163,41 @@ 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))
pushd %{sympydir}
xvfb-run -a -n $dnum \
parallel %{?_smp_mflags} \
%{__python2} bin/test -v --split {}/$jobs \
::: $(bash -c "echo {1..$jobs}")
popd
pushd python3
xvfb-run -a -n $dnum \
parallel %{?_smp_mflags} \
%{__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
%{_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
%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}/python3-isympy
%{_mandir}/man1/python3-isympy.1*
%{_bindir}/isympy
%{_mandir}/man1/isympy.1*
%files texmacs
%license %{sympydir}/data/TeXmacs/LICENSE
%license data/TeXmacs/LICENSE
%{_bindir}/tm_sympy
%{_datadir}/TeXmacs/plugins/sympy/
%files examples
%doc %{sympydir}/examples/*
%doc examples/*
%files doc
%docdir %{_docdir}/%{name}-doc/html
%{_docdir}/%{name}-doc/html
%changelog
* 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
- Fix _subexpr method in lambdify