python3-gmpy2: update to 2.2.0a1.

Co-authored-by: Gonzalo Tornaría <tornaria@cmat.edu.uy>
This commit is contained in:
Andrew J. Hesford 2023-09-23 21:01:04 -04:00
parent 41d2b459e9
commit 9d2acae320
2 changed files with 33 additions and 6 deletions

View File

@ -0,0 +1,22 @@
Skip mpmath test if module not available
diff --git a/test/test_mpfr.py b/test/test_mpfr.py
index 03f0a44..e9deb79 100644
--- a/test/test_mpfr.py
+++ b/test/test_mpfr.py
@@ -3,7 +3,6 @@ from decimal import Decimal
import pytest
from hypothesis import given, example, settings
from hypothesis.strategies import floats
-import mpmath
import gmpy2
from gmpy2 import (gamma_inc, mpfr, cmp, cmp_abs, zero, nan, mpz, mpq,
@@ -123,6 +122,7 @@ def test_mpfr_nrandom():
def test_mpfr_mpmath():
+ mpmath = pytest.importorskip("mpmath")
a, b, c, d = '1.1', '-1.1', '-3.14', '0'
assert mpfr(a)._mpf_ == (0, mpz(4953959590107546), -52, 53)
assert mpmath.mpf(mpfr(a)) == mpmath.mpf(a)

View File

@ -1,20 +1,25 @@
# Template file for 'python3-gmpy2'
pkgname=python3-gmpy2
version=2.1.5
version=2.2.0a1
revision=1
build_style=python3-module
hostmakedepends="python3-setuptools"
build_style=python3-pep517
hostmakedepends="python3-setuptools python3-wheel"
makedepends="python3-devel gmp-devel mpfr-devel libmpc-devel"
depends="python3"
checkdepends="python3-pytest python3-hypothesis"
short_desc="Python3 interface to GMP, MPFR and MPC libraries"
maintainer="Gonzalo Tornaría <tornaria@cmat.edu.uy>"
license="LGPL-3.0-or-later"
homepage="https://github.com/aleaxit/gmpy"
changelog="https://github.com/aleaxit/gmpy/releases"
distfiles="${PYPI_SITE}/g/gmpy2/gmpy2-${version}.tar.gz"
checksum=bc297f1fd8c377ae67a4f493fc0f926e5d1b157e5c342e30a4d84dc7b9f95d96
checksum=3b8acc939a40411a8ad5541ed178ff866dd1759e667ee26fe34c9291b6b350c3
if [ "$XBPS_CHECK_PKGS" = full ]; then
# this would cause a build-time circular dependency
checkdepends+=" python3-mpmath"
fi
do_check() {
PYTHONPATH="$(cd build/lib* && pwd)" \
python3 test/runtests.py
( cd test && PYTHONPATH="$(cd ../build/lib* && pwd)" python3 runtests.py )
}