From 0ce584dddcf1221215a66c2f06f00d50f29f9d0e Mon Sep 17 00:00:00 2001 From: Sergey B Kirpichev Date: Sun, 29 Sep 2024 05:27:57 +0300 Subject: [PATCH 1/5] Correct signature for gmpy2.digits(), closes #504 --- src/gmpy2_format.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/gmpy2_format.c b/src/gmpy2_format.c index 3c9565eb..fcb447a5 100644 --- a/src/gmpy2_format.c +++ b/src/gmpy2_format.c @@ -721,7 +721,7 @@ GMPy_MPC_Digits_Method(PyObject *self, PyObject *args) } PyDoc_STRVAR(GMPy_doc_context_digits, -"digits(x, base=10, prec=0, /) -> str\n\n" +"digits(x, base=10, prec=0, /) -> str | tuple\n\n" "Return string representing a number x."); static PyObject * From aea8a0f9bbf825d552087ca7fffbe83ddd5470f0 Mon Sep 17 00:00:00 2001 From: Sergey B Kirpichev Date: Mon, 7 Oct 2024 07:10:02 +0300 Subject: [PATCH 2/5] Fix -Wunused-but-set-variable (drop unused copy variable) --- src/gmpy2_mpz_misc.c | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/src/gmpy2_mpz_misc.c b/src/gmpy2_mpz_misc.c index 88b1e5b2..c3597807 100644 --- a/src/gmpy2_mpz_misc.c +++ b/src/gmpy2_mpz_misc.c @@ -2178,7 +2178,7 @@ GMPy_MPZ_Method_Array(PyObject *self, PyObject *const *args, Py_ssize_t i, nkws = 0; int argidx[2] = {-1, -1}; const char* kwname; - PyObject *dtype = Py_None, *copy = Py_None; + PyObject *dtype = Py_None; if (nargs > 2) { TYPE_ERROR("__array__() takes at most 2 positional arguments"); @@ -2227,9 +2227,6 @@ GMPy_MPZ_Method_Array(PyObject *self, PyObject *const *args, if (argidx[0] >= 0) { dtype = args[argidx[0]]; } - if (argidx[1] >= 0) { - copy = args[argidx[1]]; - } PyObject *mod = PyImport_ImportModule("numpy"); From 3e013e7cfdb9635aeb4d0754fae6f3cda46302d5 Mon Sep 17 00:00:00 2001 From: Sergey B Kirpichev Date: Wed, 9 Oct 2024 12:38:29 +0300 Subject: [PATCH 3/5] Gitignore per-project directories for virtual environments --- .gitignore | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.gitignore b/.gitignore index 60d139d4..9c4f2751 100644 --- a/.gitignore +++ b/.gitignore @@ -21,3 +21,6 @@ gmpy2/mpc.h gmpy2/mpc.lib gmpy2/mpfr.h gmpy2/mpfr.lib +# per-project directories for virtual environments +venv/ +.venv/ From 22763582c0be59cc071ddedae4f73b845bc34ffd Mon Sep 17 00:00:00 2001 From: Sergey B Kirpichev Date: Sun, 13 Oct 2024 08:52:55 +0300 Subject: [PATCH 4/5] Drop support for the CPython 3.7 EOL in 2023-06-06 (PEP 537) --- docs/install.rst | 2 +- pyproject.toml | 5 ++--- src/gmpy2.c | 1 - src/gmpy2.h | 4 ++-- 4 files changed, 5 insertions(+), 7 deletions(-) diff --git a/docs/install.rst b/docs/install.rst index 086c97a5..3fa67c5d 100644 --- a/docs/install.rst +++ b/docs/install.rst @@ -1,7 +1,7 @@ Installation ============ -gmpy2 requires CPython 3.7 or above. Pre-compiled binary wheels are available +gmpy2 requires CPython 3.8 or above. Pre-compiled binary wheels are available on PyPI. You can install latest release with pip:: pip install gmpy2 diff --git a/pyproject.toml b/pyproject.toml index 7b2176c0..2956a749 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -5,7 +5,7 @@ build-backend = 'setuptools.build_meta' [project] name = 'gmpy2' version = '2.2.1' -description = 'gmpy2 interface to GMP, MPFR, and MPC for Python 3.7+' +description = 'gmpy2 interface to GMP, MPFR, and MPC for Python 3.8+' keywords = ['gmp', 'mpfr', 'mpc', 'multiple-precision', 'arbitrary-precision', 'precision', 'bignum'] license = {text = 'LGPL-3.0+'} @@ -21,7 +21,6 @@ classifiers = ['Development Status :: 5 - Production/Stable', 'Operating System :: POSIX', 'Programming Language :: C', 'Programming Language :: Python :: 3', - 'Programming Language :: Python :: 3.7', 'Programming Language :: Python :: 3.8', 'Programming Language :: Python :: 3.9', 'Programming Language :: Python :: 3.10', @@ -31,7 +30,7 @@ classifiers = ['Development Status :: 5 - Production/Stable', 'Programming Language :: Python :: Implementation :: CPython', 'Topic :: Scientific/Engineering :: Mathematics', 'Topic :: Software Development :: Libraries :: Python Modules'] -requires-python = '>=3.7' +requires-python = '>=3.8' [project.readme] file = 'README.rst' diff --git a/src/gmpy2.c b/src/gmpy2.c index 9c02a427..0179a5e8 100644 --- a/src/gmpy2.c +++ b/src/gmpy2.c @@ -161,7 +161,6 @@ static gmpy_global global = { }; /* Support for context manager using context vars. - * Requires Python 3.7 or later. */ static PyObject *current_context_var = NULL; diff --git a/src/gmpy2.h b/src/gmpy2.h index 03a8443d..9195eeb5 100644 --- a/src/gmpy2.h +++ b/src/gmpy2.h @@ -67,8 +67,8 @@ extern "C" { /* Check for minimum Python version requirements. */ -#if PY_VERSION_HEX < 0x03070000 -# error "GMPY2 requires Python 3.7 or later." +#if PY_VERSION_HEX < 0x03080000 +# error "GMPY2 requires Python 3.8 or later." #endif /* Include headers for GMP, MPFR, and MPC. */ From 29aebd3c7141ce773152ecff060fb51a0e621891 Mon Sep 17 00:00:00 2001 From: Sergey B Kirpichev Date: Sun, 13 Oct 2024 09:03:37 +0300 Subject: [PATCH 5/5] Don't upload code coverage to Codecov * master branch coverage wasn't updated already a long time (requires token) * and I can't see codecov interface without proxy :) --- .github/workflows/pip_install_gmpy2.yml | 8 -------- 1 file changed, 8 deletions(-) diff --git a/.github/workflows/pip_install_gmpy2.yml b/.github/workflows/pip_install_gmpy2.yml index 82c02b53..b48203f8 100644 --- a/.github/workflows/pip_install_gmpy2.yml +++ b/.github/workflows/pip_install_gmpy2.yml @@ -63,14 +63,6 @@ jobs: PYTHONPATH=`pwd`/gmpy2 python test_cython/runtests.py lcov --capture --directory . --no-external --output-file build/coverage.info genhtml build/coverage.info --output-directory build/coverage - - name: Upload coverage to Codecov - uses: codecov/codecov-action@v4 - with: - gcov: true - gcov_include: src/*.c - gcov_args: --no-external - fail_ci_if_error: false - token: ${{ secrets.CODECOV_TOKEN }} - name: Archive build artifacts uses: actions/upload-artifact@v4 if: matrix.python-version == 3.11