Skip to content

Commit e91ee89

Browse files
authored
run CI on python=3.12 (#8605)
* enable a special 3.12 ci job * add the special environment files * update the trove classifiers * remove `pint` from the 3.12 environment The reason is that `pint` currently does not explicitly define `dtype`, causing our runtime checkable protocols not to match.
1 parent 072f44c commit e91ee89

File tree

4 files changed

+101
-3
lines changed

4 files changed

+101
-3
lines changed

.github/workflows/ci.yaml

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ jobs:
4444
matrix:
4545
os: ["ubuntu-latest", "macos-latest", "windows-latest"]
4646
# Bookend python versions
47-
python-version: ["3.9", "3.11"]
47+
python-version: ["3.9", "3.11", "3.12"]
4848
env: [""]
4949
include:
5050
# Minimum python version:
@@ -71,7 +71,11 @@ jobs:
7171
7272
if [[ ${{ matrix.os }} == windows* ]] ;
7373
then
74-
echo "CONDA_ENV_FILE=ci/requirements/environment-windows.yml" >> $GITHUB_ENV
74+
if [[ ${{ matrix.python-version }} != "3.12" ]]; then
75+
echo "CONDA_ENV_FILE=ci/requirements/environment-windows.yml" >> $GITHUB_ENV
76+
else
77+
echo "CONDA_ENV_FILE=ci/requirements/environment-windows-3.12.yml" >> $GITHUB_ENV
78+
fi
7579
elif [[ "${{ matrix.env }}" != "" ]] ;
7680
then
7781
if [[ "${{ matrix.env }}" == "flaky" ]] ;
@@ -82,7 +86,11 @@ jobs:
8286
echo "CONDA_ENV_FILE=ci/requirements/${{ matrix.env }}.yml" >> $GITHUB_ENV
8387
fi
8488
else
85-
echo "CONDA_ENV_FILE=ci/requirements/environment.yml" >> $GITHUB_ENV
89+
if [[ ${{ matrix.python-version }} != "3.12" ]]; then
90+
echo "CONDA_ENV_FILE=ci/requirements/environment.yml" >> $GITHUB_ENV
91+
else
92+
echo "CONDA_ENV_FILE=ci/requirements/environment-3.12.yml" >> $GITHUB_ENV
93+
fi
8694
fi
8795
8896
echo "PYTHON_VERSION=${{ matrix.python-version }}" >> $GITHUB_ENV

ci/requirements/environment-3.12.yml

Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
name: xarray-tests
2+
channels:
3+
- conda-forge
4+
- nodefaults
5+
dependencies:
6+
- aiobotocore
7+
- boto3
8+
- bottleneck
9+
- cartopy
10+
- cftime
11+
- dask-core
12+
- distributed
13+
- flox
14+
- fsspec!=2021.7.0
15+
- h5netcdf
16+
- h5py
17+
- hdf5
18+
- hypothesis
19+
- iris
20+
- lxml # Optional dep of pydap
21+
- matplotlib-base
22+
- nc-time-axis
23+
- netcdf4
24+
# - numba
25+
# - numbagg
26+
- numexpr
27+
- numpy
28+
- opt_einsum
29+
- packaging
30+
- pandas
31+
# - pint>=0.22
32+
- pip
33+
- pooch
34+
- pre-commit
35+
- pydap
36+
- pytest
37+
- pytest-cov
38+
- pytest-env
39+
- pytest-xdist
40+
- pytest-timeout
41+
- rasterio
42+
- scipy
43+
- seaborn
44+
# - sparse
45+
- toolz
46+
- typing_extensions
47+
- zarr
Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
name: xarray-tests
2+
channels:
3+
- conda-forge
4+
dependencies:
5+
- boto3
6+
- bottleneck
7+
- cartopy
8+
- cftime
9+
- dask-core
10+
- distributed
11+
- flox
12+
- fsspec!=2021.7.0
13+
- h5netcdf
14+
- h5py
15+
- hdf5
16+
- hypothesis
17+
- iris
18+
- lxml # Optional dep of pydap
19+
- matplotlib-base
20+
- nc-time-axis
21+
- netcdf4
22+
# - numba
23+
# - numbagg
24+
- numpy
25+
- packaging
26+
- pandas
27+
# - pint>=0.22
28+
- pip
29+
- pre-commit
30+
- pydap
31+
- pytest
32+
- pytest-cov
33+
- pytest-env
34+
- pytest-xdist
35+
- pytest-timeout
36+
- rasterio
37+
- scipy
38+
- seaborn
39+
# - sparse
40+
- toolz
41+
- typing_extensions
42+
- zarr

pyproject.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ classifiers = [
1212
"Programming Language :: Python :: 3.9",
1313
"Programming Language :: Python :: 3.10",
1414
"Programming Language :: Python :: 3.11",
15+
"Programming Language :: Python :: 3.12",
1516
"Topic :: Scientific/Engineering",
1617
]
1718
description = "N-D labeled arrays and datasets in Python"

0 commit comments

Comments
 (0)