diff --git a/.github/workflows/ci-additional.yaml b/.github/workflows/ci-additional.yaml index 0fcba9d5499..7b248b14006 100644 --- a/.github/workflows/ci-additional.yaml +++ b/.github/workflows/ci-additional.yaml @@ -41,7 +41,7 @@ jobs: shell: bash -l {0} env: CONDA_ENV_FILE: ci/requirements/environment.yml - PYTHON_VERSION: "3.11" + PYTHON_VERSION: "3.12" steps: - uses: actions/checkout@v4 with: @@ -205,7 +205,7 @@ jobs: shell: bash -l {0} env: CONDA_ENV_FILE: ci/requirements/environment.yml - PYTHON_VERSION: "3.10" + PYTHON_VERSION: "3.12" steps: - uses: actions/checkout@v4 @@ -330,7 +330,7 @@ jobs: with: environment-name: xarray-tests create-args: >- - python=3.11 + python=3.12 pyyaml conda python-dateutil diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index e970bc8efc3..a577312a7cc 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", "3.12"] + python-version: ["3.9", "3.12"] env: [""] include: # Minimum python version: @@ -56,10 +56,11 @@ jobs: os: ubuntu-latest # Latest python version: - env: "all-but-dask" - python-version: "3.10" + # Not 3.12 because of pint + python-version: "3.11" os: ubuntu-latest - env: "flaky" - python-version: "3.10" + python-version: "3.12" os: ubuntu-latest steps: - uses: actions/checkout@v4 @@ -71,30 +72,30 @@ jobs: if [[ ${{ matrix.os }} == windows* ]] ; then - if [[ ${{ matrix.python-version }} != "3.12" ]]; then + if [[ ${{ matrix.python-version }} != "3.13" ]]; 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 + echo "CONDA_ENV_FILE=ci/requirements/environment-windows-3.13.yml" >> $GITHUB_ENV fi elif [[ "${{ matrix.env }}" != "" ]] ; then if [[ "${{ matrix.env }}" == "flaky" ]] ; then echo "CONDA_ENV_FILE=ci/requirements/environment.yml" >> $GITHUB_ENV - echo "PYTEST_EXTRA_FLAGS=--run-flaky --run-network-tests -W default" >> $GITHUB_ENV + echo "PYTEST_ADDOPTS=-m 'flaky or network' --run-flaky --run-network-tests -W default" >> $GITHUB_ENV else echo "CONDA_ENV_FILE=ci/requirements/${{ matrix.env }}.yml" >> $GITHUB_ENV fi if [[ "${{ matrix.env }}" == "min-all-deps" ]] ; then # Don't raise on warnings - echo "PYTEST_EXTRA_FLAGS=-W default" >> $GITHUB_ENV + echo "PYTEST_ADDOPTS=-W default" >> $GITHUB_ENV fi else - if [[ ${{ matrix.python-version }} != "3.12" ]]; then + if [[ ${{ matrix.python-version }} != "3.13" ]]; then echo "CONDA_ENV_FILE=ci/requirements/environment.yml" >> $GITHUB_ENV else - echo "CONDA_ENV_FILE=ci/requirements/environment-3.12.yml" >> $GITHUB_ENV + echo "CONDA_ENV_FILE=ci/requirements/environment-3.13.yml" >> $GITHUB_ENV fi fi @@ -114,7 +115,7 @@ jobs: # We only want to install this on one run, because otherwise we'll have # duplicate annotations. - name: Install error reporter - if: ${{ matrix.os }} == 'ubuntu-latest' and ${{ matrix.python-version }} == '3.10' + if: ${{ matrix.os }} == 'ubuntu-latest' and ${{ matrix.python-version }} == '3.12' run: | python -m pip install pytest-github-actions-annotate-failures @@ -146,7 +147,6 @@ jobs: --cov=xarray --cov-report=xml --junitxml=pytest.xml - $PYTEST_EXTRA_FLAGS - name: Upload test results if: always() diff --git a/.github/workflows/pypi-release.yaml b/.github/workflows/pypi-release.yaml index 354a8b59d4e..e7aec6e8f39 100644 --- a/.github/workflows/pypi-release.yaml +++ b/.github/workflows/pypi-release.yaml @@ -18,7 +18,7 @@ jobs: - uses: actions/setup-python@v5 name: Install Python with: - python-version: "3.11" + python-version: "3.12" - name: Install dependencies run: | @@ -53,7 +53,7 @@ jobs: - uses: actions/setup-python@v5 name: Install Python with: - python-version: "3.11" + python-version: "3.12" - uses: actions/download-artifact@v4 with: name: releases diff --git a/ci/requirements/environment-3.12.yml b/ci/requirements/environment-3.13.yml similarity index 100% rename from ci/requirements/environment-3.12.yml rename to ci/requirements/environment-3.13.yml diff --git a/ci/requirements/environment-windows-3.12.yml b/ci/requirements/environment-windows-3.13.yml similarity index 100% rename from ci/requirements/environment-windows-3.12.yml rename to ci/requirements/environment-windows-3.13.yml diff --git a/ci/requirements/environment-windows.yml b/ci/requirements/environment-windows.yml index c1027b525d0..3b2e6dc62e6 100644 --- a/ci/requirements/environment-windows.yml +++ b/ci/requirements/environment-windows.yml @@ -26,7 +26,7 @@ dependencies: - numpy - packaging - pandas - - pint>=0.22 + # - pint>=0.22 - pip - pre-commit - pydap diff --git a/ci/requirements/environment.yml b/ci/requirements/environment.yml index d3dbc088867..01521e950f4 100644 --- a/ci/requirements/environment.yml +++ b/ci/requirements/environment.yml @@ -30,7 +30,7 @@ dependencies: - opt_einsum - packaging - pandas - - pint>=0.22 + # - pint>=0.22 - pip - pooch - pre-commit diff --git a/pyproject.toml b/pyproject.toml index 00348ba7fb4..d2b4b57e0bf 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -117,13 +117,13 @@ module = [ "iris.*", "matplotlib.*", "mpl_toolkits.*", - "Nio.*", "nc_time_axis.*", "numbagg.*", "netCDF4.*", "netcdftime.*", "opt_einsum.*", "pandas.*", + "pint.*", "pooch.*", "pyarrow.*", "pydap.*", diff --git a/xarray/tests/test_backends.py b/xarray/tests/test_backends.py index bfa26025fd8..fdf181b583a 100644 --- a/xarray/tests/test_backends.py +++ b/xarray/tests/test_backends.py @@ -2988,14 +2988,6 @@ def test_chunked_cftime_datetime(self) -> None: assert original[name].chunks == actual_var.chunks assert original.chunks == actual.chunks - def test_vectorized_indexing_negative_step(self) -> None: - if not has_dask: - pytest.xfail( - reason="zarr without dask handles negative steps in slices incorrectly" - ) - - super().test_vectorized_indexing_negative_step() - @requires_zarr class TestZarrDictStore(ZarrBase): @@ -3821,6 +3813,7 @@ def skip_if_not_engine(engine): pytest.importorskip(engine) +# Flaky test. Very open to contributions on fixing this @requires_dask @pytest.mark.filterwarnings("ignore:use make_scale(name) instead") @pytest.mark.xfail(reason="Flaky test. Very open to contributions on fixing this") @@ -4523,7 +4516,8 @@ def test_open_multi_dataset(self) -> None: ) as actual: assert_identical(expected, actual) - @pytest.mark.xfail(reason="Flaky test. Very open to contributions on fixing this") + # Flaky test. Very open to contributions on fixing this + @pytest.mark.flaky def test_dask_roundtrip(self) -> None: with create_tmp_file() as tmp: data = create_test_data() diff --git a/xarray/tests/test_plugins.py b/xarray/tests/test_plugins.py index 8e1eb616cca..46051f040ce 100644 --- a/xarray/tests/test_plugins.py +++ b/xarray/tests/test_plugins.py @@ -228,7 +228,6 @@ def test_lazy_import() -> None: "matplotlib", "nc_time_axis", "netCDF4", - "Nio", "numbagg", "pint", "pydap", diff --git a/xarray/util/print_versions.py b/xarray/util/print_versions.py index 4c715437588..0b2e2b051ae 100755 --- a/xarray/util/print_versions.py +++ b/xarray/util/print_versions.py @@ -104,7 +104,6 @@ def show_versions(file=sys.stdout): ("pydap", lambda mod: mod.__version__), ("h5netcdf", lambda mod: mod.__version__), ("h5py", lambda mod: mod.__version__), - ("Nio", lambda mod: mod.__version__), ("zarr", lambda mod: mod.__version__), ("cftime", lambda mod: mod.__version__), ("nc_time_axis", lambda mod: mod.__version__),