diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 8fc7aab93..4c89df3f6 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -19,7 +19,7 @@ jobs: matrix: # macos-latest is arm os: [ubuntu-latest, windows-latest, macos-latest] - python-version: ["3.10", "3.11", "3.12", "3.13"] + python-version: ["3.10", "3.11", "3.12", "3.13", "3.14"] name: OS ${{ matrix.os }} - Python ${{ matrix.python-version }} diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index b44edb1f3..be433f52b 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -3,7 +3,7 @@ ci: autofix_prs: false repos: - repo: https://github.com/astral-sh/ruff-pre-commit - rev: v0.14.1 + rev: v0.14.2 hooks: - id: ruff-check args: [--exit-non-zero-on-fix] diff --git a/pyproject.toml b/pyproject.toml index 6d7859cc5..c9398b84d 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -20,6 +20,7 @@ classifiers = [ "Programming Language :: Python :: 3.11", "Programming Language :: Python :: 3.12", "Programming Language :: Python :: 3.13", + "Programming Language :: Python :: 3.14", "Topic :: Scientific/Engineering", "Typing :: Stubs Only", ] @@ -33,16 +34,16 @@ exclude = [ "pandas-stubs/__init__.py" ] [tool.poetry.dependencies] python = ">=3.10" types-pytz = ">= 2022.1.1" -numpy = ">= 1.23.5" +numpy = ">=1.23.5" [tool.poetry.group.dev.dependencies] mypy = ">=1.18.2" -pandas = "2.3.2" +pandas = "2.3.3" pyarrow = ">=10.0.1" pytest = ">=8.4.2" -pyright = ">=1.1.406" -ty = ">=0.0.1a21" -pyrefly = ">=0.36.1" +pyright = ">=1.1.407" +ty = ">=0.0.1a24" +pyrefly = ">=0.38.2" poethepoet = ">=0.16.5" loguru = ">=0.6.0" typing-extensions = ">=4.4.0" @@ -51,9 +52,9 @@ pre-commit = ">=2.19.0" black = ">=25.9.0" isort = ">=6.0.1" openpyxl = ">=3.0.10" -tables = { version = ">=3.10.1", python = "<4" } +numexpr = ">=2.13.1" lxml = ">=4.9.1" -pyreadstat = ">=1.2.0" +pyreadstat = { version = ">=1.2.0", python = "<3.14" } # TODO: Roche/pyreadstat#310 xlrd = ">=2.0.1" xlsxwriter = ">=3.0.3" pyxlsb = ">=1.0.10" @@ -61,7 +62,7 @@ odfpy = ">=1.4.1" xarray = ">=22.6.0" tabulate = ">=0.8.10" jinja2 = ">=3.1" -scipy = { version = ">=1.9.1", python = "<3.14" } +scipy = ">=1.9.1" scipy-stubs = ">=1.15.3.0" SQLAlchemy = ">=2.0.39" types-python-dateutil = ">=2.8.19" diff --git a/tests/series/test_series.py b/tests/series/test_series.py index d94b54312..73bc51bb5 100644 --- a/tests/series/test_series.py +++ b/tests/series/test_series.py @@ -13,6 +13,7 @@ from pathlib import Path import platform import re +import sys from typing import ( TYPE_CHECKING, Any, @@ -3196,6 +3197,9 @@ def test_rank() -> None: ) +@pytest.mark.xfail( + sys.version_info >= (3, 14), reason="sys.getrefcount pandas-dev/pandas#61368" +) def test_series_setitem_multiindex() -> None: # GH 767 df = ( diff --git a/tests/test_api_typing.py b/tests/test_api_typing.py index 5b01be922..a57dfa670 100644 --- a/tests/test_api_typing.py +++ b/tests/test_api_typing.py @@ -1,5 +1,6 @@ """Test module for classes in pandas.api.typing.""" +import sys from typing import TypeAlias import numpy as np @@ -204,6 +205,9 @@ def f1(gb: Window) -> None: f1(ser.rolling(2, win_type="gaussian")) +@pytest.mark.xfail( + sys.version_info >= (3, 14), reason="sys.getrefcount pandas-dev/pandas#61368" +) def test_statereader() -> None: df = pd.DataFrame([[1, 2], [3, 4]], columns=["col_1", "col_2"]) time_stamp = pd.Timestamp(2000, 2, 29, 14, 21) diff --git a/tests/test_frame.py b/tests/test_frame.py index 6bbe7e3b7..8d0c3a9ea 100644 --- a/tests/test_frame.py +++ b/tests/test_frame.py @@ -381,6 +381,9 @@ def test_types_assign() -> None: check(assert_type(df.assign(a=[], b=()), pd.DataFrame), pd.DataFrame) +@pytest.mark.xfail( + sys.version_info >= (3, 14), reason="sys.getrefcount pandas-dev/pandas#61368" +) def test_assign() -> None: df = pd.DataFrame({"a": [1, 2, 3], 1: [4, 5, 6]}) @@ -2838,6 +2841,9 @@ def test_indexslice_setitem() -> None: df.loc[pd.IndexSlice[pd.Index([2, 3]), :], "z"] = 99 +@pytest.mark.xfail( + sys.version_info >= (3, 14), reason="sys.getrefcount pandas-dev/pandas#61368" +) def test_indexslice_getitem() -> None: # GH 300 df = ( @@ -4431,6 +4437,9 @@ def test_getitem_dict_keys() -> None: check(assert_type(df[some_columns.keys()], pd.DataFrame), pd.DataFrame) +@pytest.mark.xfail( + sys.version_info >= (3, 14), reason="sys.getrefcount pandas-dev/pandas#61368" +) def test_frame_setitem_na() -> None: # GH 743 df = pd.DataFrame( @@ -4561,6 +4570,9 @@ def _constructor(self) -> type[MyClass]: check(assert_type(df[["a", "b"]], MyClass), MyClass) +@pytest.mark.xfail( + sys.version_info >= (3, 14), reason="sys.getrefcount pandas-dev/pandas#61368" +) def test_hashable_args() -> None: # GH 1104 df = pd.DataFrame([["abc"]], columns=["test"], index=["ind"]) diff --git a/tests/test_io.py b/tests/test_io.py index ff5bb5850..20852e395 100644 --- a/tests/test_io.py +++ b/tests/test_io.py @@ -6,6 +6,7 @@ import pathlib from pathlib import Path import sqlite3 +import sys from typing import ( TYPE_CHECKING, Any, @@ -174,12 +175,18 @@ def test_to_pickle_series() -> None: check(assert_type(read_pickle(path), Any), Series) +@pytest.mark.xfail( + sys.version_info >= (3, 14), reason="sys.getrefcount pandas-dev/pandas#61368" +) def test_read_stata_df() -> None: with ensure_clean() as path: DF.to_stata(path) check(assert_type(read_stata(path), pd.DataFrame), pd.DataFrame) +@pytest.mark.xfail( + sys.version_info >= (3, 14), reason="sys.getrefcount pandas-dev/pandas#61368" +) def test_read_stata_iterator() -> None: with ensure_clean() as path: str_path = str(path) @@ -427,6 +434,10 @@ def test_hdf_series() -> None: check(assert_type(read_hdf(path, "s"), DataFrame | Series), Series) +@pytest.mark.xfail( + sys.version_info >= (3, 14), + reason="pyreadstat 1.3.1 does not support py314 Roche/pyreadstat#310", +) def test_spss() -> None: path = Path(CWD, "data", "labelled-num.sav") check( diff --git a/tests/test_pandas.py b/tests/test_pandas.py index ff4289c2e..af442375b 100644 --- a/tests/test_pandas.py +++ b/tests/test_pandas.py @@ -2,6 +2,7 @@ import datetime as dt import random +import sys from typing import ( TYPE_CHECKING, Any, @@ -822,6 +823,9 @@ def test_to_numeric_array_series() -> None: ) +@pytest.mark.xfail( + sys.version_info >= (3, 14), reason="sys.getrefcount pandas-dev/pandas#61368" +) def test_wide_to_long() -> None: df = pd.DataFrame( { @@ -1145,6 +1149,9 @@ def test_qcut() -> None: check(assert_type(j1, npt.NDArray[np.double]), np.ndarray) +@pytest.mark.xfail( + sys.version_info >= (3, 14), reason="sys.getrefcount pandas-dev/pandas#61368" +) def test_merge() -> None: ls = pd.Series([1, 2, 3, 4], index=[1, 2, 3, 4], name="left") rs = pd.Series([3, 4, 5, 6], index=[3, 4, 5, 6], name="right") @@ -1307,6 +1314,9 @@ def test_merge() -> None: ) +@pytest.mark.xfail( + sys.version_info >= (3, 14), reason="sys.getrefcount pandas-dev/pandas#61368" +) def test_merge_ordered() -> None: ls = pd.Series([1, 2, 3, 4], index=[1, 2, 3, 4], name="left") rs = pd.Series([3, 4, 5, 6], index=[3, 4, 5, 6], name="right")