Skip to content

Make rasterio (and GDAL) an optional dependency (move it to extras_require) #2392

Description

@jorgejesus

Looking at requirements.txt

rasterio

We have rasterio as dependency on every pip install pygeoapi pulls in rasterio (that is a big GDAL binary wheel)

But rasterio is used by only three providers:

So this bloats the base install and minimal container images.

The proposed slim/distroless Docker vaiants in #1753 only avoid it via a pip install --no-deps workaround and explicit dependency list

 #Add it as an extra in setup.py:
  extras_require={
      'rasterio': ['rasterio'],
  },

And remove it from requirements.txt

  • Keep rasterio available to CI/tests by listing it in requirements-dev.txt (or requirements-provider.txt) so the Rasterio provider is still exercised.
  • Ensure rasterio_.py degrades gracefully when rasterio is absent (the plugin loader should already surface a clear "provider unavailable" error; the two lazy importers already do the right thing).

So:

  • pip install pygeoapi -> GDAL-free
  • pip install pygeoapi[rasterio] - >raster/coverage support

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions