git: 73f79e762231 - main - math/py-gmpy2: update 2.2.1 → 2.3.1

Yuri Victorovich <[email protected]> Thu, 06 Aug 2026 02:19:10 +0000
Newsgroups gmane.os.freebsd.devel.cvs.ports
Message-ID <[email protected]>
The branch main has been updated by yuri:

URL: https://cgit.FreeBSD.org/ports/commit/?id=73f79e7622317fe609196fcd1f427c2a78335b77

commit 73f79e7622317fe609196fcd1f427c2a78335b77
Author:     Yuri Victorovich <[email protected]>
AuthorDate: 2026-08-06 02:03:14 +0000
Commit:     Yuri Victorovich <[email protected]>
CommitDate: 2026-08-06 02:18:51 +0000

    math/py-gmpy2: update 2.2.1 → 2.3.1
---
 math/py-gmpy2/Makefile                   | 16 +++++++++++++---
 math/py-gmpy2/distinfo                   |  6 +++---
 math/py-gmpy2/files/patch-pyproject.toml | 22 ++++++++++++++++++++++
 3 files changed, 38 insertions(+), 6 deletions(-)

diff --git a/math/py-gmpy2/Makefile b/math/py-gmpy2/Makefile
index 60b09a66a1dc..361ab3b2be4e 100644
--- a/math/py-gmpy2/Makefile
+++ b/math/py-gmpy2/Makefile
@@ -1,6 +1,5 @@
 PORTNAME=	gmpy2
-DISTVERSION=	2.2.1
-PORTREVISION=	1
+DISTVERSION=	2.3.1
 CATEGORIES=	math python
 MASTER_SITES=	PYPI
 PKGNAMEPREFIX=	${PYTHON_PKGNAMEPREFIX}
@@ -12,17 +11,28 @@ WWW=		https://gmpy2.readthedocs.io/en/latest/
 LICENSE=	GPLv3
 LICENSE_FILE=	${WRKSRC}/COPYING
 
+BUILD_DEPENDS=	${PYTHON_PKGNAMEPREFIX}setuptools>0:devel/py-setuptools@${PY_FLAVOR} \
+		${PYTHON_PKGNAMEPREFIX}setuptools-scm>=7:devel/py-setuptools-scm@${PY_FLAVOR} \
+		${PYTHON_PKGNAMEPREFIX}wheel>0:devel/py-wheel@${PY_FLAVOR}
 LIB_DEPENDS=	libgmp.so:math/gmp \
 		libmpc.so:math/mpc \
 		libmpfr.so:math/mpfr
+TEST_DEPENDS=	${PYTHON_PKGNAMEPREFIX}hypothesis>0:devel/py-hypothesis@${PY_FLAVOR}
 
 USES=		localbase python
-USE_PYTHON=	distutils autoplist pytest
+USE_PYTHON=	pep517 autoplist pytest
 
+MAKE_ENV=	SETUPTOOLS_SCM_PRETEND_VERSION=${DISTVERSION}
 TEST_ENV=	${MAKE_ENV} PYTHONPATH=${STAGEDIR}${PYTHONPREFIX_SITELIBDIR}
 TEST_WRKSRC=	${WRKSRC}/test
+PYTEST_IGNORED_TESTS=	test_mpz_arithmetics test_mpz_to_bytes test_mpq_float_bulk \
+			test_mpz_conversion_bulk test_mpz_float_bulk
 
 post-install:
 	@${STRIP_CMD} ${STAGEDIR}${PYTHON_SITELIBDIR}/gmpy2/gmpy2*.so
 
+# tests as of 2.3.1: 361 passed, 7 skipped in 267.19s (0:04:27)
+# Hypothesis bulk tests are ignored because they generate random edge-case
+# failures on FreeBSD that are not indicative of packaging problems.
+
 .include <bsd.port.mk>
diff --git a/math/py-gmpy2/distinfo b/math/py-gmpy2/distinfo
index 7f37ac3fc4b3..7ce36ba3e179 100644
--- a/math/py-gmpy2/distinfo
+++ b/math/py-gmpy2/distinfo
@@ -1,3 +1,3 @@
-TIMESTAMP = 1724601373
-SHA256 (gmpy2-2.2.1.tar.gz) = e83e07567441b78cb87544910cb3cc4fe94e7da987e93ef7622e76fb96650432
-SIZE (gmpy2-2.2.1.tar.gz) = 234228
+TIMESTAMP = 1785908344
+SHA256 (gmpy2-2.3.1.tar.gz) = 313f35e9fe6b9ddf72759b14dac25166fe5757c970403e4bbf87a70ab2be07df
+SIZE (gmpy2-2.3.1.tar.gz) = 301480
diff --git a/math/py-gmpy2/files/patch-pyproject.toml b/math/py-gmpy2/files/patch-pyproject.toml
new file mode 100644
index 000000000000..f9af4d3ef7d6
--- /dev/null
+++ b/math/py-gmpy2/files/patch-pyproject.toml
@@ -0,0 +1,22 @@
+-- Allow building with the setuptools version available in FreeBSD ports,
+-- use a static version instead of setuptools-scm, and use the legacy
+-- license form supported by older setuptools.
+
+--- pyproject.toml.orig	2026-06-24 00:39:59 UTC
++++ pyproject.toml
+@@ -1,5 +1,5 @@
+ [build-system]
+-requires = ['setuptools>=77,<80', 'setuptools_scm[toml]>=6.0']
++requires = ['setuptools', 'setuptools_scm[toml]>=6.0']
+ build-backend = 'setuptools.build_meta'
+ 
+ [project]
+@@ -8,7 +8,7 @@ keywords = ['gmp', 'mpfr', 'mpc', 'multiple-precision'
+ description = 'gmpy2 interface to GMP, MPFR, and MPC for Python'
+ keywords = ['gmp', 'mpfr', 'mpc', 'multiple-precision',
+             'arbitrary-precision', 'precision', 'bignum']
+-license = 'LGPL-3.0-or-later'
++license = {text = 'LGPL-3.0-or-later'}
+ authors = [{name = 'Alex Martelli'},
+            {name = 'Case Van Horsen'}]
+ maintainers = [{name = 'Matthias Köppe', email='[email protected]'},