odc-stac icon indicating copy to clipboard operation
odc-stac copied to clipboard

Dependency issues with Dask and Python 3.8

Open robbibt opened this issue 5 months ago • 1 comments

Hi all, setup.cfg specifies that odc-stac supports Python 3.8: https://github.com/opendatacube/odc-stac/blob/develop/setup.cfg#L33

However, I'm having dependency issues with Dask when trying to build an environment that works with 3.8. The latest version of Dask that supports Python 3.8 is dask==v2023-5-0: https://docs.dask.org/en/stable/changelog.html#v2023-5-1

However, if I try and use dask==2023.5.0 with odc-stac, I get the following error:

import odc.stac

Traceback:
/opt/hostedtoolcache/Python/3.8.18/x64/lib/python3.8/importlib/__init__.py:127: in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
tests/test_foo.py:5: in <module>
    import odc.stac
.venv/lib/python3.8/site-packages/odc/stac/__init__.py:4: in <module>
    from odc.loader._rio import configure_rio, configure_s3_access
.venv/lib/python3.8/site-packages/odc/loader/__init__.py:5: in <module>
    from ._builder import chunked_load, resolve_chunk_shape
.venv/lib/python3.8/site-packages/odc/loader/_builder.py:[32](https://github.com/robbibt/eo-tides/actions/runs/10757894621/job/29832491543#step:5:33): in <module>
    from dask.typing import Key
E   ImportError: cannot import name 'Key' from 'dask.typing' (/home/runner/work/eo-tides/eo-tides/.venv/lib/python3.8/site-packages/dask/typing.py)

Which I think is because Key was only added in this commit: https://github.com/dask/dask/commit/b015ea8bf87f4c525379719f8a1cf2851c55bb58#diff-4ca1f6adfeb89f24ac8297d11e1b911ffa6243bbf12f1b17fa556bae1f93c7a2R19

Does the minimum Python version for odc-stac need to be increased to 3.9? Or is there a workaround so that we can use an older version of Dask for Python 3.8?

robbibt avatar Sep 08 '24 07:09 robbibt