]> git.pld-linux.org Git - SPECS.git/blob - python-mpmath.spec
SPECS updated Wed 1 May 10:14:00 CEST 2024
[SPECS.git] / python-mpmath.spec
1 #
2 # Conditional build:
3 %bcond_without  doc     # HTML documentation
4 %bcond_without  python2 # CPython 2.x module
5 %bcond_without  python3 # CPython 3.x module
6 %bcond_without  tests   # unit tests
7
8 Summary:        A pure Python library for multiprecision floating-point arithmetic
9 Summary(pl.UTF-8):      Czysto pythonowa biblioteka do arytmetyki zmiennoprzecinkowej wielokrotnej precyzji
10 Name:           python-mpmath
11 Version:        1.2.1
12 Release:        1
13 License:        BSD
14 Group:          Libraries/Python
15 # pypi release is missing docs
16 Source0:        https://files.pythonhosted.org/packages/source/m/mpmath/mpmath-%{version}.tar.gz
17 # Source0-md5:  ef8a6449851755319673b06f71731d52
18 # ... so use github
19 #Source0Download: https://github.com/fredrik-johansson/mpmath/releases
20 #Source0:       https://github.com/fredrik-johansson/mpmath/archive/%{version}/mpmath-%{version}.tar.gz
21 ## Source0-md5: c06bdf456bbbf092c929931974c8dac9
22 URL:            http://mpmath.org/
23 %if %{with python2}
24 BuildRequires:  python-devel >= 1:2.7
25 BuildRequires:  python-setuptools >= 1:36.7.0
26 BuildRequires:  python-setuptools_scm >= 1.7.0
27 %if %{with tests}
28 BuildRequires:  python-pytest >= 4.6
29 %endif
30 %endif
31 %if %{with python3}
32 BuildRequires:  python3-devel >= 1:3.4
33 BuildRequires:  python3-setuptools >= 1:36.7.0
34 BuildRequires:  python3-setuptools_scm >= 1.7.0
35 %if %{with tests}
36 BuildRequires:  python3-pytest >= 4.6
37 %endif
38 %endif
39 BuildRequires:  rpmbuild(macros) >= 1.714
40 %{?with_doc:BuildRequires:      sphinx-pdg}
41 BuildArch:      noarch
42 BuildRoot:      %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
43
44 %description
45 Mpmath is a pure-Python library for multiprecision floating-point
46 arithmetic. It provides an extensive set of transcendental functions,
47 unlimited exponent sizes, complex numbers, interval arithmetic,
48 numerical integration and differentiation, root-finding, linear
49 algebra, and much more. Almost any calculation can be performed just
50 as well at 10-digit or 1000-digit precision, and in many cases mpmath
51 implements asymptotically fast algorithms that scale well for
52 extremely high precision work. If available, mpmath will (optionally)
53 use gmpy to speed up high precision operations.
54
55 If you require plotting capabilities in mpmath, install
56 python-matplotlib.
57
58 %description -l pl.UTF-8
59 Mpmath to czysto pythonowa biblioteka do arytmetyki
60 zmiennoprzecinkowej wielokrotnej precyzji. Zapewnia obszerny zbiór
61 funkcji przestępnych, nieograniczone rozmiary wykładnika, liczby
62 zespolone, arytmetykę na przedziałach, całkowanie i różniczkowanie
63 numeryczne, szukanie pierwiastków, algebrę liniową itd. Można
64 wykonać prawie dowolne obliczenia, zarówno z 10-cyfrową, jak i
65 1000-cyfrową dokładnością, a dla wielu przypadków mpmath ma
66 zaimplementowane asymptotycznie szybkie algorytmy, dobrze skalujące
67 się dla bardzo dużej precyzji. Mpmath może opcjonalnie (jeśli jest
68 dostępny) używać modułu gmpy do przyspieszenia operacji.
69
70 Do obsługi wykresów w mpmath należy zainstalować pakiet
71 python-matplotlib.
72
73 %package -n python3-mpmath
74 Summary:        A pure Python library for multiprecision floating-point arithmetic
75 Summary(pl.UTF-8):      Czysto pythonowa biblioteka do arytmetyki zmiennoprzecinkowej wielokrotnej precyzji
76 Group:          Libraries/Python
77
78 %description -n python3-mpmath
79 Mpmath is a pure-Python library for multiprecision floating-point
80 arithmetic. It provides an extensive set of transcendental functions,
81 unlimited exponent sizes, complex numbers, interval arithmetic,
82 numerical integration and differentiation, root-finding, linear
83 algebra, and much more. Almost any calculation can be performed just
84 as well at 10-digit or 1000-digit precision, and in many cases mpmath
85 implements asymptotically fast algorithms that scale well for
86 extremely high precision work. If available, mpmath will (optionally)
87 use gmpy to speed up high precision operations.
88
89 If you require plotting capabilities in mpmath, install
90 python3-matplotlib.
91
92 %description -n python3-mpmath -l pl.UTF-8
93 Mpmath to czysto pythonowa biblioteka do arytmetyki
94 zmiennoprzecinkowej wielokrotnej precyzji. Zapewnia obszerny zbiór
95 funkcji przestępnych, nieograniczone rozmiary wykładnika, liczby
96 zespolone, arytmetykę na przedziałach, całkowanie i różniczkowanie
97 numeryczne, szukanie pierwiastków, algebrę liniową itd. Można
98 wykonać prawie dowolne obliczenia, zarówno z 10-cyfrową, jak i
99 1000-cyfrową dokładnością, a dla wielu przypadków mpmath ma
100 zaimplementowane asymptotycznie szybkie algorytmy, dobrze skalujące
101 się dla bardzo dużej precyzji. Mpmath może opcjonalnie (jeśli jest
102 dostępny) używać modułu gmpy do przyspieszenia operacji.
103
104 Do obsługi wykresów w mpmath należy zainstalować pakiet
105 python3-matplotlib.
106
107 %package doc
108 Summary:        API documentation for mpmath module
109 Summary(pl.UTF-8):      Dokumentacja API modułu mpmath
110 Group:          Documentation
111 Requires:       %{name} = %{version}-%{release}
112
113 %description doc
114 This package contains the HTML documentation for mpmath module.
115
116 %description doc -l pl.UTF-8
117 Ten pakiet zawiera dokumentację modułu mpmath w formacie HTML.
118
119 %prep
120 %setup -q -n mpmath-%{version}
121
122 shebangs="mpmath/matrices/eigen.py mpmath/matrices/eigen_symmetric.py mpmath/tests/test_eigen.py mpmath/tests/test_eigen_symmetric.py mpmath/tests/test_levin.py"
123 # Get rid of unnecessary shebangs
124 for lib in $shebangs; do
125         %{__sed} '/^#!.*/d; 1q' $lib > $lib.new && \
126                 touch -r $lib $lib.new && \
127                 %{__mv} $lib.new $lib
128 done
129
130 %build
131 %if %{with python2}
132 %py_build
133
134 %if %{with tests}
135 # test_axes uses DISPLAY
136 #%{__python} -m pytest -k 'not test_axes' mpmath/tests
137 PYTEST_DISABLE_PLUGIN_AUTOLOAD=1 \
138 %{__python} -m pytest -k 'not test_axes' mpmath/tests
139 %endif
140 %endif
141
142 %if %{with python3}
143 %py3_build
144
145 %if %{with tests}
146 #%{__python3} -m pytest -k 'not test_axes' mpmath/tests
147 PYTEST_DISABLE_PLUGIN_AUTOLOAD=1 \
148 %{__python3} -m pytest -k 'not test_axes' mpmath/tests
149 %endif
150 %endif
151
152 %if %{with doc}
153 cd doc
154 install -d build
155 sphinx-build -E source build
156 %endif
157
158 %install
159 rm -rf $RPM_BUILD_ROOT
160
161 %if %{with python2}
162 %py_install
163
164 %py_postclean
165 %{__rm} -r $RPM_BUILD_ROOT%{py_sitescriptdir}/mpmath/tests
166 %endif
167
168 %if %{with python3}
169 %py3_install
170
171 %{__rm} -r $RPM_BUILD_ROOT%{py3_sitescriptdir}/mpmath/tests
172 %endif
173
174 %clean
175 rm -rf $RPM_BUILD_ROOT
176
177 %if %{with python2}
178 %files
179 %defattr(644,root,root,755)
180 %doc CHANGES LICENSE README.rst TODO
181 %{py_sitescriptdir}/mpmath
182 %{py_sitescriptdir}/mpmath-%{version}-*.egg-info
183 %endif
184
185 %if %{with python3}
186 %files -n python3-mpmath
187 %defattr(644,root,root,755)
188 %doc CHANGES LICENSE README.rst TODO
189 %{py3_sitescriptdir}/mpmath
190 %{py3_sitescriptdir}/mpmath-%{version}-*.egg-info
191 %endif
192
193 %if %{with doc}
194 %files doc
195 %defattr(644,root,root,755)
196 %doc doc/build/{_images,_static,calculus,functions,*.html,*.js}
197 %endif
This page took 0.110158 seconds and 4 git commands to generate.