Repository: ungarj/mapchete (language: python)

Issue:
add/fix missing tests annotations, cleanup requirements.txt
* minor fix and maintenance
* See CHANGELOG.rst and update TBD release day when ready


Discussion / hints:

Fix patch:
diff --git a/CHANGELOG.rst b/CHANGELOG.rst
index e629ec99..d8bd8d01 100644
--- a/CHANGELOG.rst
+++ b/CHANGELOG.rst
@@ -2,6 +2,24 @@
 Changelog
 #########
 
+---------------------
+2024.7.1 - 2024-07-25
+---------------------
+
+* core
+
+  * fix annotation of `test/test_io_raster.py::test_read_raster` and split it into `test/test_io_raster.py::test_read_raster` and `test/test_io_raster.py::test_read_remote_raster`
+  * in `mapchete.geometry.types` try using `geojson-pydantic`
+
+* packaging
+  * replace `pydantic-geojson` with `geojson-pydantic`
+
+  * align dependencies `requirements.txt`, `requirements-dev.txt` with `pyproject.toml` with `hatch` package
+
+    * `hatch dep show requirements --all`
+    * `hatch dep show requirements --all >> requirements.txt`
+
+  * `requrements-dev.txt` still need to be managed manually when required
 
 ---------------------
 2024.7.0 - 2024-07-24
diff --git a/mapchete/__init__.py b/mapchete/__init__.py
index 6fef6a90..698d7390 100644
--- a/mapchete/__init__.py
+++ b/mapchete/__init__.py
@@ -32,7 +32,7 @@
     "VectorInput",
     "VectorInputGroup",
 ]
-__version__ = "2024.7.0"
+__version__ = "2024.7.1"
 
 logger = logging.getLogger(__name__)
 logger.addHandler(logging.NullHandler())
diff --git a/mapchete/geometry/types.py b/mapchete/geometry/types.py
index 172e2771..91b900e2 100644
--- a/mapchete/geometry/types.py
+++ b/mapchete/geometry/types.py
@@ -9,7 +9,7 @@
     runtime_checkable,
 )
 
-from pydantic_geojson import GeometryType as GeoJSONGeometryType
+from geojson_pydantic import FeatureCollection as GeoJSONGeometryType
 from shapely.geometry import (
     GeometryCollection,
     LinearRing,
diff --git a/pyproject.toml b/pyproject.toml
index a737aac6..e17c6450 100644
--- a/pyproject.toml
+++ b/pyproject.toml
@@ -29,12 +29,12 @@ dependencies = [
     "distributed",
     "fiona>=1.8.13.post1",
     "fsspec",
+    "geojson-pydantic",    
     "importlib-metadata",
     "importlib-resources",
     "numpy>=1.16",
     "oyaml",
     "pydantic>=2.3.0",
-    "pydantic-geojson",
     "pydantic_settings>=2.0.0",
     "pyproj",
     "python-dateutil",
diff --git a/requirements.txt b/requirements.txt
index ed08512a..745b4721 100644
--- a/requirements.txt
+++ b/requirements.txt
@@ -1,31 +1,40 @@
 aiobotocore>=1.1.2
-aiohttp>=3.6.2
-aioitertools>=0.7.0
+aiohttp
 boto3>=1.14.44
-cachetools>=4.1.0
+cachetools
+click-plugins
+click-spinner
 click>=7.1.1
-click-plugins>=1.1.1
-click-spinner>=0.1.10
 dask
 distributed
-python-dateutil
 fiona>=1.8.13.post1
-Flask>=1.1.2,<=3.0.0
-Flask-RangeRequest>=0.0.2
+flask-rangerequest
+flask<3.0.0
+fsspec
 fsspec[http,s3]>=2023.12.0
-importlib-metadata>=1.6.0
-importlib-resources>=1.5.0
-lxml>=4.5.0
-matplotlib>=3.2.1
+fsspec[http]
+fsspec[s3]
+geojson-pydantic
+importlib-metadata
+importlib-resources
+lxml
+matplotlib
+memray
 numpy>=1.16
-oyaml>=0.9
-pyproj
+oyaml
+pydantic-settings>=2.0.0
 pydantic>=2.3.0
-pydantic_settings>=2.0.0
-retry>=0.9.2
+pyproj
+pystac-client>=0.7.2
+pystac[urllib3]>=1.8.2
+python-dateutil
 rasterio>1.2.10
-s3fs>2023.9.0
-Shapely>=2.0.0
+requests
+retry
+rtree
+s3fs!=2023.9.0
+shapely>=2.0.0
+tilebench
 tilematrix>=2022.12.0
-tqdm>=4.46.0
-werkzeug>=0.15
\ No newline at end of file
+tqdm
+werkzeug>=0.15


Test patch:
diff --git a/test/test_io_raster.py b/test/test_io_raster.py
index 70370fe5..c0df7ebb 100644
--- a/test/test_io_raster.py
+++ b/test/test_io_raster.py
@@ -1056,9 +1056,6 @@ def test_read_raster_window_aws_s3(path, grid, pixelbuffer, zoom):
 @pytest.mark.parametrize(
     "path",
     [
-        lazy_fixture("raster_4band_s3"),
-        lazy_fixture("raster_4band_http"),
-        lazy_fixture("raster_4band_secure_http"),
         lazy_fixture("raster_4band"),
         lazy_fixture("stacta"),
     ],
@@ -1069,6 +1066,21 @@ def test_read_raster(path):
     assert not rr.data.mask.all()
 
 
+@pytest.mark.integration
+@pytest.mark.parametrize(
+    "path",
+    [
+        lazy_fixture("raster_4band_s3"),
+        lazy_fixture("raster_4band_http"),
+        lazy_fixture("raster_4band_secure_http"),
+    ],
+)
+def test_read_remote_raster(path):
+    rr = read_raster(path)
+    assert isinstance(rr, ReferencedRaster)
+    assert not rr.data.mask.all()
+
+
 @pytest.mark.parametrize("masked", [True, False])
 @pytest.mark.parametrize("grid", [lazy_fixture("s2_band_tile")])
 def test_read_raster_args(s2_band, masked, grid):