Skip to content

Commit 750befd

Browse files
authored
chore: 🐍 pytest with py314 (#1434)
* test in py314 * drop tables * Roche/pyreadstat#310 skip pyreadstat * typo and black * chore: poetry * pandas-dev/pandas#61368 * bump pandas version
1 parent 64e978c commit 750befd

File tree

8 files changed

+52
-10
lines changed

8 files changed

+52
-10
lines changed

.github/workflows/test.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ jobs:
1919
matrix:
2020
# macos-latest is arm
2121
os: [ubuntu-latest, windows-latest, macos-latest]
22-
python-version: ["3.10", "3.11", "3.12", "3.13"]
22+
python-version: ["3.10", "3.11", "3.12", "3.13", "3.14"]
2323

2424
name: OS ${{ matrix.os }} - Python ${{ matrix.python-version }}
2525

.pre-commit-config.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ ci:
33
autofix_prs: false
44
repos:
55
- repo: https://github.com/astral-sh/ruff-pre-commit
6-
rev: v0.14.1
6+
rev: v0.14.2
77
hooks:
88
- id: ruff-check
99
args: [--exit-non-zero-on-fix]

pyproject.toml

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ classifiers = [
2020
"Programming Language :: Python :: 3.11",
2121
"Programming Language :: Python :: 3.12",
2222
"Programming Language :: Python :: 3.13",
23+
"Programming Language :: Python :: 3.14",
2324
"Topic :: Scientific/Engineering",
2425
"Typing :: Stubs Only",
2526
]
@@ -33,16 +34,16 @@ exclude = [ "pandas-stubs/__init__.py" ]
3334
[tool.poetry.dependencies]
3435
python = ">=3.10"
3536
types-pytz = ">= 2022.1.1"
36-
numpy = ">= 1.23.5"
37+
numpy = ">=1.23.5"
3738

3839
[tool.poetry.group.dev.dependencies]
3940
mypy = ">=1.18.2"
40-
pandas = "2.3.2"
41+
pandas = "2.3.3"
4142
pyarrow = ">=10.0.1"
4243
pytest = ">=8.4.2"
43-
pyright = ">=1.1.406"
44-
ty = ">=0.0.1a21"
45-
pyrefly = ">=0.36.1"
44+
pyright = ">=1.1.407"
45+
ty = ">=0.0.1a24"
46+
pyrefly = ">=0.38.2"
4647
poethepoet = ">=0.16.5"
4748
loguru = ">=0.6.0"
4849
typing-extensions = ">=4.4.0"
@@ -51,17 +52,17 @@ pre-commit = ">=2.19.0"
5152
black = ">=25.9.0"
5253
isort = ">=6.0.1"
5354
openpyxl = ">=3.0.10"
54-
tables = { version = ">=3.10.1", python = "<4" }
55+
numexpr = ">=2.13.1"
5556
lxml = ">=4.9.1"
56-
pyreadstat = ">=1.2.0"
57+
pyreadstat = { version = ">=1.2.0", python = "<3.14" } # TODO: Roche/pyreadstat#310
5758
xlrd = ">=2.0.1"
5859
xlsxwriter = ">=3.0.3"
5960
pyxlsb = ">=1.0.10"
6061
odfpy = ">=1.4.1"
6162
xarray = ">=22.6.0"
6263
tabulate = ">=0.8.10"
6364
jinja2 = ">=3.1"
64-
scipy = { version = ">=1.9.1", python = "<3.14" }
65+
scipy = ">=1.9.1"
6566
scipy-stubs = ">=1.15.3.0"
6667
SQLAlchemy = ">=2.0.39"
6768
types-python-dateutil = ">=2.8.19"

tests/series/test_series.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313
from pathlib import Path
1414
import platform
1515
import re
16+
import sys
1617
from typing import (
1718
TYPE_CHECKING,
1819
Any,
@@ -3196,6 +3197,9 @@ def test_rank() -> None:
31963197
)
31973198

31983199

3200+
@pytest.mark.xfail(
3201+
sys.version_info >= (3, 14), reason="sys.getrefcount pandas-dev/pandas#61368"
3202+
)
31993203
def test_series_setitem_multiindex() -> None:
32003204
# GH 767
32013205
df = (

tests/test_api_typing.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
"""Test module for classes in pandas.api.typing."""
22

3+
import sys
34
from typing import TypeAlias
45

56
import numpy as np
@@ -204,6 +205,9 @@ def f1(gb: Window) -> None:
204205
f1(ser.rolling(2, win_type="gaussian"))
205206

206207

208+
@pytest.mark.xfail(
209+
sys.version_info >= (3, 14), reason="sys.getrefcount pandas-dev/pandas#61368"
210+
)
207211
def test_statereader() -> None:
208212
df = pd.DataFrame([[1, 2], [3, 4]], columns=["col_1", "col_2"])
209213
time_stamp = pd.Timestamp(2000, 2, 29, 14, 21)

tests/test_frame.py

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -381,6 +381,9 @@ def test_types_assign() -> None:
381381
check(assert_type(df.assign(a=[], b=()), pd.DataFrame), pd.DataFrame)
382382

383383

384+
@pytest.mark.xfail(
385+
sys.version_info >= (3, 14), reason="sys.getrefcount pandas-dev/pandas#61368"
386+
)
384387
def test_assign() -> None:
385388
df = pd.DataFrame({"a": [1, 2, 3], 1: [4, 5, 6]})
386389

@@ -2838,6 +2841,9 @@ def test_indexslice_setitem() -> None:
28382841
df.loc[pd.IndexSlice[pd.Index([2, 3]), :], "z"] = 99
28392842

28402843

2844+
@pytest.mark.xfail(
2845+
sys.version_info >= (3, 14), reason="sys.getrefcount pandas-dev/pandas#61368"
2846+
)
28412847
def test_indexslice_getitem() -> None:
28422848
# GH 300
28432849
df = (
@@ -4431,6 +4437,9 @@ def test_getitem_dict_keys() -> None:
44314437
check(assert_type(df[some_columns.keys()], pd.DataFrame), pd.DataFrame)
44324438

44334439

4440+
@pytest.mark.xfail(
4441+
sys.version_info >= (3, 14), reason="sys.getrefcount pandas-dev/pandas#61368"
4442+
)
44344443
def test_frame_setitem_na() -> None:
44354444
# GH 743
44364445
df = pd.DataFrame(
@@ -4561,6 +4570,9 @@ def _constructor(self) -> type[MyClass]:
45614570
check(assert_type(df[["a", "b"]], MyClass), MyClass)
45624571

45634572

4573+
@pytest.mark.xfail(
4574+
sys.version_info >= (3, 14), reason="sys.getrefcount pandas-dev/pandas#61368"
4575+
)
45644576
def test_hashable_args() -> None:
45654577
# GH 1104
45664578
df = pd.DataFrame([["abc"]], columns=["test"], index=["ind"])

tests/test_io.py

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
import pathlib
77
from pathlib import Path
88
import sqlite3
9+
import sys
910
from typing import (
1011
TYPE_CHECKING,
1112
Any,
@@ -174,12 +175,18 @@ def test_to_pickle_series() -> None:
174175
check(assert_type(read_pickle(path), Any), Series)
175176

176177

178+
@pytest.mark.xfail(
179+
sys.version_info >= (3, 14), reason="sys.getrefcount pandas-dev/pandas#61368"
180+
)
177181
def test_read_stata_df() -> None:
178182
with ensure_clean() as path:
179183
DF.to_stata(path)
180184
check(assert_type(read_stata(path), pd.DataFrame), pd.DataFrame)
181185

182186

187+
@pytest.mark.xfail(
188+
sys.version_info >= (3, 14), reason="sys.getrefcount pandas-dev/pandas#61368"
189+
)
183190
def test_read_stata_iterator() -> None:
184191
with ensure_clean() as path:
185192
str_path = str(path)
@@ -427,6 +434,10 @@ def test_hdf_series() -> None:
427434
check(assert_type(read_hdf(path, "s"), DataFrame | Series), Series)
428435

429436

437+
@pytest.mark.xfail(
438+
sys.version_info >= (3, 14),
439+
reason="pyreadstat 1.3.1 does not support py314 Roche/pyreadstat#310",
440+
)
430441
def test_spss() -> None:
431442
path = Path(CWD, "data", "labelled-num.sav")
432443
check(

tests/test_pandas.py

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22

33
import datetime as dt
44
import random
5+
import sys
56
from typing import (
67
TYPE_CHECKING,
78
Any,
@@ -822,6 +823,9 @@ def test_to_numeric_array_series() -> None:
822823
)
823824

824825

826+
@pytest.mark.xfail(
827+
sys.version_info >= (3, 14), reason="sys.getrefcount pandas-dev/pandas#61368"
828+
)
825829
def test_wide_to_long() -> None:
826830
df = pd.DataFrame(
827831
{
@@ -1145,6 +1149,9 @@ def test_qcut() -> None:
11451149
check(assert_type(j1, npt.NDArray[np.double]), np.ndarray)
11461150

11471151

1152+
@pytest.mark.xfail(
1153+
sys.version_info >= (3, 14), reason="sys.getrefcount pandas-dev/pandas#61368"
1154+
)
11481155
def test_merge() -> None:
11491156
ls = pd.Series([1, 2, 3, 4], index=[1, 2, 3, 4], name="left")
11501157
rs = pd.Series([3, 4, 5, 6], index=[3, 4, 5, 6], name="right")
@@ -1307,6 +1314,9 @@ def test_merge() -> None:
13071314
)
13081315

13091316

1317+
@pytest.mark.xfail(
1318+
sys.version_info >= (3, 14), reason="sys.getrefcount pandas-dev/pandas#61368"
1319+
)
13101320
def test_merge_ordered() -> None:
13111321
ls = pd.Series([1, 2, 3, 4], index=[1, 2, 3, 4], name="left")
13121322
rs = pd.Series([3, 4, 5, 6], index=[3, 4, 5, 6], name="right")

0 commit comments

Comments
 (0)