GeoscienceAustralia / ga_sar_workflow

InSAR processing workflow used by Geoscience Australia
Apache License 2.0
3 stars 1 forks source link

Fix collections/abc module related deprecation warnings #331

Closed truth-quark closed 2 years ago

truth-quark commented 2 years ago

For python3.3+ but breaking in py3.10 onward, there are changes to importing some of the collections modules, specifically the Sequence class.

DeprecationWarning: Using or importing the ABCs from 'collections' instead of from 'collections.abc' is deprecated since Python 3.3, and in 3.10 it will stop working

Usages (from gamma_insar project dir):

$ grep --include="*.py" -rn Sequence .
./tests/test_py_gamma_ga.py:4:from collections import Sequence, namedtuple
./tests/test_py_gamma_ga.py:17:    assert isinstance(pkgs, Sequence)
./tests/py_gamma_test_proxy.py:2:from typing import Sequence, NamedTuple, Dict, Optional
./tests/py_gamma_test_proxy.py:45:    call_sequence: Sequence[PyGammaCall]
./tests/test_process_ifg.py:419:    :param fake_content: Sequence of values for file.readlines() to emit
./utils/gamma_usage2py.py:236:                "from typing import Sequence, NamedTuple, Dict, Optional",
./utils/gamma_usage2py.py:285:                "call_sequence: Sequence[PyGammaCall]",

Fixing this will also clean up some of the warnings appearing in pytest.

truth-quark commented 2 years ago

Resolved in #332