From 43c40dbe771a3433c49b407b87a5966a503a6182 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Petr=20=C5=A0ev=C4=8D=C3=ADk?= Date: Thu, 25 Jul 2024 09:36:40 +0200 Subject: [PATCH] remove subdependancies from deps, replace pydatic-geojson with geojson pydantic, see if we can make this work --- .github/workflows/python-package.yml | 3 +-- CHANGELOG.rst | 2 ++ mapchete/geometry/types.py | 2 +- pyproject.toml | 4 +--- requirements.txt | 4 +--- 5 files changed, 6 insertions(+), 9 deletions(-) diff --git a/.github/workflows/python-package.yml b/.github/workflows/python-package.yml index 5d05e4c7..72699d67 100644 --- a/.github/workflows/python-package.yml +++ b/.github/workflows/python-package.yml @@ -45,10 +45,9 @@ jobs: sudo apt-add-repository -y ppa:ubuntugis/ubuntugis-unstable sudo apt-get -y update sudo apt-get install -y gdal-bin python-tk libgdal-dev libproj-dev libgeos-dev - GDAL_VERSION=`gdalinfo --version | grep -Eo "[0-9]\.[0-9]\.[0-9]+"` python -m pip install --upgrade pip wheel pip install -r test/requirements.txt - pip install gdal==${GDAL_VERSION} -e .[complete] + pip install -e .[complete] pip freeze - name: Start containers diff --git a/CHANGELOG.rst b/CHANGELOG.rst index b8429ca1..32ecc675 100644 --- a/CHANGELOG.rst +++ b/CHANGELOG.rst @@ -9,8 +9,10 @@ Changelog * 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 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 8d524b5f..e17c6450 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -29,13 +29,12 @@ dependencies = [ "distributed", "fiona>=1.8.13.post1", "fsspec", - "gdal>=3.6.4", + "geojson-pydantic", "importlib-metadata", "importlib-resources", "numpy>=1.16", "oyaml", "pydantic>=2.3.0", - "pydantic-geojson", "pydantic_settings>=2.0.0", "pyproj", "python-dateutil", @@ -80,7 +79,6 @@ profiling = [ ] s3 = [ "aiobotocore>=1.1.2", - "aioitertools>=0.7.0", "boto3>=1.14.44", "fsspec[s3]", "s3fs!=2023.9.0", diff --git a/requirements.txt b/requirements.txt index e2454fdf..745b4721 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,6 +1,5 @@ aiobotocore>=1.1.2 aiohttp -aioitertools>=0.7.0 boto3>=1.14.44 cachetools click-plugins @@ -15,7 +14,7 @@ fsspec fsspec[http,s3]>=2023.12.0 fsspec[http] fsspec[s3] -gdal>=3.6.4 +geojson-pydantic importlib-metadata importlib-resources lxml @@ -23,7 +22,6 @@ matplotlib memray numpy>=1.16 oyaml -pydantic-geojson pydantic-settings>=2.0.0 pydantic>=2.3.0 pyproj