1 |
%define module sympy |
2 |
# Disable for now: https://github.com/sympy/sympy/issues/24306 |
3 |
%define check_tests 0 |
4 |
%define docu 0 |
5 |
|
6 |
Summary: Python library for symbolic mathematics |
7 |
Name: python-%{module} |
8 |
Version: 1.11.1 |
9 |
Release: %mkrel 2 |
10 |
License: BSD |
11 |
Group: Development/Python |
12 |
Url: https://www.sympy.org/ |
13 |
Source0: https://github.com/%{module}/%{module}/releases/download/%{module}-%{version}/%{module}-%{version}.tar.gz |
14 |
|
15 |
BuildArch: noarch |
16 |
BuildRequires: pyproject-rpm-macros |
17 |
BuildRequires: graphviz |
18 |
# For docs |
19 |
%if %docu |
20 |
BuildRequires: python3-sphinx |
21 |
BuildRequires: python3-matplotlib |
22 |
BuildRequires: python3-sphinx-math-dollar |
23 |
BuildRequires: librsvg |
24 |
BuildRequires: imagemagick |
25 |
BuildRequires: texlive-dist |
26 |
%endif |
27 |
# for tests |
28 |
BuildRequires: x11-font-type1 |
29 |
BuildRequires: x11-server-xvfb |
30 |
BuildRequires: locales-en |
31 |
|
32 |
%description |
33 |
SymPy is a Python library for symbolic mathematics. It aims to become |
34 |
a full-featured computer algebra system (CAS) while keeping the code |
35 |
as simple as possible in order to be comprehensible and easily |
36 |
extensible. SymPy is written entirely in Python and does not require |
37 |
any external libraries, except optionally for plotting support. |
38 |
|
39 |
%package texmacs |
40 |
Summary: TeXmacs integration for sympy |
41 |
Group: Development/Python |
42 |
Requires: %{name} = %{version}-%{release} |
43 |
Requires: texmacs |
44 |
|
45 |
%description texmacs |
46 |
This package contains a TeXmacs plugin for sympy. |
47 |
|
48 |
%package examples |
49 |
Summary: Sympy examples |
50 |
Group: Development/Python |
51 |
Requires: %{name} = %{version}-%{release} |
52 |
|
53 |
%description examples |
54 |
This package contains example input for sympy. |
55 |
|
56 |
%if %docu |
57 |
%package doc |
58 |
Summary: Documentation for sympy |
59 |
Group: Development/Python |
60 |
|
61 |
%description doc |
62 |
man and HTML documentation for sympy. |
63 |
%endif |
64 |
|
65 |
%package -n python3-%{module} |
66 |
Summary: Python 3 library for symbolic mathematics |
67 |
Group: Development/Python |
68 |
BuildRequires: python3-devel |
69 |
BuildRequires: python3-mpmath |
70 |
Requires: python3-numpy |
71 |
Requires: python3-mpmath |
72 |
Requires: python3-matplotlib |
73 |
Requires: python3-pyglet |
74 |
%{?python_provide:%python_provide python3-%{module}} |
75 |
|
76 |
%description -n python3-%{module} |
77 |
SymPy is a Python 3 library for symbolic mathematics. It aims to become |
78 |
a full-featured computer algebra system (CAS) while keeping the code |
79 |
as simple as possible in order to be comprehensible and easily |
80 |
extensible. SymPy is written entirely in Python 3 and does not require |
81 |
any external libraries, except optionally for plotting support. |
82 |
|
83 |
%prep |
84 |
%setup -q -n sympy-%{version} |
85 |
%autopatch -p1 |
86 |
|
87 |
# Do not depend on env |
88 |
for fil in $(grep -rl "^#\![[:blank:]]*%{_bindir}/env" .); do |
89 |
%py3_shebang_fix $fil |
90 |
done |
91 |
|
92 |
%build |
93 |
%pyproject_wheel |
94 |
|
95 |
# Build the documentation |
96 |
%if %docu |
97 |
pushd doc |
98 |
make html SPHINXOPTS=%{?_smp_mflags} PYTHON=%{python3} |
99 |
make cheatsheet |
100 |
popd |
101 |
# leftovers |
102 |
rm -rf doc/_build/html/.buildinfo |
103 |
%endif |
104 |
|
105 |
%install |
106 |
%pyproject_install |
107 |
%pyproject_save_files sympy isympy |
108 |
|
109 |
# Remove extra files |
110 |
rm -f %{buildroot}%{_bindir}/{,doc}test |
111 |
|
112 |
# Install the TeXmacs integration |
113 |
cp -p data/TeXmacs/bin/tm_sympy %{buildroot}%{_bindir} |
114 |
|
115 |
# Don't let an executable script go into the documentation |
116 |
chmod a-x examples/all.py |
117 |
|
118 |
%if %docu |
119 |
# Install the HTML documentation |
120 |
mkdir -p %{buildroot}%{_docdir}/%{name}-doc |
121 |
cp -a doc/_build/html %{buildroot}%{_docdir}/%{name}-doc |
122 |
rm -fr %{buildroot}%{_docdir}/%{name}-doc/i18n |
123 |
%endif |
124 |
|
125 |
%if 0%check_tests |
126 |
%check |
127 |
# The python3 tests fail with Unicode errors without this |
128 |
export LC_ALL=en_US.UTF-8 |
129 |
let "dnum = $RANDOM % 90 + 10" |
130 |
xvfb-run -n $dnum python3 setup.py test |
131 |
%endif |
132 |
|
133 |
%files texmacs |
134 |
%doc data/TeXmacs/LICENSE |
135 |
%{_bindir}/tm_sympy |
136 |
|
137 |
%files examples |
138 |
%doc examples |
139 |
|
140 |
%if %docu |
141 |
%files doc |
142 |
%docdir %{_docdir}/%{name}-doc/html |
143 |
%{_docdir}/%{name}-doc/html |
144 |
%endif |
145 |
|
146 |
%files -n python3-%{module} -f %{pyproject_files} |
147 |
%doc AUTHORS LICENSE PKG-INFO |
148 |
%{_mandir}/man1/isympy.1* |
149 |
%{_bindir}/isympy |