From e91ee89edbdec4299897e60c9d97d0cf915353c9 Mon Sep 17 00:00:00 2001 From: Justus Magin Date: Wed, 17 Jan 2024 22:54:12 +0100 Subject: [PATCH] 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. --- .github/workflows/ci.yaml | 14 ++++-- ci/requirements/environment-3.12.yml | 47 ++++++++++++++++++++ ci/requirements/environment-windows-3.12.yml | 42 +++++++++++++++++ pyproject.toml | 1 + 4 files changed, 101 insertions(+), 3 deletions(-) create mode 100644 ci/requirements/environment-3.12.yml create mode 100644 ci/requirements/environment-windows-3.12.yml diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index 6dfba9fa9e6..6e0472dedd9 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -44,7 +44,7 @@ jobs: matrix: os: ["ubuntu-latest", "macos-latest", "windows-latest"] # Bookend python versions - python-version: ["3.9", "3.11"] + python-version: ["3.9", "3.11", "3.12"] env: [""] include: # Minimum python version: @@ -71,7 +71,11 @@ jobs: if [[ ${{ matrix.os }} == windows* ]] ; then - echo "CONDA_ENV_FILE=ci/requirements/environment-windows.yml" >> $GITHUB_ENV + if [[ ${{ matrix.python-version }} != "3.12" ]]; then + echo "CONDA_ENV_FILE=ci/requirements/environment-windows.yml" >> $GITHUB_ENV + else + echo "CONDA_ENV_FILE=ci/requirements/environment-windows-3.12.yml" >> $GITHUB_ENV + fi elif [[ "${{ matrix.env }}" != "" ]] ; then if [[ "${{ matrix.env }}" == "flaky" ]] ; @@ -82,7 +86,11 @@ jobs: echo "CONDA_ENV_FILE=ci/requirements/${{ matrix.env }}.yml" >> $GITHUB_ENV fi else - echo "CONDA_ENV_FILE=ci/requirements/environment.yml" >> $GITHUB_ENV + if [[ ${{ matrix.python-version }} != "3.12" ]]; then + echo "CONDA_ENV_FILE=ci/requirements/environment.yml" >> $GITHUB_ENV + else + echo "CONDA_ENV_FILE=ci/requirements/environment-3.12.yml" >> $GITHUB_ENV + fi fi echo "PYTHON_VERSION=${{ matrix.python-version }}" >> $GITHUB_ENV diff --git a/ci/requirements/environment-3.12.yml b/ci/requirements/environment-3.12.yml new file mode 100644 index 00000000000..77b531951d9 --- /dev/null +++ b/ci/requirements/environment-3.12.yml @@ -0,0 +1,47 @@ +name: xarray-tests +channels: + - conda-forge + - nodefaults +dependencies: + - aiobotocore + - boto3 + - bottleneck + - cartopy + - cftime + - dask-core + - distributed + - flox + - fsspec!=2021.7.0 + - h5netcdf + - h5py + - hdf5 + - hypothesis + - iris + - lxml # Optional dep of pydap + - matplotlib-base + - nc-time-axis + - netcdf4 + # - numba + # - numbagg + - numexpr + - numpy + - opt_einsum + - packaging + - pandas + # - pint>=0.22 + - pip + - pooch + - pre-commit + - pydap + - pytest + - pytest-cov + - pytest-env + - pytest-xdist + - pytest-timeout + - rasterio + - scipy + - seaborn + # - sparse + - toolz + - typing_extensions + - zarr diff --git a/ci/requirements/environment-windows-3.12.yml b/ci/requirements/environment-windows-3.12.yml new file mode 100644 index 00000000000..a9424d71de2 --- /dev/null +++ b/ci/requirements/environment-windows-3.12.yml @@ -0,0 +1,42 @@ +name: xarray-tests +channels: + - conda-forge +dependencies: + - boto3 + - bottleneck + - cartopy + - cftime + - dask-core + - distributed + - flox + - fsspec!=2021.7.0 + - h5netcdf + - h5py + - hdf5 + - hypothesis + - iris + - lxml # Optional dep of pydap + - matplotlib-base + - nc-time-axis + - netcdf4 + # - numba + # - numbagg + - numpy + - packaging + - pandas + # - pint>=0.22 + - pip + - pre-commit + - pydap + - pytest + - pytest-cov + - pytest-env + - pytest-xdist + - pytest-timeout + - rasterio + - scipy + - seaborn + # - sparse + - toolz + - typing_extensions + - zarr diff --git a/pyproject.toml b/pyproject.toml index e59971df3a6..4e770a01e0f 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -12,6 +12,7 @@ classifiers = [ "Programming Language :: Python :: 3.9", "Programming Language :: Python :: 3.10", "Programming Language :: Python :: 3.11", + "Programming Language :: Python :: 3.12", "Topic :: Scientific/Engineering", ] description = "N-D labeled arrays and datasets in Python"