developmentseed / landsat-util

A utility to search, download and process Landsat 8 satellite imagery
Creative Commons Zero v1.0 Universal
689 stars 147 forks source link

Very restrictive version pinning #223

Closed ocefpaf closed 6 years ago

ocefpaf commented 7 years ago

I understand that some people prefer an extreme version pinning of specific versions but that makes installing and packaging a nightmare. Specially when the package depends on some external libraries like gdal (via rasterio). It would be nice to get this reviewed and properly pinned only to the versions that are really needed due to API changes.

usgs==0.1.9
requests==2.7.0
python-dateutil==2.5.1
numpy==1.10.4
termcolor==1.1.0
rasterio==0.32.0
six>=1.8.0
scipy==0.17.0
scikit-image==0.12.3
homura==0.1.3
boto==2.39.0
polyline==1.3
geocoder==1.9.0
matplotlib==1.5.1
j08lue commented 7 years ago

One of the packages that certainly has breaking changes compared to the pinned version is rasterio, which is pinned to pre-1.0 and saw major API changes with the 1.0 release. Is anyone working on an update wrt rasterio yet?

It would be great to get an overview of which of the other packages have breaking changes. Ideally, the tests should reveal that if you release all the pins and test with the newest versions of all packages.

drewbo commented 7 years ago

We've been a little slow on updates recently but will try to check this out at some point, especially once rasterio gets out of the 1.0 alpha releases

astrojuanlu commented 7 years ago

We've been a little slow on updates recently but will try to check this out at some point, especially once rasterio gets out of the 1.0 alpha releases

In particular https://mapbox.github.io/rasterio/topics/migrating-to-v1.html#removed-rasterio-warp-resampling, which causes an error in landsat-util.

Traceback (most recent call last):
  File "/opt/conda/bin/landsat", line 7, in <module>
    from landsat.landsat import __main__
  File "/opt/conda/lib/python3.5/site-packages/landsat/landsat.py", line 29, in <module>
    from .image import Simple, PanSharpen, FileDoesNotExist
  File "/opt/conda/lib/python3.5/site-packages/landsat/image.py", line 18, in <module>
    from rasterio.warp import reproject, RESAMPLING, transform, transform_bounds
ImportError: cannot import name 'RESAMPLING'

However, the issue "landsat-util does not work with latest rasterio" is different than this one. I agree landsat-util could be more flexible specifying the version of its dependencies, but with the current state of affairs that would still mean writing rasterio<1* (instead of the current rasterio==0.32.0).

astrojuanlu commented 7 years ago

@drewbo Would you accept a pull request loosing a bit the requirements? I can try with different versions to check that everything works, and maybe update the Dockerfile too (#226). We can think of migrating to rasterio 1.0 at a later stage.

drewbo commented 7 years ago

Yup @Juanlu001 happy to take a look