diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 8c9b61a7364..1d4d6b302dd 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -8,12 +8,12 @@ repos: - id: check-yaml # isort should run before black as black sometimes tweaks the isort output - repo: https://github.com/PyCQA/isort - rev: 5.9.3 + rev: 5.10.0 hooks: - id: isort # https://github.com/python/black#version-control-integration - repo: https://github.com/psf/black - rev: 21.9b0 + rev: 21.10b0 hooks: - id: black - id: black-jupyter @@ -22,8 +22,8 @@ repos: hooks: - id: blackdoc exclude: "generate_reductions.py" - - repo: https://gitlab.com/pycqa/flake8 - rev: 3.9.2 + - repo: https://github.com/PyCQA/flake8 + rev: 4.0.1 hooks: - id: flake8 # - repo: https://github.com/Carreau/velin diff --git a/xarray/tests/test_distributed.py b/xarray/tests/test_distributed.py index 92f39069aa3..69318886409 100644 --- a/xarray/tests/test_distributed.py +++ b/xarray/tests/test_distributed.py @@ -2,14 +2,9 @@ import pickle import pytest - -dask = pytest.importorskip("dask") # isort:skip -distributed = pytest.importorskip("distributed") # isort:skip - from dask.distributed import Client, Lock -from distributed.utils_test import cluster, gen_cluster -from distributed.utils_test import loop from distributed.client import futures_of +from distributed.utils_test import cluster, gen_cluster, loop import xarray as xr from xarray.backends.locks import HDF5_LOCK, CombinedLock @@ -25,12 +20,16 @@ assert_allclose, has_h5netcdf, has_netCDF4, - requires_rasterio, has_scipy, - requires_zarr, requires_cfgrib, + requires_rasterio, + requires_zarr, ) +dask = pytest.importorskip("dask") # isort:skip +distributed = pytest.importorskip("distributed") # isort:skip + + # this is to stop isort throwing errors. May have been easier to just use # `isort:skip` in retrospect