Skip to content

Commit e2aa710

Browse files
phoflmroeschke
andauthored
CI: Add 3.12 builds (#56174)
* Add 3.12 builds * Fix * Fix * Fix * Fix * Fix tests * Fix * Update ci/deps/actions-312.yaml Co-authored-by: Matthew Roeschke <[email protected]> * Disable dev --------- Co-authored-by: Matthew Roeschke <[email protected]>
1 parent 0e8174f commit e2aa710

File tree

6 files changed

+95
-8
lines changed

6 files changed

+95
-8
lines changed

.github/workflows/unit-tests.yml

+7-3
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ jobs:
2626
timeout-minutes: 90
2727
strategy:
2828
matrix:
29-
env_file: [actions-39.yaml, actions-310.yaml, actions-311.yaml]
29+
env_file: [actions-39.yaml, actions-310.yaml, actions-311.yaml, actions-312.yaml]
3030
# Prevent the include jobs from overriding other jobs
3131
pattern: [""]
3232
include:
@@ -69,6 +69,10 @@ jobs:
6969
env_file: actions-311.yaml
7070
pattern: "not slow and not network and not single_cpu"
7171
pandas_copy_on_write: "1"
72+
- name: "Copy-on-Write 3.12"
73+
env_file: actions-312.yaml
74+
pattern: "not slow and not network and not single_cpu"
75+
pandas_copy_on_write: "1"
7276
- name: "Copy-on-Write 3.11 (warnings)"
7377
env_file: actions-311.yaml
7478
pattern: "not slow and not network and not single_cpu"
@@ -190,7 +194,7 @@ jobs:
190194
strategy:
191195
matrix:
192196
os: [macos-latest, windows-latest]
193-
env_file: [actions-39.yaml, actions-310.yaml, actions-311.yaml]
197+
env_file: [actions-39.yaml, actions-310.yaml, actions-311.yaml, actions-312.yaml]
194198
fail-fast: false
195199
runs-on: ${{ matrix.os }}
196200
name: ${{ format('{0} {1}', matrix.os, matrix.env_file) }}
@@ -321,7 +325,7 @@ jobs:
321325
# To freeze this file, uncomment out the ``if: false`` condition, and migrate the jobs
322326
# to the corresponding posix/windows-macos/sdist etc. workflows.
323327
# Feel free to modify this comment as necessary.
324-
#if: false # Uncomment this to freeze the workflow, comment it to unfreeze
328+
if: false # Uncomment this to freeze the workflow, comment it to unfreeze
325329
defaults:
326330
run:
327331
shell: bash -eou pipefail {0}

ci/deps/actions-312.yaml

+63
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,63 @@
1+
name: pandas-dev-312
2+
channels:
3+
- conda-forge
4+
dependencies:
5+
- python=3.12
6+
7+
# build dependencies
8+
- versioneer[toml]
9+
- cython>=0.29.33
10+
- meson[ninja]=1.2.1
11+
- meson-python=0.13.1
12+
13+
# test dependencies
14+
- pytest>=7.3.2
15+
- pytest-cov
16+
- pytest-xdist>=2.2.0
17+
- pytest-localserver>=0.7.1
18+
- pytest-qt>=4.2.0
19+
- boto3
20+
21+
# required dependencies
22+
- python-dateutil
23+
- numpy<2
24+
- pytz
25+
26+
# optional dependencies
27+
- beautifulsoup4>=4.11.2
28+
- blosc>=1.21.3
29+
- bottleneck>=1.3.6
30+
- fastparquet>=2022.12.0
31+
- fsspec>=2022.11.0
32+
- html5lib>=1.1
33+
- hypothesis>=6.46.1
34+
- gcsfs>=2022.11.0
35+
- jinja2>=3.1.2
36+
- lxml>=4.9.2
37+
- matplotlib>=3.6.3
38+
# - numba>=0.56.4
39+
- numexpr>=2.8.4
40+
- odfpy>=1.4.1
41+
- qtpy>=2.3.0
42+
- pyqt>=5.15.9
43+
- openpyxl>=3.1.0
44+
- psycopg2>=2.9.6
45+
- pyarrow>=10.0.1
46+
- pymysql>=1.0.2
47+
- pyreadstat>=1.2.0
48+
# - pytables>=3.8.0
49+
# - python-calamine>=0.1.6
50+
- pyxlsb>=1.0.10
51+
- s3fs>=2022.11.0
52+
- scipy>=1.10.0
53+
- sqlalchemy>=2.0.0
54+
- tabulate>=0.9.0
55+
- xarray>=2022.12.0
56+
- xlrd>=2.0.1
57+
- xlsxwriter>=3.0.5
58+
- zstandard>=0.19.0
59+
60+
- pip:
61+
- adbc-driver-postgresql>=0.8.0
62+
- adbc-driver-sqlite>=0.8.0
63+
- tzdata>=2022.7

pandas/tests/computation/test_eval.py

+11-2
Original file line numberDiff line numberDiff line change
@@ -542,6 +542,9 @@ def test_series_pos(self, lhs, engine, parser):
542542

543543
def test_scalar_unary(self, engine, parser):
544544
msg = "bad operand type for unary ~: 'float'"
545+
warn = None
546+
if PY312 and not (engine == "numexpr" and parser == "pandas"):
547+
warn = DeprecationWarning
545548
with pytest.raises(TypeError, match=msg):
546549
pd.eval("~1.0", engine=engine, parser=parser)
547550

@@ -550,8 +553,14 @@ def test_scalar_unary(self, engine, parser):
550553
assert pd.eval("~1", parser=parser, engine=engine) == ~1
551554
assert pd.eval("-1", parser=parser, engine=engine) == -1
552555
assert pd.eval("+1", parser=parser, engine=engine) == +1
553-
assert pd.eval("~True", parser=parser, engine=engine) == ~True
554-
assert pd.eval("~False", parser=parser, engine=engine) == ~False
556+
with tm.assert_produces_warning(
557+
warn, match="Bitwise inversion", check_stacklevel=False
558+
):
559+
assert pd.eval("~True", parser=parser, engine=engine) == ~True
560+
with tm.assert_produces_warning(
561+
warn, match="Bitwise inversion", check_stacklevel=False
562+
):
563+
assert pd.eval("~False", parser=parser, engine=engine) == ~False
555564
assert pd.eval("-True", parser=parser, engine=engine) == -True
556565
assert pd.eval("-False", parser=parser, engine=engine) == -False
557566
assert pd.eval("+True", parser=parser, engine=engine) == +True

pandas/tests/extension/test_arrow.py

+8-1
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@
3434
from pandas._libs.tslibs import timezones
3535
from pandas.compat import (
3636
PY311,
37+
PY312,
3738
is_ci_environment,
3839
is_platform_windows,
3940
pa_version_under11p0,
@@ -716,7 +717,13 @@ def test_invert(self, data, request):
716717
reason=f"pyarrow.compute.invert does support {pa_dtype}",
717718
)
718719
)
719-
super().test_invert(data)
720+
if PY312 and pa.types.is_boolean(pa_dtype):
721+
with tm.assert_produces_warning(
722+
DeprecationWarning, match="Bitwise inversion", check_stacklevel=False
723+
):
724+
super().test_invert(data)
725+
else:
726+
super().test_invert(data)
720727

