Repository: opendatacube/odc-stac (language: python)

Issue:
xarray 2022.10.0 breaks odc-stac
The newest version of xarray (2022.10.0) seems to have breaking changes for odc-stac (0.3.2). On import, I get the error below. It looks like this commit refactored that file and moved DTypeLike out of xarray.core.noncompat: https://github.com/pydata/xarray/commit/242d87dec31e5d2485e4164bdfaafba69fb0ab2f

```File /opt/conda/lib/python3.10/site-packages/odc/stac/__init__.py:3
      1 """STAC Item -> ODC Dataset[eo3]."""
      2 from ._version import __version__  # isort:skip  this has to be 1st import
----> 3 from ._load import load
      4 from ._mdtools import ConversionConfig
      5 from ._model import (
      6     RasterBandMetadata,
      7     RasterCollectionMetadata,
      8     RasterLoadParams,
      9     RasterSource,
     10 )

File /opt/conda/lib/python3.10/site-packages/odc/stac/_load.py:34
     32 from odc.geo.types import Unset
     33 from odc.geo.xr import xr_coords
---> 34 from xarray.core.npcompat import DTypeLike
     36 from ._dask import unpack_chunks
     37 from ._mdtools import ConversionConfig, output_geobox, parse_items, with_default

ImportError: cannot import name 'DTypeLike' from 'xarray.core.npcompat' (/opt/conda/lib/python3.10/site-packages/xarray/core/npcompat.py)```





Discussion / hints:

Fix patch:
diff --git a/odc/stac/_load.py b/odc/stac/_load.py
index d0f498d..c9b5bb8 100644
--- a/odc/stac/_load.py
+++ b/odc/stac/_load.py
@@ -31,7 +31,7 @@
 from odc.geo.geobox import GeoBox, GeoboxAnchor, GeoboxTiles
 from odc.geo.types import Unset
 from odc.geo.xr import xr_coords
-from xarray.core.npcompat import DTypeLike
+from numpy.typing import DTypeLike
 
 from ._dask import unpack_chunks
 from ._mdtools import ConversionConfig, output_geobox, parse_items, with_default
diff --git a/setup.cfg b/setup.cfg
index 84b1f0e..b8060bc 100644
--- a/setup.cfg
+++ b/setup.cfg
@@ -40,7 +40,7 @@ install_requires =
     odc-geo>=0.3.0
     rasterio>=1.0.0,!=1.3.0,!=1.3.1
     dask[array]
-    numpy
+    numpy>=1.20.0
     pandas
     pystac>=1.0.0,<2
     toolz
@@ -55,4 +55,4 @@ include =
 
 [options.package_data]
 odc.stac =
-  py.typed
\ No newline at end of file
+  py.typed


Test patch:
diff --git a/tests/test-env-py38.yml b/tests/test-env-py38.yml
index 2f2f656..61e6d75 100644
--- a/tests/test-env-py38.yml
+++ b/tests/test-env-py38.yml
@@ -16,8 +16,9 @@ dependencies:
   - pandas
   - pystac
   - toolz
-  - xarray ~=0.20.1
-  - rasterio ==1.3.2
+  - dask ==2022.10.0
+  - xarray ==2022.10.0
+  - rasterio ==1.3.3
 
   # For mypy
   - types-python-dateutil
@@ -49,7 +50,7 @@ dependencies:
   - pyupgrade
   - libcst
   - mypy
-  - pylint
+  - pylint ==2.15.4
 
   - pip =20
   - pip: