r-earthengine / ee_extra

A ninja python package that unifies the Google Earth Engine ecosystem.
https://ee-extra.readthedocs.io/
Other
58 stars 10 forks source link

ee_extra is using pkg_resources as an API which is deprecated. #53

Open 12rambau opened 3 months ago

12rambau commented 3 months ago

I get the following error from multiple package CI/CD depending on ee_extra, I don't really know what to add, I'll have a look to your source code, I hope it's an easy fix.

========================================================================================================== warnings summary ===========================================================================================================
.nox/test/lib/python3.9/site-packages/ee_extra/ImageCollection/core.py:8
  /mnt/e/WSL/Users/rambap/azure/LDCGEETools/.nox/test/lib/python3.9/site-packages/ee_extra/ImageCollection/core.py:8: DeprecationWarning:

  pkg_resources is deprecated as an API. See https://setuptools.pypa.io/en/latest/pkg_resources.html
12rambau commented 3 months ago

I checked the lib and there is a very small amount of calls to package_resources and it's mostly used to access package files. I never used this interface myself, I always rely on the __file__ variable and it seems it's a very common practice in the Python community: https://discuss.python.org/t/easy-and-recommended-way-to-get-path-of-datafile-within-package/20581/8

Do you have any use case that would make it impossible ? It would simplify the code base and avoid calls to the importlib context manager.