[gdal-dev] Requiring numpy for the Python bindings

Sean Gillies sean.gillies at gmail.com
Mon Dec 4 15:47:38 PST 2023


For what it's worth, Rasterio has required Numpy for a few versions, and
there's never been a single complaint about it. The footprint and extra
complexity of numpy is just a drop in the bucket.

I suppose that someone using only the OGR parts of the Python bindings
might be inconvenienced, but not by much. And I suspect that the number of
these people who don't already have Numpy in their environment via
GeoPandas or Shapely is pretty small.

On Mon, Dec 4, 2023 at 3:52 PM Daniel Evans via gdal-dev <
gdal-dev at lists.osgeo.org> wrote:

> Agree with Kurt - it's always struck me as a little surprising that it was
> optional. There's also not very much of a Python stack you can build that
> involves GDAL but doesn't pull in Numpy through another dependency, as Even
> said.
>
> I would've thought that in any constrained environment where GDAL is
> required, but Numpy is too much of a overhead, that using Python would be a
> somewhat unusual choice to go with over the many other bindings that GDAL
> offers.
>
> Cheers,
> Daniel
>
> On Mon, 4 Dec 2023, 18:50 Kurt Schwehr via gdal-dev, <
> gdal-dev at lists.osgeo.org> wrote:
>
>> I lean towards just requiring numpy. It's super common and once a system
>> brings in gdal python, it can't be a super constrained env where keeping
>> things really small is critical. Just requiring numpy simplifies a number
>> of aspects.
>>
>> I think the setup.py topic as a whole is somewhat separate.l.  So
>> whichever way the numpy dep goes (required or optional), switching to
>> pyproject.toml seems important. I'm fairly new to pyproject.toml, so I
>> might be missing something.
>>
>> -Kurt
>>
>> On Mon, Dec 4, 2023 at 10:38 AM Even Rouault via gdal-dev <
>> gdal-dev at lists.osgeo.org> wrote:
>>
>>> Hi,
>>>
>>> The current situation where numpy is an optional dependency of the GDAL
>>> Python bindings is quite cumbersome to deal with our setup.py's
>>> setuptools . All details (a bit tricky) in
>>> https://github.com/OSGeo/gdal/issues/8069 . It seems it would be
>>> simpler
>>> if the bindings just required numpy, which is the confugration most
>>> people using the bindings likely actually end up using anyway.
>>>
>>> Any opposition to that?
>>>
>>> Even
>>>
>>>

-- 
Sean Gillies
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/gdal-dev/attachments/20231204/17433359/attachment.htm>


More information about the gdal-dev mailing list