From 55538bae5264126fabd07e8853a03ec74b050c53 Mon Sep 17 00:00:00 2001 From: Deepak Cherian Date: Tue, 20 Aug 2024 19:20:50 -0600 Subject: [PATCH 1/6] Drop Python 3.9 --- .github/workflows/ci.yaml | 4 ++-- pyproject.toml | 3 +-- 2 files changed, 3 insertions(+), 4 deletions(-) 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/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", From 0aacaf42aeb51ee923718e60e3d63ff18a933ea8 Mon Sep 17 00:00:00 2001 From: Deepak Cherian Date: Tue, 20 Aug 2024 19:22:03 -0600 Subject: [PATCH 2/6] lint --- .pre-commit-config.yaml | 14 +++++++------- cf_xarray/accessor.py | 10 ++++++++-- cf_xarray/tests/test_accessor.py | 2 +- 3 files changed, 16 insertions(+), 10 deletions(-) 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/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..b59fa952 100644 --- a/cf_xarray/tests/test_accessor.py +++ b/cf_xarray/tests/test_accessor.py @@ -1125,7 +1125,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 From b069ae12c39169db538548f012d5bff9c8439f13 Mon Sep 17 00:00:00 2001 From: Deepak Cherian Date: Wed, 21 Aug 2024 09:34:00 -0600 Subject: [PATCH 3/6] fix test --- cf_xarray/tests/test_accessor.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/cf_xarray/tests/test_accessor.py b/cf_xarray/tests/test_accessor.py index b59fa952..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() From 48650f272448097452e180f16383296410563deb Mon Sep 17 00:00:00 2001 From: Deepak Cherian Date: Wed, 21 Aug 2024 09:51:06 -0600 Subject: [PATCH 4/6] try fixing docs --- .readthedocs.yml | 4 ++-- ci/doc.yml | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.readthedocs.yml b/.readthedocs.yml index c2cb5520..6e00d4fd 100644 --- a/.readthedocs.yml +++ b/.readthedocs.yml @@ -1,9 +1,9 @@ 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 diff --git a/ci/doc.yml b/ci/doc.yml index 361c02d2..59c5c0df 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 From d3f820fb18eeaf5e2cfd2da0ce9da5ba1f84b321 Mon Sep 17 00:00:00 2001 From: Deepak Cherian Date: Wed, 21 Aug 2024 10:06:59 -0600 Subject: [PATCH 5/6] list env explicitly --- .readthedocs.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.readthedocs.yml b/.readthedocs.yml index 6e00d4fd..2d66a4bd 100644 --- a/.readthedocs.yml +++ b/.readthedocs.yml @@ -10,6 +10,7 @@ build: pre_install: - conda list sphinx - conda list cf_xarray + - conda list conda: environment: ci/doc.yml From abfdfd50dbbd1b4281758b2e698cd63f1e56b3dd Mon Sep 17 00:00:00 2001 From: Deepak Cherian Date: Wed, 21 Aug 2024 10:10:44 -0600 Subject: [PATCH 6/6] pin furo --- ci/doc.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ci/doc.yml b/ci/doc.yml index 59c5c0df..22640931 100644 --- a/ci/doc.yml +++ b/ci/doc.yml @@ -20,7 +20,7 @@ dependencies: - pint - regex - shapely - - furo + - furo>=2024 - myst-nb - pip: - -e ../