diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index eb0acdf1..19a9a4ae 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -20,7 +20,7 @@ jobs: strategy: fail-fast: false matrix: - python-version: [3.9, '3.10', 3.11, 3.12, 3.13, 3.14, 3.13t, 3.14t] + python-version: ['3.10', 3.11, 3.12, 3.13, 3.14, 3.13t, 3.14t] nogmpy: [false] purepy: [false] include: diff --git a/README.rst b/README.rst index fc44100f..20915a08 100644 --- a/README.rst +++ b/README.rst @@ -114,8 +114,8 @@ Release history: 1. Download & installation -------------------------- -Mpmath requires Python 3.9 or later versions. It has been tested with CPython -3.9 through 3.14 and for PyPy 3.11. +Mpmath requires Python 3.10 or later versions. It has been tested with CPython +3.10 through 3.14 and for PyPy 3.11. The latest release of mpmath can be downloaded from the mpmath website and from https://github.com/mpmath/mpmath/releases diff --git a/docs/setup.rst b/docs/setup.rst index 7d779cf1..3b6ea11c 100644 --- a/docs/setup.rst +++ b/docs/setup.rst @@ -1,7 +1,7 @@ Setting up mpmath ================= -Mpmath requires at least Python 3.9. It has been tested with CPython 3.9 +Mpmath requires at least Python 3.10. It has been tested with CPython 3.10 through 3.14 and for PyPy 3.11. Download and installation diff --git a/mpmath/libmp/libmpf.py b/mpmath/libmp/libmpf.py index 4e652b5f..4e2479a9 100644 --- a/mpmath/libmp/libmpf.py +++ b/mpmath/libmp/libmpf.py @@ -460,11 +460,7 @@ def mpf_hash(s): # Handle special numbers if not sman: - if s == fnan: - if sys.version_info >= (3, 10): - return object.__hash__(s) - else: - return sys.hash_info.nan + if s == fnan: return object.__hash__(s) if s == finf: return sys.hash_info.inf if s == fninf: return -sys.hash_info.inf diff --git a/mpmath/tests/test_format.py b/mpmath/tests/test_format.py index 896c003c..a4cc4f2a 100644 --- a/mpmath/tests/test_format.py +++ b/mpmath/tests/test_format.py @@ -11,9 +11,6 @@ from mpmath import fp, inf, mp, nan, ninf, workdps from mpmath.libmp.libmpf import read_format_spec -vinfo = sys.version_info - - @st.composite def fmt_str(draw, types='fFeE', for_complex=False): res = '' @@ -41,7 +38,7 @@ def fmt_str(draw, types='fFeE', for_complex=False): res += draw(st.sampled_from([''] + list('-+ '))) # no_neg_0 (not used yet.) - if vinfo >= (3, 11): + if sys.version_info >= (3, 11): res += draw(st.sampled_from([''] + ['z'])) # alternate mode @@ -71,7 +68,7 @@ def fmt_str(draw, types='fFeE', for_complex=False): + ['0' + str(_) for _ in range(40)])) if prec: res += '.' + prec - if vinfo >= (3, 14): + if sys.version_info >= (3, 14): gchar = draw(st.sampled_from([''] + list(',_'))) res += gchar @@ -501,7 +498,7 @@ def test_mpf_floats_bulk(fmt, x): if not x and math.copysign(1, x) == -1: return # skip negative zero spec = read_format_spec(fmt) - if spec['frac_separators'] and vinfo < (3, 14): + if spec['frac_separators'] and sys.version_info < (3, 14): mp.pretty_dps = "str" return # see also python/cpython#130860 if not spec['type'] and spec['precision'] < 0 and math.isfinite(x): @@ -526,7 +523,7 @@ def test_mpc_complexes(fmt, z): or (not z.imag and math.copysign(1, z.imag) == -1)): return # skip negative zero spec = read_format_spec(fmt) - if spec['frac_separators'] and vinfo < (3, 14): + if spec['frac_separators'] and sys.version_info < (3, 14): return # see also python/cpython#130860 if spec['precision'] < 0 and any(math.isfinite(_) for _ in [z.real, z.imag]): # The mpmath could choose a different decimal diff --git a/mpmath/tests/test_visualization.py b/mpmath/tests/test_visualization.py index e4083414..0207d100 100644 --- a/mpmath/tests/test_visualization.py +++ b/mpmath/tests/test_visualization.py @@ -9,7 +9,6 @@ import pytest from mpmath import fp, mp -@pytest.mark.filterwarnings("ignore:.*:DeprecationWarning") def test_axes(): try: import matplotlib diff --git a/pyproject.toml b/pyproject.toml index 6f688aac..b8e0511d 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -12,7 +12,6 @@ classifiers = ['Topic :: Scientific/Engineering :: Mathematics', 'Programming Language :: Python', 'Programming Language :: Python :: 3', 'Programming Language :: Python :: 3 :: Only', - 'Programming Language :: Python :: 3.9', 'Programming Language :: Python :: 3.10', 'Programming Language :: Python :: 3.11', 'Programming Language :: Python :: 3.12', @@ -22,7 +21,7 @@ classifiers = ['Topic :: Scientific/Engineering :: Mathematics', 'Programming Language :: Python :: Implementation :: CPython', 'Programming Language :: Python :: Implementation :: PyPy'] dynamic = ['version'] -requires-python = '>=3.9' +requires-python = '>=3.10' readme = 'README.rst' [project.urls]