Skip to content

Commit

Permalink
CI: Add 3.12 builds (#56174)
Browse files Browse the repository at this point in the history
* 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]>
  • Loading branch information
phofl and mroeschke authored Nov 30, 2023
1 parent 0e8174f commit e2aa710
Show file tree
Hide file tree
Showing 6 changed files with 95 additions and 8 deletions.
10 changes: 7 additions & 3 deletions .github/workflows/unit-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ jobs:
timeout-minutes: 90
strategy:
matrix:
env_file: [actions-39.yaml, actions-310.yaml, actions-311.yaml]
env_file: [actions-39.yaml, actions-310.yaml, actions-311.yaml, actions-312.yaml]
# Prevent the include jobs from overriding other jobs
pattern: [""]
include:
Expand Down Expand Up @@ -69,6 +69,10 @@ jobs:
env_file: actions-311.yaml
pattern: "not slow and not network and not single_cpu"
pandas_copy_on_write: "1"
- name: "Copy-on-Write 3.12"
env_file: actions-312.yaml
pattern: "not slow and not network and not single_cpu"
pandas_copy_on_write: "1"
- name: "Copy-on-Write 3.11 (warnings)"
env_file: actions-311.yaml
pattern: "not slow and not network and not single_cpu"
Expand Down Expand Up @@ -190,7 +194,7 @@ jobs:
strategy:
matrix:
os: [macos-latest, windows-latest]
env_file: [actions-39.yaml, actions-310.yaml, actions-311.yaml]
env_file: [actions-39.yaml, actions-310.yaml, actions-311.yaml, actions-312.yaml]
fail-fast: false
runs-on: ${{ matrix.os }}
name: ${{ format('{0} {1}', matrix.os, matrix.env_file) }}
Expand Down Expand Up @@ -321,7 +325,7 @@ jobs:
# To freeze this file, uncomment out the ``if: false`` condition, and migrate the jobs
# to the corresponding posix/windows-macos/sdist etc. workflows.
# Feel free to modify this comment as necessary.
#if: false # Uncomment this to freeze the workflow, comment it to unfreeze
if: false # Uncomment this to freeze the workflow, comment it to unfreeze
defaults:
run:
shell: bash -eou pipefail {0}
Expand Down
63 changes: 63 additions & 0 deletions ci/deps/actions-312.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
name: pandas-dev-312
channels:
- conda-forge
dependencies:
- python=3.12

# build dependencies
- versioneer[toml]
- cython>=0.29.33
- meson[ninja]=1.2.1
- meson-python=0.13.1

# test dependencies
- pytest>=7.3.2
- pytest-cov
- pytest-xdist>=2.2.0
- pytest-localserver>=0.7.1
- pytest-qt>=4.2.0
- boto3

# required dependencies
- python-dateutil
- numpy<2
- pytz

# optional dependencies
- beautifulsoup4>=4.11.2
- blosc>=1.21.3
- bottleneck>=1.3.6
- fastparquet>=2022.12.0
- fsspec>=2022.11.0
- html5lib>=1.1
- hypothesis>=6.46.1
- gcsfs>=2022.11.0
- jinja2>=3.1.2
- lxml>=4.9.2
- matplotlib>=3.6.3
# - numba>=0.56.4
- numexpr>=2.8.4
- odfpy>=1.4.1
- qtpy>=2.3.0
- pyqt>=5.15.9
- openpyxl>=3.1.0
- psycopg2>=2.9.6
- pyarrow>=10.0.1
- pymysql>=1.0.2
- pyreadstat>=1.2.0
# - pytables>=3.8.0
# - python-calamine>=0.1.6
- pyxlsb>=1.0.10
- s3fs>=2022.11.0
- scipy>=1.10.0
- sqlalchemy>=2.0.0
- tabulate>=0.9.0
- xarray>=2022.12.0
- xlrd>=2.0.1
- xlsxwriter>=3.0.5
- zstandard>=0.19.0

- pip:
- adbc-driver-postgresql>=0.8.0
- adbc-driver-sqlite>=0.8.0
- tzdata>=2022.7
13 changes: 11 additions & 2 deletions pandas/tests/computation/test_eval.py
Original file line number Diff line number Diff line change
Expand Up @@ -542,6 +542,9 @@ def test_series_pos(self, lhs, engine, parser):

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

Expand All @@ -550,8 +553,14 @@ def test_scalar_unary(self, engine, parser):
assert pd.eval("~1", parser=parser, engine=engine) == ~1
assert pd.eval("-1", parser=parser, engine=engine) == -1
assert pd.eval("+1", parser=parser, engine=engine) == +1
assert pd.eval("~True", parser=parser, engine=engine) == ~True
assert pd.eval("~False", parser=parser, engine=engine) == ~False
with tm.assert_produces_warning(
warn, match="Bitwise inversion", check_stacklevel=False
):
assert pd.eval("~True", parser=parser, engine=engine) == ~True
with tm.assert_produces_warning(
warn, match="Bitwise inversion", check_stacklevel=False
):
assert pd.eval("~False", parser=parser, engine=engine) == ~False
assert pd.eval("-True", parser=parser, engine=engine) == -True
assert pd.eval("-False", parser=parser, engine=engine) == -False
assert pd.eval("+True", parser=parser, engine=engine) == +True
Expand Down
9 changes: 8 additions & 1 deletion pandas/tests/extension/test_arrow.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@
from pandas._libs.tslibs import timezones
from pandas.compat import (
PY311,
PY312,
is_ci_environment,
is_platform_windows,
pa_version_under11p0,
Expand Down Expand Up @@ -716,7 +717,13 @@ def test_invert(self, data, request):
reason=f"pyarrow.compute.invert does support {pa_dtype}",
)
)
super().test_invert(data)
if PY312 and pa.types.is_boolean(pa_dtype):
with tm.assert_produces_warning(
DeprecationWarning, match="Bitwise inversion", check_stacklevel=False
):
super().test_invert(data)
else:
super().test_invert(data)

@pytest.mark.parametrize("periods", [1, -2])
def test_diff(self, data, periods, request):
Expand Down
4 changes: 3 additions & 1 deletion pandas/tests/io/excel/test_readers.py
Original file line number Diff line number Diff line change
Expand Up @@ -1442,7 +1442,9 @@ def test_deprecate_bytes_input(self, engine, read_ext):
"byte string, wrap it in a `BytesIO` object."
)

with tm.assert_produces_warning(FutureWarning, match=msg):
with tm.assert_produces_warning(
FutureWarning, match=msg, raise_on_extra_warnings=False
):
with open("test1" + read_ext, "rb") as f:
pd.read_excel(f.read(), engine=engine)

Expand Down
4 changes: 3 additions & 1 deletion pandas/tests/io/excel/test_writers.py
Original file line number Diff line number Diff line change
Expand Up @@ -287,7 +287,9 @@ def test_read_excel_parse_dates(self, ext):

date_parser = lambda x: datetime.strptime(x, "%m/%d/%Y")
with tm.assert_produces_warning(
FutureWarning, match="use 'date_format' instead"
FutureWarning,
match="use 'date_format' instead",
raise_on_extra_warnings=False,
):
res = pd.read_excel(
pth,
Expand Down

0 comments on commit e2aa710

Please sign in to comment.