Version 2.1.0 beta5. Drop all patches.
This commit is contained in:
parent
af67de0983
commit
f2f439fe12
|
@ -1,132 +0,0 @@
|
|||
--- a/src/gmpy2.h
|
||||
+++ b/src/gmpy2.h
|
||||
@@ -336,7 +336,8 @@ typedef struct {
|
||||
#define Py2or3String_FromFormat PyUnicode_FromFormat
|
||||
#define Py2or3String_Check PyUnicode_Check
|
||||
#define Py2or3String_Format PyUnicode_Format
|
||||
-#define Py2or3String_AsString PyUnicode_AS_DATA
|
||||
+#define Py2or3String_Type Py_UCS4
|
||||
+#define Py2or3String_1Char(obj) (PyUnicode_READY(obj) ? (Py_UCS4)0 : PyUnicode_READ_CHAR(obj, 0))
|
||||
#define PyStrOrUnicode_Check(op) (PyBytes_Check(op) || PyUnicode_Check(op))
|
||||
#define PyIntOrLong_FromLong PyLong_FromLong
|
||||
#define PyIntOrLong_Check(op) PyLong_Check(op)
|
||||
@@ -350,7 +351,8 @@ typedef struct {
|
||||
#define Py2or3String_FromFormat PyString_FromFormat
|
||||
#define Py2or3String_Check PyString_Check
|
||||
#define Py2or3String_Format PyString_Format
|
||||
-#define Py2or3String_AsString PyString_AsString
|
||||
+#define Py2or3String_Type char
|
||||
+#define Py2or3String_1Char(obj) PyString_AsString(obj)[0]
|
||||
#define PyStrOrUnicode_Check(op) (PyString_Check(op) || PyUnicode_Check(op))
|
||||
#define PyIntOrLong_FromLong PyInt_FromLong
|
||||
#define PyIntOrLong_Check(op) (PyInt_Check(op) || PyLong_Check(op))
|
||||
--- a/src/gmpy2_mpmath.c
|
||||
+++ b/src/gmpy2_mpmath.c
|
||||
@@ -73,7 +73,7 @@ Pympz_mpmath_normalize(PyObject *self, P
|
||||
long carry = 0;
|
||||
PyObject *exp = 0, *newexp = 0, *newexp2 = 0, *tmp = 0, *rndstr = 0;
|
||||
MPZ_Object *man = 0, *upper = 0, *lower = 0;
|
||||
- char rnd = 0;
|
||||
+ Py2or3String_Type rnd = 0;
|
||||
int err1, err2, err3;
|
||||
|
||||
if (PyTuple_GET_SIZE(args) == 6) {
|
||||
@@ -105,7 +105,7 @@ Pympz_mpmath_normalize(PyObject *self, P
|
||||
|
||||
/* If rndstr really is a string, extract the first character. */
|
||||
if (Py2or3String_Check(rndstr)) {
|
||||
- rnd = Py2or3String_AsString(rndstr)[0];
|
||||
+ rnd = Py2or3String_1Char(rndstr);
|
||||
}
|
||||
else {
|
||||
VALUE_ERROR("invalid rounding mode specified");
|
||||
@@ -134,7 +134,7 @@ Pympz_mpmath_normalize(PyObject *self, P
|
||||
if (bc > prec) {
|
||||
shift = bc - prec;
|
||||
switch (rnd) {
|
||||
- case 'f':
|
||||
+ case (Py2or3String_Type)'f':
|
||||
if(sign) {
|
||||
mpz_cdiv_q_2exp(upper->z, man->z, shift);
|
||||
}
|
||||
@@ -142,7 +142,7 @@ Pympz_mpmath_normalize(PyObject *self, P
|
||||
mpz_fdiv_q_2exp(upper->z, man->z, shift);
|
||||
}
|
||||
break;
|
||||
- case 'c':
|
||||
+ case (Py2or3String_Type)'c':
|
||||
if(sign) {
|
||||
mpz_fdiv_q_2exp(upper->z, man->z, shift);
|
||||
}
|
||||
@@ -150,13 +150,13 @@ Pympz_mpmath_normalize(PyObject *self, P
|
||||
mpz_cdiv_q_2exp(upper->z, man->z, shift);
|
||||
}
|
||||
break;
|
||||
- case 'd':
|
||||
+ case (Py2or3String_Type)'d':
|
||||
mpz_fdiv_q_2exp(upper->z, man->z, shift);
|
||||
break;
|
||||
- case 'u':
|
||||
+ case (Py2or3String_Type)'u':
|
||||
mpz_cdiv_q_2exp(upper->z, man->z, shift);
|
||||
break;
|
||||
- case 'n':
|
||||
+ case (Py2or3String_Type)'n':
|
||||
default:
|
||||
mpz_tdiv_r_2exp(lower->z, man->z, shift);
|
||||
mpz_tdiv_q_2exp(upper->z, man->z, shift);
|
||||
@@ -241,7 +241,7 @@ Pympz_mpmath_create(PyObject *self, PyOb
|
||||
MPZ_Object *man = 0, *upper = 0, *lower = 0;
|
||||
int error;
|
||||
|
||||
- const char *rnd = "f";
|
||||
+ Py2or3String_Type rnd = (Py2or3String_Type)'f';
|
||||
|
||||
if (PyTuple_GET_SIZE(args) < 2) {
|
||||
TYPE_ERROR("mpmath_create() expects 'mpz','int'[,'int','str'] arguments");
|
||||
@@ -250,7 +250,7 @@ Pympz_mpmath_create(PyObject *self, PyOb
|
||||
|
||||
switch (PyTuple_GET_SIZE(args)) {
|
||||
case 4:
|
||||
- rnd = Py2or3String_AsString(PyTuple_GET_ITEM(args, 3));
|
||||
+ rnd = Py2or3String_1Char(PyTuple_GET_ITEM(args, 3));
|
||||
case 3:
|
||||
prec = GMPy_Integer_AsMpBitCntAndError(PyTuple_GET_ITEM(args, 2), &error);
|
||||
if (error)
|
||||
@@ -291,8 +291,8 @@ Pympz_mpmath_create(PyObject *self, PyOb
|
||||
|
||||
if (bc > prec) {
|
||||
shift = bc - prec;
|
||||
- switch (rnd[0]) {
|
||||
- case 'f':
|
||||
+ switch (rnd) {
|
||||
+ case (Py2or3String_Type)'f':
|
||||
if (sign) {
|
||||
mpz_cdiv_q_2exp(upper->z, upper->z, shift);
|
||||
}
|
||||
@@ -300,7 +300,7 @@ Pympz_mpmath_create(PyObject *self, PyOb
|
||||
mpz_fdiv_q_2exp(upper->z, upper->z, shift);
|
||||
}
|
||||
break;
|
||||
- case 'c':
|
||||
+ case (Py2or3String_Type)'c':
|
||||
if (sign) {
|
||||
mpz_fdiv_q_2exp(upper->z, upper->z, shift);
|
||||
}
|
||||
@@ -308,13 +308,13 @@ Pympz_mpmath_create(PyObject *self, PyOb
|
||||
mpz_cdiv_q_2exp(upper->z, upper->z, shift);
|
||||
}
|
||||
break;
|
||||
- case 'd':
|
||||
+ case (Py2or3String_Type)'d':
|
||||
mpz_fdiv_q_2exp(upper->z, upper->z, shift);
|
||||
break;
|
||||
- case 'u':
|
||||
+ case (Py2or3String_Type)'u':
|
||||
mpz_cdiv_q_2exp(upper->z, upper->z, shift);
|
||||
break;
|
||||
- case 'n':
|
||||
+ case (Py2or3String_Type)'n':
|
||||
default:
|
||||
mpz_tdiv_r_2exp(lower->z, upper->z, shift);
|
||||
mpz_tdiv_q_2exp(upper->z, upper->z, shift);
|
|
@ -1,11 +0,0 @@
|
|||
--- a/test/test_gmpy2_math.txt
|
||||
+++ b/test/test_gmpy2_math.txt
|
||||
@@ -233,8 +233,6 @@ TypeError: factorial() requires non-nega
|
||||
mpfr('1.2146304367025329e+205')
|
||||
>>> gmpy2.factorial(123456)
|
||||
mpfr('2.6040699049291379e+574964')
|
||||
->>> gmpy2.factorial(123456789)
|
||||
-mpfr('inf')
|
||||
>>> gmpy2.factorial(1234567899999999999999)
|
||||
Traceback (most recent call last):
|
||||
File "<stdin>", line 1, in <module>
|
|
@ -1,11 +0,0 @@
|
|||
--- a/test/test_gmpy2_format.txt
|
||||
+++ b/test/test_gmpy2_format.txt
|
||||
@@ -155,7 +155,7 @@ ValueError: Invalid conversion specifica
|
||||
>>> c.__format__('a')
|
||||
'0x5.5555555555554p-4+0x5p+0j'
|
||||
>>> c.__format__('e')
|
||||
-'3.3333333333333331e-01+5e+00j'
|
||||
+'3.3333333333333331e-01+5.0000000000000000e+00j'
|
||||
>>> mpc(-1.0, -2.0).__format__('M')
|
||||
'(-1.000000 -2.000000)'
|
||||
|
|
@ -1,21 +1,14 @@
|
|||
%global srcname gmpy2
|
||||
%global prerelease b4
|
||||
%global prerelease b5
|
||||
|
||||
Name: python-%{srcname}
|
||||
Version: 2.1.0
|
||||
Release: 0.18%{?prerelease:.%{prerelease}}%{?dist}
|
||||
Release: 0.19%{?prerelease:.%{prerelease}}%{?dist}
|
||||
Summary: Python interface to GMP, MPFR, and MPC
|
||||
|
||||
License: LGPLv3+
|
||||
URL: https://pypi.python.org/pypi/gmpy2
|
||||
Source0: https://github.com/aleaxit/gmpy/archive/%{srcname}-%{version}%{?prerelease}.tar.gz
|
||||
# Work around an apparent inflooping bug in MPFR on 32-bit systems
|
||||
Patch0: %{name}-factorial-32bit.patch
|
||||
# Fix a problem with reading the rounding mode on big endian systems
|
||||
# https://github.com/aleaxit/gmpy/issues/276
|
||||
Patch1: %{name}-endian.patch
|
||||
# Adapt to MPFR 4.1.0 output changes
|
||||
Patch2: %{name}-mpfr410.patch
|
||||
|
||||
BuildRequires: gcc
|
||||
BuildRequires: gmp-devel
|
||||
|
@ -47,18 +40,13 @@ Provides: bundled(jquery)
|
|||
%{common_desc}
|
||||
|
||||
%prep
|
||||
%autosetup -N -n gmpy-%{srcname}-%{version}%{?prerelease}
|
||||
%if 0%{?__isa_bits} == 32
|
||||
%patch0 -p1
|
||||
%endif
|
||||
%patch1 -p1
|
||||
%patch2 -p1
|
||||
%autosetup -n gmpy-%{srcname}-%{version}%{?prerelease}
|
||||
|
||||
# Update the sphinx theme name
|
||||
sed -i "s/'default'/'classic'/" docs/conf.py
|
||||
|
||||
# Version 2.1.0b4 still calls itself 2.1.0b1
|
||||
sed -i "s/b1/b4/" docs/conf.py
|
||||
# Version 2.1.0b5 still calls itself 2.1.0b1
|
||||
sed -i "s/b1/b5/" docs/conf.py
|
||||
|
||||
# Symbols from the math library are also used
|
||||
sed -i "s/'mpfr','gmp'/&,'m'/" setup.py
|
||||
|
@ -88,6 +76,10 @@ cd -
|
|||
%{python3_sitearch}/%{srcname}*
|
||||
|
||||
%changelog
|
||||
* Fri Jul 31 2020 Jerry James <loganjerry@gmail.com> - 2.1.0-0.19.b5
|
||||
- Version 2.1.0 beta5
|
||||
- Drop all patches
|
||||
|
||||
* Wed Jul 29 2020 Fedora Release Engineering <releng@fedoraproject.org> - 2.1.0-0.18.b4
|
||||
- Rebuilt for https://fedoraproject.org/wiki/Fedora_33_Mass_Rebuild
|
||||
|
||||
|
|
2
sources
2
sources
|
@ -1 +1 @@
|
|||
SHA512 (gmpy2-2.1.0b4.tar.gz) = 80e339827022063b443e624abf919f88495c092d5481a253899bb7b0b241993aa2ab9c2ece759c2a32e25540784f3340008aa730bfad28b2c5a398e297e96fea
|
||||
SHA512 (gmpy2-2.1.0b5.tar.gz) = 13c5c9111d374907cce606d8358b577620a30b683386e7505588ad9bf1017712ede9a1d0870f5a638cc3817848a2d09218348bc9b52b546035974b968d428dc5
|
||||
|
|
Loading…
Reference in New Issue