721728
@pytest.mark.parametrize("periods", [1, -2])
722729
def test_diff(self, data, periods, request):

pandas/tests/io/excel/test_readers.py

+3-1
Original file line numberDiff line numberDiff line change
@@ -1442,7 +1442,9 @@ def test_deprecate_bytes_input(self, engine, read_ext):
14421442
"byte string, wrap it in a `BytesIO` object."
14431443
)
14441444

1445-
with tm.assert_produces_warning(FutureWarning, match=msg):
1445+
with tm.assert_produces_warning(
1446+
FutureWarning, match=msg, raise_on_extra_warnings=False
1447+
):
14461448
with open("test1" + read_ext, "rb") as f:
14471449
pd.read_excel(f.read(), engine=engine)
14481450

pandas/tests/io/excel/test_writers.py

+3-1
Original file line numberDiff line numberDiff line change
@@ -287,7 +287,9 @@ def test_read_excel_parse_dates(self, ext):
287287

288288
date_parser = lambda x: datetime.strptime(x, "%m/%d/%Y")
289289
with tm.assert_produces_warning(
290-
FutureWarning, match="use 'date_format' instead"
290+
FutureWarning,
291+
match="use 'date_format' instead",
292+
raise_on_extra_warnings=False,
291293
):
292294
res = pd.read_excel(
293295
pth,

0 commit comments

Comments
 (0)