diff --git a/CHANGES.md b/CHANGES.md index 7dfb166c..bedd16ca 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -77,6 +77,8 @@ * remove `minzoom` and `maxzoom` properties in `Info` model **breaking change** +* update `morecantile` dependency to allow `6.x` version + # 6.7.0 (2024-09-05) * raise `MissingCRS` or `InvalidGeographicBounds` errors when Xarray datasets have wrong geographic metadata diff --git a/pyproject.toml b/pyproject.toml index 48c7c02d..20ef9cba 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -26,7 +26,7 @@ dependencies = [ "httpx", "numexpr", "numpy", - "morecantile>=5.0,<6.0", + "morecantile>=5.0,<7.0", "pydantic~=2.0", "pystac>=0.5.4", "rasterio>=1.3.0", @@ -45,6 +45,8 @@ test = [ "rioxarray", # S3 "boto3", + # Some tests will fail with 5.0 + "morecantile>=6.0,<7.0", ] benchmark = [ diff --git a/tests/test_io_rasterio.py b/tests/test_io_rasterio.py index 195c54d5..c0a69d46 100644 --- a/tests/test_io_rasterio.py +++ b/tests/test_io_rasterio.py @@ -895,9 +895,17 @@ def test_nonearthbody(): """Reader should work with non-earth dataset.""" EUROPA_SPHERE = CRS.from_proj4("+proj=longlat +R=1560800 +no_defs") - with pytest.warns(UserWarning): - with Reader(COG_EUROPA) as src: + with Reader(COG_EUROPA) as src: + with pytest.warns( + UserWarning, + match="Cannot determine minzoom based on dataset information, will default to TMS minzoom.", + ): assert src.minzoom == 0 + + with pytest.warns( + UserWarning, + match="Cannot determine maxzoom based on dataset information, will default to TMS maxzoom.", + ): assert src.maxzoom == 24 # Warns because of zoom level in WebMercator can't be defined @@ -926,13 +934,12 @@ def test_nonearthbody(): lat = (src.bounds[1] + src.bounds[3]) / 2 assert src.point(lon, lat, coord_crs=src.crs).data[0] is not None - with pytest.warns(UserWarning): - europa_crs = CRS.from_authority("ESRI", 104915) - tms = TileMatrixSet.custom( - crs=europa_crs, - extent=europa_crs.area_of_use.bounds, - matrix_scale=[2, 1], - ) + europa_crs = CRS.from_authority("ESRI", 104915) + tms = TileMatrixSet.custom( + crs=europa_crs, + extent=europa_crs.area_of_use.bounds, + matrix_scale=[2, 1], + ) with Reader(COG_EUROPA, tms=tms) as src: assert src.info() @@ -966,11 +973,11 @@ def test_nonearth_custom(): MARS_MERCATOR, extent_crs=MARS2000_SPHERE, title="Web Mercator Mars", - geographic_crs=MARS2000_SPHERE, ) with Reader(COG_MARS, tms=mars_tms) as src: assert src.get_geographic_bounds(MARS2000_SPHERE)[0] > -180 + assert src.get_geographic_bounds(mars_tms.rasterio_geographic_crs)[0] > -180 def test_tms_tilesize_and_zoom():