Skip to content

Commit

Permalink
Merge pull request #521 from skirpichev/misc
Browse files Browse the repository at this point in the history
Misc fixes
  • Loading branch information
casevh authored Oct 14, 2024
2 parents 7460aff + 29aebd3 commit 17fb42d
Show file tree
Hide file tree
Showing 8 changed files with 10 additions and 20 deletions.
8 changes: 0 additions & 8 deletions .github/workflows/pip_install_gmpy2.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -21,3 +21,6 @@ gmpy2/mpc.h
gmpy2/mpc.lib
gmpy2/mpfr.h
gmpy2/mpfr.lib
# per-project directories for virtual environments
venv/
.venv/
2 changes: 1 addition & 1 deletion docs/install.rst
Original file line number Diff line number Diff line change
@@ -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
Expand Down
5 changes: 2 additions & 3 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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+'}
Expand All @@ -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',
Expand All @@ -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'
Expand Down
1 change: 0 additions & 1 deletion src/gmpy2.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
4 changes: 2 additions & 2 deletions src/gmpy2.h
Original file line number Diff line number Diff line change
Expand Up @@ -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. */
Expand Down
2 changes: 1 addition & 1 deletion src/gmpy2_format.c
Original file line number Diff line number Diff line change
Expand Up @@ -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 *
Expand Down
5 changes: 1 addition & 4 deletions src/gmpy2_mpz_misc.c
Original file line number Diff line number Diff line change
Expand Up @@ -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");
Expand Down Expand Up @@ -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");

Expand Down

0 comments on commit 17fb42d

Please sign in to comment.