From cd938da9543d028dc8b61b78eb983b88b1a73434 Mon Sep 17 00:00:00 2001 From: Jakub Bogusz Date: Sat, 14 Sep 2019 06:10:40 +0200 Subject: [PATCH] - updated to 1.4 - removed obsolete docs-build patch - added nodisplay patch (blacklist tests requiring DISPLAY when it's missing) --- docs-build.patch | 32 -------------- python-sympy-nodisplay.patch | 24 ++++++++++ python-sympy.spec | 85 ++++++++++++++++++++++++++---------- 3 files changed, 87 insertions(+), 54 deletions(-) delete mode 100644 docs-build.patch create mode 100644 python-sympy-nodisplay.patch diff --git a/docs-build.patch b/docs-build.patch deleted file mode 100644 index f9e3a92..0000000 --- a/docs-build.patch +++ /dev/null @@ -1,32 +0,0 @@ ---- sympy-1.0/doc/Makefile~ 2016-03-08 19:38:39.000000000 +0100 -+++ sympy-1.0/doc/Makefile 2016-05-10 08:10:27.649406764 +0200 -@@ -117,7 +117,7 @@ - pdflatex -output-directory=_build/cheatsheet cheatsheet/cheatsheet.tex - pdflatex -output-directory=_build/cheatsheet cheatsheet/cheatsheet.tex - --_build/cheatsheet/cheatsheet.pdf: cheatsheet/combinatoric_cheatsheet.tex -+_build/cheatsheet/combinatoric_cheatsheet.pdf: cheatsheet/combinatoric_cheatsheet.tex - mkdir -p _build/cheatsheet - pdflatex -output-directory=_build/cheatsheet cheatsheet/combinatoric_cheatsheet.tex - pdflatex -output-directory=_build/cheatsheet cheatsheet/combinatoric_cheatsheet.tex -diff -ur sympy-1.1.1.org/doc/api/conf.py sympy-1.1.1/doc/api/conf.py ---- sympy-1.1.1.org/doc/api/conf.py 2017-07-22 00:17:42.000000000 +0200 -+++ sympy-1.1.1/doc/api/conf.py 2018-07-04 21:04:02.333475214 +0200 -@@ -131,4 +131,4 @@ - #latex_appendices = [] - - # If false, no module index is generated. --#latex_use_modindex = True -+#latex_domain_indices = True -diff -ur sympy-1.1.1.org/doc/src/conf.py sympy-1.1.1/doc/src/conf.py ---- sympy-1.1.1.org/doc/src/conf.py 2017-07-27 00:46:51.000000000 +0200 -+++ sympy-1.1.1/doc/src/conf.py 2018-07-04 21:03:49.133014108 +0200 -@@ -178,7 +178,7 @@ - latex_show_pagerefs = True - - # We use False otherwise the module index gets generated twice. --latex_use_modindex = False -+latex_domain_indices = False - - default_role = 'math' - pngmath_divpng_args = ['-gamma 1.5', '-D 110'] diff --git a/python-sympy-nodisplay.patch b/python-sympy-nodisplay.patch new file mode 100644 index 0000000..4c7324b --- /dev/null +++ b/python-sympy-nodisplay.patch @@ -0,0 +1,24 @@ +--- sympy-1.4/sympy/utilities/runtests.py.orig 2019-04-10 02:31:59.000000000 +0200 ++++ sympy-1.4/sympy/utilities/runtests.py 2019-09-13 16:13:57.588571573 +0200 +@@ -521,7 +521,9 @@ + split = kwargs.get('split', None) + time_balance = kwargs.get('time_balance', True) + blacklist = kwargs.get('blacklist', ['sympy/integrals/rubi/rubi_tests/tests']) +- if ON_TRAVIS: ++ if ON_TRAVIS or os.getenv('DISPLAY', '') == '': + # pyglet does not work on Travis ++ blacklist.extend('sympy/categories/tests/test_drawing.py') ++ blacklist.extend('sympy/printing/tests/test_preview.py') + blacklist.extend('sympy/plotting/pygletplot/tests') + blacklist = convert_to_native_paths(blacklist) +@@ -698,7 +698,9 @@ + import matplotlib + matplotlib.use('Agg') + +- if ON_TRAVIS or import_module('pyglet') is None: ++ if ON_TRAVIS or os.getenv('DISPLAY', '') == '' or import_module('pyglet') is None: ++ blacklist.extend(["sympy/categories/diagram_drawing.py"]) ++ blacklist.extend(["sympy/printing/preview.py"]) + blacklist.extend(["sympy/plotting/pygletplot"]) + + if import_module('theano') is None: diff --git a/python-sympy.spec b/python-sympy.spec index de6ef49..d5aec65 100644 --- a/python-sympy.spec +++ b/python-sympy.spec @@ -1,41 +1,53 @@ # # Conditional build: -%bcond_without tests # do not perform "make test" +%bcond_without doc # HTML and PDF documentation +%bcond_without tests # unit tests %bcond_without python2 # CPython 2.x module %bcond_without python3 # CPython 3.x module -Summary: A Python library for symbolic mathematics +Summary: Python 2 library for symbolic mathematics +Summary(pl.UTF-8): Biblioteka Pythona 2 do matematyki symbolicznej Name: python-sympy -Version: 1.1.1 +Version: 1.4 Release: 1 License: BSD Group: Libraries/Python +#Source0Download: https://github.com/sympy/sympy/releases Source0: https://github.com/sympy/sympy/releases/download/sympy-%{version}/sympy-%{version}.tar.gz -# Source0-md5: c410a9c2346878716d16ec873d72e72a -Patch0: docs-build.patch -URL: http://sympy.org/ -BuildRequires: rpmbuild(macros) >= 1.710 +# Source0-md5: 478072d75b564c9356990e3027d464e6 +Patch0: %{name}-nodisplay.patch +URL: https://www.sympy.org/ BuildRequires: gettext BuildRequires: graphviz +BuildRequires: rpmbuild(macros) >= 1.714 +BuildRequires: sed >= 4.0 %if %{with python2} -BuildRequires: python-Sphinx -BuildRequires: python-devel -BuildRequires: python-mpmath +BuildRequires: python-devel >= 1:2.7 +BuildRequires: python-setuptools +%if %{with tests} +BuildRequires: python-devel-tools +BuildRequires: python-mpmath >= 0.19 BuildRequires: python-numpy %endif +%endif %if %{with python3} -BuildRequires: python3-Sphinx -BuildRequires: python3-devel +BuildRequires: python3-devel >= 1:3.4 +BuildRequires: python3-setuptools +%if %{with tests} BuildRequires: python3-devel-tools -BuildRequires: python3-mpmath +BuildRequires: python3-mpmath >= 0.19 BuildRequires: python3-numpy %endif +%endif +%if %{with doc} BuildRequires: pydoc3 BuildRequires: sphinx-pdg BuildRequires: texlive-format-pdflatex BuildRequires: texlive-latex BuildRequires: texlive-latex-pgf +%endif Requires: python-matplotlib +Requires: python-modules >= 1:2.7 Requires: python-mpmath Requires: python-pyglet BuildArch: noarch @@ -47,10 +59,18 @@ 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. +%description -l pl.UTF-8 +SymPy ma być w pełni funkcjonalnym systemem algebry komputerowej +(CAS), a jednocześnie mieć jak najprostszy, czytelny i łatwo +rozszerzalny kod. Jest pisany całkowicie w Pythonie i nie wymaga +żadnych zewnętrznych bibliotek. + %package -n python3-sympy -Summary: A Python3 library for symbolic mathematics +Summary: Python 3 library for symbolic mathematics +Summary(pl.UTF-8): Biblioteka Pythona 3 do matematyki symbolicznej Group: Libraries/Python Requires: python3-matplotlib +Requires: python3-modules >= 1:3.4 Requires: python3-mpmath Requires: python3-pyglet @@ -60,13 +80,22 @@ 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. +%description -n python3-sympy -l pl.UTF-8 +SymPy ma być w pełni funkcjonalnym systemem algebry komputerowej +(CAS), a jednocześnie mieć jak najprostszy, czytelny i łatwo +rozszerzalny kod. Jest pisany całkowicie w Pythonie i nie wymaga +żadnych zewnętrznych bibliotek. + %package doc -Summary: Documentation for sympy -Group: Libraries/Python -Requires: %{name} = %{version}-%{release} +Summary: Documentation for SymPy module +Summary(pl.UTF-8): Dokumentacja do SymPy +Group: Documentation %description doc -HTML documentation for sympy. +HTML documentation for SymPy. + +%description doc -l pl.UTF-8 +Dokumentacja do SymPy w formacie HTML. %prep %setup -q -n sympy-%{version} @@ -81,10 +110,11 @@ HTML documentation for sympy. %py3_build %{?with_tests:test} %endif -# Build the documentation +%if %{with doc} cd doc %{__make} html %{__make} cheatsheet +%endif %install rm -rf $RPM_BUILD_ROOT @@ -107,28 +137,39 @@ find $RPM_BUILD_ROOT%{_examplesdir}/python3-sympy-%{version} -name '*.py' \ install -d $RPM_BUILD_ROOT%{_examplesdir}/%{name}-%{version} cp -a examples/* $RPM_BUILD_ROOT%{_examplesdir}/%{name}-%{version} +find $RPM_BUILD_ROOT%{_examplesdir}/%{name}-%{version} -name '*.py' \ + | xargs sed -i '1s|^#!.*python\b|#!%{__python}|' %endif %clean rm -rf $RPM_BUILD_ROOT +%if %{with python2} %files %defattr(644,root,root,755) -%doc AUTHORS LICENSE PKG-INFO doc/_build/cheatsheet/cheatsheet.pdf +%doc AUTHORS LICENSE README.rst %attr(755,root,root) %{_bindir}/isympy +%{py_sitescriptdir}/isympy.py[co] %{py_sitescriptdir}/sympy %{py_sitescriptdir}/sympy-%{version}-*.egg-info %{_mandir}/man1/isympy.1* %{_examplesdir}/%{name}-%{version} +%endif +%if %{with python3} %files -n python3-sympy %defattr(644,root,root,755) -%doc AUTHORS LICENSE PKG-INFO doc/_build/cheatsheet/cheatsheet.pdf +%doc AUTHORS LICENSE README.rst %attr(755,root,root) %{_bindir}/isympy3 +%{py3_sitescriptdir}/isympy.py +%{py3_sitescriptdir}/__pycache__/isympy.cpython-*.py[co] %{py3_sitescriptdir}/sympy %{py3_sitescriptdir}/sympy-%{version}-*.egg-info %{_examplesdir}/python3-sympy-%{version} +%endif +%if %{with doc} %files doc %defattr(644,root,root,755) -%doc doc/_build/html/* +%doc doc/_build/html/* doc/_build/cheatsheet/cheatsheet.pdf +%endif -- 2.44.0