Skip to content

Commit

Permalink
Drop Python 3.9 (#530)
Browse files Browse the repository at this point in the history
* Drop Python 3.9

* lint

* fix test

* try fixing docs

* list env explicitly

* pin furo
  • Loading branch information
dcherian authored Aug 21, 2024
1 parent 8102e18 commit acc1eb0
Show file tree
Hide file tree
Showing 7 changed files with 26 additions and 18 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down Expand Up @@ -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:
Expand Down
14 changes: 7 additions & 7 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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]
Expand All @@ -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
Expand Down Expand Up @@ -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

Expand Down
5 changes: 3 additions & 2 deletions .readthedocs.yml
Original file line number Diff line number Diff line change
@@ -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
Expand Down
10 changes: 8 additions & 2 deletions cf_xarray/accessor.py
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
4 changes: 3 additions & 1 deletion cf_xarray/tests/test_accessor.py
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down Expand Up @@ -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
Expand Down
4 changes: 2 additions & 2 deletions ci/doc.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ channels:
- conda-forge
dependencies:
- pip
- python=3.10
- python
- matplotlib-base
- netcdf4
- pooch
Expand All @@ -20,7 +20,7 @@ dependencies:
- pint
- regex
- shapely
- furo
- furo>=2024
- myst-nb
- pip:
- -e ../
3 changes: 1 addition & 2 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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 = [
Expand All @@ -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",
Expand Down

0 comments on commit acc1eb0

Please sign in to comment.