diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index 1cd7461f..d2b600e0 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -27,7 +27,7 @@ jobs: fail-fast: false matrix: os: ["ubuntu-latest"] - python-version: ["3.9", "3.12"] + python-version: ["3.10", "3.12"] steps: - uses: actions/checkout@v4 with: @@ -91,7 +91,7 @@ jobs: shell: bash -l {0} strategy: matrix: - python-version: ["3.9", "3.12"] + python-version: ["3.10", "3.12"] steps: - uses: actions/checkout@v4 with: diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 1a52d50f..335204fd 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -3,25 +3,25 @@ ci: repos: - repo: https://github.com/asottile/pyupgrade - rev: v3.16.0 + rev: v3.17.0 hooks: - id: pyupgrade - args: ["--py39-plus"] + args: ["--py310-plus"] - repo: https://github.com/astral-sh/ruff-pre-commit # Ruff version. - rev: 'v0.5.0' + rev: 'v0.6.1' hooks: - id: ruff args: ["--show-fixes", "--fix"] - repo: https://github.com/psf/black-pre-commit-mirror - rev: 24.4.2 + rev: 24.8.0 hooks: - id: black - repo: https://github.com/rstcheck/rstcheck - rev: v6.2.0 + rev: v6.2.4 hooks: - id: rstcheck additional_dependencies: [sphinx, tomli] @@ -36,7 +36,7 @@ repos: - mdformat-myst - repo: https://github.com/nbQA-dev/nbQA - rev: 1.8.5 + rev: 1.8.7 hooks: - id: nbqa-black - id: nbqa-ruff @@ -67,7 +67,7 @@ repos: - id: validate-cff - repo: https://github.com/abravalheri/validate-pyproject - rev: v0.18 + rev: v0.19 hooks: - id: validate-pyproject diff --git a/.readthedocs.yml b/.readthedocs.yml index c2cb5520..2d66a4bd 100644 --- a/.readthedocs.yml +++ b/.readthedocs.yml @@ -1,15 +1,16 @@ version: 2 build: - os: ubuntu-22.04 + os: ubuntu-lts-latest tools: - python: mambaforge-4.10 + python: mambaforge-latest jobs: post_checkout: - (git --no-pager log --pretty="tformat:%s" -1 | grep -vqF "[skip-rtd]") || exit 183 pre_install: - conda list sphinx - conda list cf_xarray + - conda list conda: environment: ci/doc.yml diff --git a/cf_xarray/accessor.py b/cf_xarray/accessor.py index a915335b..0aa4ceef 100644 --- a/cf_xarray/accessor.py +++ b/cf_xarray/accessor.py @@ -5,11 +5,17 @@ import itertools import re from collections import ChainMap, namedtuple -from collections.abc import Hashable, Iterable, Mapping, MutableMapping, Sequence +from collections.abc import ( + Callable, + Hashable, + Iterable, + Mapping, + MutableMapping, + Sequence, +) from datetime import datetime from typing import ( Any, - Callable, Literal, TypeVar, Union, diff --git a/cf_xarray/tests/test_accessor.py b/cf_xarray/tests/test_accessor.py index 5cc58688..596897d7 100644 --- a/cf_xarray/tests/test_accessor.py +++ b/cf_xarray/tests/test_accessor.py @@ -57,6 +57,8 @@ dataarrays = [airds.air, airds.air.chunk({"lat": 5})] objects = datasets + dataarrays +xr.set_options(use_flox=False) + def assert_dicts_identical(dict1, dict2): assert dict1.keys() == dict2.keys() @@ -1125,7 +1127,7 @@ def _check_attrs_equal(o, n): else: assert v == n[k] - assert type(old) == type(new) + assert type(old) == type(new) # noqa _check_attrs_equal(old.attrs, new.attrs) # Check coordinate attributes and data variable attributes diff --git a/ci/doc.yml b/ci/doc.yml index 361c02d2..22640931 100644 --- a/ci/doc.yml +++ b/ci/doc.yml @@ -3,7 +3,7 @@ channels: - conda-forge dependencies: - pip - - python=3.10 + - python - matplotlib-base - netcdf4 - pooch @@ -20,7 +20,7 @@ dependencies: - pint - regex - shapely - - furo + - furo>=2024 - myst-nb - pip: - -e ../ diff --git a/pyproject.toml b/pyproject.toml index 8eccfc66..f97edc00 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -2,7 +2,7 @@ name = "cf_xarray" description = "A convenience wrapper for using CF attributes on xarray objects" readme = "README.rst" -requires-python = ">=3.9" +requires-python = ">=3.10" license = {file = "LICENSE"} keywords = ["xarray", "metadata", "CF conventions"] classifiers = [ @@ -11,7 +11,6 @@ classifiers = [ "Natural Language :: English", "Operating System :: OS Independent", "Programming Language :: Python", - "Programming Language :: Python :: 3.9", "Programming Language :: Python :: 3.10", "Programming Language :: Python :: 3.11", "Programming Language :: Python :: 3.12",