Skip to content
forked from pydata/xarray

Commit

Permalink
Merge branch 'main' into depr-groupby-squeeze-2
Browse files Browse the repository at this point in the history
  • Loading branch information
dcherian authored Jan 3, 2024
2 parents 33c8033 + 41d33f5 commit 0a0f800
Show file tree
Hide file tree
Showing 3 changed files with 26 additions and 13 deletions.
9 changes: 4 additions & 5 deletions .github/workflows/ci-additional.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -76,11 +76,10 @@ jobs:
# Raise an error if there are warnings in the doctests, with `-Werror`.
# This is a trial; if it presents an problem, feel free to remove.
# See https://github.com/pydata/xarray/issues/7164 for more info.
# ignores:
# 1. h5py: see https://github.com/pydata/xarray/issues/8537
python -m pytest --doctest-modules xarray --ignore xarray/tests -Werror \
-W "ignore:h5py is running against HDF5 1.14.3:UserWarning"
#
# If dependencies emit warnings we can't do anything about, add ignores to
# `xarray/tests/__init__.py`.
python -m pytest --doctest-modules xarray --ignore xarray/tests -Werror
mypy:
name: Mypy
Expand Down
10 changes: 5 additions & 5 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -18,24 +18,24 @@ repos:
files: ^xarray/
- repo: https://github.com/astral-sh/ruff-pre-commit
# Ruff version.
rev: 'v0.1.6'
rev: 'v0.1.9'
hooks:
- id: ruff
args: ["--fix"]
# https://github.com/python/black#version-control-integration
- repo: https://github.com/psf/black
rev: 23.11.0
- repo: https://github.com/psf/black-pre-commit-mirror
rev: 23.12.1
hooks:
- id: black-jupyter
- repo: https://github.com/keewis/blackdoc
rev: v0.3.9
hooks:
- id: blackdoc
exclude: "generate_aggregations.py"
additional_dependencies: ["black==23.11.0"]
additional_dependencies: ["black==23.12.1"]
- id: blackdoc-autoupdate-black
- repo: https://github.com/pre-commit/mirrors-mypy
rev: v1.7.1
rev: v1.8.0
hooks:
- id: mypy
# Copied from setup.cfg
Expand Down
20 changes: 17 additions & 3 deletions xarray/tests/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -71,10 +71,17 @@ def _importorskip(
message="'cgi' is deprecated and slated for removal in Python 3.13",
category=DeprecationWarning,
)

has_pydap, requires_pydap = _importorskip("pydap.client")
has_netCDF4, requires_netCDF4 = _importorskip("netCDF4")
has_h5netcdf, requires_h5netcdf = _importorskip("h5netcdf")
with warnings.catch_warnings():
# see https://github.com/pydata/xarray/issues/8537
warnings.filterwarnings(
"ignore",
message="h5py is running against HDF5 1.14.3",
category=UserWarning,
)

has_h5netcdf, requires_h5netcdf = _importorskip("h5netcdf")
has_pynio, requires_pynio = _importorskip("Nio")
has_cftime, requires_cftime = _importorskip("cftime")
has_dask, requires_dask = _importorskip("dask")
Expand All @@ -84,7 +91,14 @@ def _importorskip(
has_fsspec, requires_fsspec = _importorskip("fsspec")
has_iris, requires_iris = _importorskip("iris")
has_numbagg, requires_numbagg = _importorskip("numbagg", "0.4.0")
has_seaborn, requires_seaborn = _importorskip("seaborn")
with warnings.catch_warnings():
warnings.filterwarnings(
"ignore",
message="is_categorical_dtype is deprecated and will be removed in a future version.",
category=DeprecationWarning,
)
# seaborn uses the deprecated `pandas.is_categorical_dtype`
has_seaborn, requires_seaborn = _importorskip("seaborn")
has_sparse, requires_sparse = _importorskip("sparse")
has_cupy, requires_cupy = _importorskip("cupy")
has_cartopy, requires_cartopy = _importorskip("cartopy")
Expand Down

0 comments on commit 0a0f800

Please sign in to comment.