From f92e1f995e6e42303c25bf6555fdfe066f4f6251 Mon Sep 17 00:00:00 2001 From: Thomas Li <47963215+lithomas1@users.noreply.github.com> Date: Thu, 18 Jan 2024 09:48:11 -0800 Subject: [PATCH] CLN: Drop Numpy 1.22 per NEP29 (#56838) --- ci/deps/actions-39-minimum_versions.yaml | 2 +- doc/source/getting_started/install.rst | 2 +- doc/source/whatsnew/v2.3.0.rst | 2 +- pandas/compat/numpy/__init__.py | 3 +-- pandas/tests/interchange/test_impl.py | 2 -- pyproject.toml | 3 +-- 6 files changed, 5 insertions(+), 9 deletions(-) diff --git a/ci/deps/actions-39-minimum_versions.yaml b/ci/deps/actions-39-minimum_versions.yaml index 7067048c4434d..115ccf01ccaad 100644 --- a/ci/deps/actions-39-minimum_versions.yaml +++ b/ci/deps/actions-39-minimum_versions.yaml @@ -22,7 +22,7 @@ dependencies: # required dependencies - python-dateutil=2.8.2 - - numpy=1.22.4 + - numpy=1.23.5 - pytz=2020.1 # optional dependencies diff --git a/doc/source/getting_started/install.rst b/doc/source/getting_started/install.rst index b9f7d64d4b2f8..b54a220f74ca3 100644 --- a/doc/source/getting_started/install.rst +++ b/doc/source/getting_started/install.rst @@ -203,7 +203,7 @@ pandas requires the following dependencies. ================================================================ ========================== Package Minimum supported version ================================================================ ========================== -`NumPy `__ 1.22.4 +`NumPy `__ 1.23.5 `python-dateutil `__ 2.8.2 `pytz `__ 2020.1 `tzdata `__ 2022.7 diff --git a/doc/source/whatsnew/v2.3.0.rst b/doc/source/whatsnew/v2.3.0.rst index 8976832d286d2..4e390b0f5866a 100644 --- a/doc/source/whatsnew/v2.3.0.rst +++ b/doc/source/whatsnew/v2.3.0.rst @@ -65,7 +65,7 @@ If installed, we now require: +-----------------+-----------------+----------+---------+ | Package | Minimum Version | Required | Changed | +=================+=================+==========+=========+ -| | | X | X | +| numpy | 1.23.5 | X | X | +-----------------+-----------------+----------+---------+ For `optional libraries `_ the general recommendation is to use the latest version. diff --git a/pandas/compat/numpy/__init__.py b/pandas/compat/numpy/__init__.py index 3014bd652d8c4..7fc4b8d1d9b10 100644 --- a/pandas/compat/numpy/__init__.py +++ b/pandas/compat/numpy/__init__.py @@ -8,13 +8,12 @@ # numpy versioning _np_version = np.__version__ _nlv = Version(_np_version) -np_version_lt1p23 = _nlv < Version("1.23") np_version_gte1p24 = _nlv >= Version("1.24") np_version_gte1p24p3 = _nlv >= Version("1.24.3") np_version_gte1p25 = _nlv >= Version("1.25") np_version_gt2 = _nlv >= Version("2.0.0.dev0") is_numpy_dev = _nlv.dev is not None -_min_numpy_ver = "1.22.4" +_min_numpy_ver = "1.23.5" if _nlv < Version(_min_numpy_ver): diff --git a/pandas/tests/interchange/test_impl.py b/pandas/tests/interchange/test_impl.py index 2bc488fbb1dd1..96a239b89d6ce 100644 --- a/pandas/tests/interchange/test_impl.py +++ b/pandas/tests/interchange/test_impl.py @@ -8,7 +8,6 @@ is_ci_environment, is_platform_windows, ) -from pandas.compat.numpy import np_version_lt1p23 import pandas as pd import pandas._testing as tm @@ -260,7 +259,6 @@ def test_datetime(): tm.assert_frame_equal(df, from_dataframe(df.__dataframe__())) -@pytest.mark.skipif(np_version_lt1p23, reason="Numpy > 1.23 required") def test_categorical_to_numpy_dlpack(): # https://github.com/pandas-dev/pandas/issues/48393 df = pd.DataFrame({"A": pd.Categorical(["a", "b", "a"])}) diff --git a/pyproject.toml b/pyproject.toml index ddae60642b1bf..3651fb892d790 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -30,8 +30,7 @@ authors = [ license = {file = 'LICENSE'} requires-python = '>=3.9' dependencies = [ - "numpy>=1.22.4; python_version<'3.11'", - "numpy>=1.23.2; python_version=='3.11'", + "numpy>=1.23.5; python_version<'3.12'", "numpy>=1.26.0; python_version>='3.12'", "python-dateutil>=2.8.2", "pytz>=2020.1",