%define module sympy # Disable for now: https://github.com/sympy/sympy/issues/24306 %define check_tests 0 %define docu 0 Summary: Python library for symbolic mathematics Name: python-%{module} Version: 1.11.1 Release: %mkrel 2 License: BSD Group: Development/Python Url: https://www.sympy.org/ Source0: https://github.com/%{module}/%{module}/releases/download/%{module}-%{version}/%{module}-%{version}.tar.gz BuildArch: noarch BuildRequires: pyproject-rpm-macros BuildRequires: graphviz # For docs %if %docu BuildRequires: python3-sphinx BuildRequires: python3-matplotlib BuildRequires: python3-sphinx-math-dollar BuildRequires: librsvg BuildRequires: imagemagick BuildRequires: texlive-dist %endif # for tests BuildRequires: x11-font-type1 BuildRequires: x11-server-xvfb BuildRequires: locales-en %description 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 and does not require any external libraries, except optionally for plotting support. %package texmacs Summary: TeXmacs integration for sympy Group: Development/Python Requires: %{name} = %{version}-%{release} Requires: texmacs %description texmacs This package contains a TeXmacs plugin for sympy. %package examples Summary: Sympy examples Group: Development/Python Requires: %{name} = %{version}-%{release} %description examples This package contains example input for sympy. %if %docu %package doc Summary: Documentation for sympy Group: Development/Python %description doc man and HTML documentation for sympy. %endif %package -n python3-%{module} Summary: Python 3 library for symbolic mathematics Group: Development/Python BuildRequires: python3-devel BuildRequires: python3-mpmath Requires: python3-numpy Requires: python3-mpmath Requires: python3-matplotlib Requires: python3-pyglet %{?python_provide:%python_provide python3-%{module}} %description -n python3-%{module} SymPy is a Python 3 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 3 and does not require any external libraries, except optionally for plotting support. %prep %setup -q -n sympy-%{version} %autopatch -p1 # Do not depend on env for fil in $(grep -rl "^#\![[:blank:]]*%{_bindir}/env" .); do %py3_shebang_fix $fil done %build %pyproject_wheel # Build the documentation %if %docu pushd doc make html SPHINXOPTS=%{?_smp_mflags} PYTHON=%{python3} make cheatsheet popd # leftovers rm -rf doc/_build/html/.buildinfo %endif %install %pyproject_install %pyproject_save_files sympy isympy # Remove extra files rm -f %{buildroot}%{_bindir}/{,doc}test # Install the TeXmacs integration cp -p data/TeXmacs/bin/tm_sympy %{buildroot}%{_bindir} # Don't let an executable script go into the documentation chmod a-x examples/all.py %if %docu # Install the HTML documentation mkdir -p %{buildroot}%{_docdir}/%{name}-doc cp -a doc/_build/html %{buildroot}%{_docdir}/%{name}-doc rm -fr %{buildroot}%{_docdir}/%{name}-doc/i18n %endif %if 0%check_tests %check # The python3 tests fail with Unicode errors without this export LC_ALL=en_US.UTF-8 let "dnum = $RANDOM % 90 + 10" xvfb-run -n $dnum python3 setup.py test %endif %files texmacs %doc data/TeXmacs/LICENSE %{_bindir}/tm_sympy %files examples %doc examples %if %docu %files doc %docdir %{_docdir}/%{name}-doc/html %{_docdir}/%{name}-doc/html %endif %files -n python3-%{module} -f %{pyproject_files} %doc AUTHORS LICENSE PKG-INFO %{_mandir}/man1/isympy.1* %{_bindir}/isympy