python-gmpy2/python-gmpy2.spec

79 lines
2.5 KiB
RPMSpec
Raw Normal View History

#
# spec file for package python-gmpy2
#
# Copyright (c) 2024 SUSE LLC
#
# All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed
# upon. The license for this file, and modifications and additions to the
# file, is the same license as for the pristine package itself (unless the
# license for the pristine package is not an Open Source License, in which
# case the license is the MIT License). An "Open Source License" is a
# license that conforms to the Open Source Definition (Version 1.9)
# published by the Open Source Initiative.
Accepting request 956270 from devel:languages:python:numeric - Update to 2.1.2: * Allow GIL release for mpz/xmpz/mpq types only. * Improve argument type processing by saving type information to decrease the number of type check calls. Especially helpful for mpfr and mpc types. * Avoid MPFR bug in mfr_fac_ui (gmpy2.factorial) on platforms where long is 32-bits and argument is >= 44787929. * Adjust test suite to reflect changes in output in MPFR 4.1.0. * Added cmp() and cmp_abs(). * Improved compatibility with _numbers_ protocol. * Initial support for MPFR4 + Add nrandom() + grandom() now calls nrandom twice; may return different values versus MPFR3 + Add rootn(); same as root() except different sign when taking even root of -0.0 * Thread-safe contexts are now supported. Properly integrating thread-safe contexts required an extensive rewrite of almost all internal functions. * MPFR and MPC are now required. It is no longer possible to build a version of gmpy2 that only supports the GMP library. * The function inverse() now raises an exception if the inverse does not exist. * Context methods have been added for MPFR/MPC related functions. * A new context option (rational_division) has been added that changes the behavior of integer division involving mpz instances to return a rational result instead of a floating point result. * gmpy2 types are now registered in the numeric tower. - Remove unzip BuildRequires, as upstream has switched to tarballs. OBS-URL: https://build.opensuse.org/request/show/956270 OBS-URL: https://build.opensuse.org/package/show/openSUSE:Factory/python-gmpy2?expand=0&rev=2
2022-02-21 17:46:39 +01:00
# Please submit bugfixes or comments via https://bugs.opensuse.org/
#
%{?sle15_python_module_pythons}
Name: python-gmpy2
Version: 2.1.5
Release: 0
Summary: GMP/MPIR, MPFR, and MPC interface to Python 2.6+ and 3x
Accepting request 956270 from devel:languages:python:numeric - Update to 2.1.2: * Allow GIL release for mpz/xmpz/mpq types only. * Improve argument type processing by saving type information to decrease the number of type check calls. Especially helpful for mpfr and mpc types. * Avoid MPFR bug in mfr_fac_ui (gmpy2.factorial) on platforms where long is 32-bits and argument is >= 44787929. * Adjust test suite to reflect changes in output in MPFR 4.1.0. * Added cmp() and cmp_abs(). * Improved compatibility with _numbers_ protocol. * Initial support for MPFR4 + Add nrandom() + grandom() now calls nrandom twice; may return different values versus MPFR3 + Add rootn(); same as root() except different sign when taking even root of -0.0 * Thread-safe contexts are now supported. Properly integrating thread-safe contexts required an extensive rewrite of almost all internal functions. * MPFR and MPC are now required. It is no longer possible to build a version of gmpy2 that only supports the GMP library. * The function inverse() now raises an exception if the inverse does not exist. * Context methods have been added for MPFR/MPC related functions. * A new context option (rational_division) has been added that changes the behavior of integer division involving mpz instances to return a rational result instead of a floating point result. * gmpy2 types are now registered in the numeric tower. - Remove unzip BuildRequires, as upstream has switched to tarballs. OBS-URL: https://build.opensuse.org/request/show/956270 OBS-URL: https://build.opensuse.org/package/show/openSUSE:Factory/python-gmpy2?expand=0&rev=2
2022-02-21 17:46:39 +01:00
License: LGPL-3.0-only
URL: https://github.com/aleaxit/gmpy
Source: https://files.pythonhosted.org/packages/source/g/gmpy2/gmpy2-%{version}.tar.gz
# PATCH-FIX-UPSTREAM https://github.com/aleaxit/gmpy/pull/422 Update MPFR to 4.2.1 in build scripts & fix test failures on new version
Patch0: mpfr421.patch
# PATCH-FIX-UPSTREAM file included in https://github.com/aleaxit/gmpy/issues/418#issuecomment-1706721394
Patch1: gmpy2_cache.c.diff
# PATCH-FIX-UPSTREAM included in https://github.com/aleaxit/gmpy/issues/446
Patch2: support-python-312.patch
BuildRequires: %{python_module devel}
BuildRequires: %{python_module pip}
BuildRequires: %{python_module setuptools}
BuildRequires: %{python_module wheel}
BuildRequires: fdupes
BuildRequires: gmp-devel
BuildRequires: mpc-devel
BuildRequires: mpfr-devel
BuildRequires: python-rpm-macros
%python_subpackages
%description
gmpy2 is a C-coded Python extension module that supports
multiple-precision arithmetic. In addition to supporting
GMP or MPIR for multiple-precision integer and rational
arithmetic, gmpy2 adds support for the MPFR (correctly
rounded real floating-point arithmetic) and MPC (correctly
rounded complex floating-point arithmetic) libraries.
%prep
%autosetup -p1 -n gmpy2-%{version}
%build
export CFLAGS="%{optflags}"
%pyproject_wheel
%install
%pyproject_install
%python_expand %fdupes %{buildroot}%{$python_sitearch}
%check
%{python_expand export PYTHONDONTWRITEBYTECODE=1
export PYTHONPATH=%{buildroot}%{$python_sitearch}
pushd test
$python runtests.py
popd
}
%files %{python_files}
%doc README
%license COPYING COPYING.LESSER
%{python_sitearch}/gmpy2
%{python_sitearch}/gmpy2-%{version}.dist-info
%changelog