Repository: pydap/pydap (python)

Issue:
Deprecations about imports from collections
The `Mapping` import causes a deprecation warning and will be removed in 3.9:
```
.../pydap/model.py:175
  .../pydap/model.py:175: DeprecationWarning: Using or importing the ABCs from 'collections' instead of from 'collections.abc' is deprecated, and in 3.8 it will stop working
    from collections import OrderedDict, Mapping
```
Also, `Iterable`:
```
.../pydap/responses/das.py:14
  .../pydap/responses/das.py:14: DeprecationWarning: Using or importing the ABCs from 'collections' instead of from 'collections.abc' is deprecated, and in 3.8 it will stop working
    from collections import Iterable
```

Pull request description:
Import ABC from collections.abc instead of collections for Python 3 compatibility
Fixes #203 

Import ABC from collections.abc instead of collections for Python 3 compatibility.

This is the same as #210. Resubmitting it as a new PR to get GitHub actions CI to run on it.

Patch:
diff --git a/.github/workflows/python.yml b/.github/workflows/python.yml
index 22b5f4c..993ec6b 100644
--- a/.github/workflows/python.yml
+++ b/.github/workflows/python.yml
@@ -10,12 +10,16 @@ on:
 jobs:
   build:
     runs-on: ubuntu-latest
+    strategy:
+      matrix:
+        python-version: [ '3.x', '3.6', '3.7', '3.8', '3.9' ]
+    name: Python ${{ matrix.python-version }} 
     steps:
       - uses: actions/checkout@v2
       - name: Install Python 3
         uses: actions/setup-python@v1
         with:
-          python-version: 3.6
+          python-version: ${{ matrix.python-version }}
       - name: Install dependencies
         run: |
           pip3 install -U pip setuptools
diff --git a/src/pydap/model.py b/src/pydap/model.py
index 330f0e8..b9fc0fe 100644
--- a/src/pydap/model.py
+++ b/src/pydap/model.py
@@ -172,9 +172,12 @@ import copy
 from six.moves import reduce, map
 from six import string_types
 import numpy as np
-from collections import OrderedDict, Mapping
+from collections import OrderedDict
 import warnings
-
+try:
+    from collections.abc import Mapping
+except ImportError:
+    from collections import Mapping
 from .lib import quote, decode_np_strings
 
 
diff --git a/src/pydap/responses/das.py b/src/pydap/responses/das.py
index 791730a..7d41e9a 100644
--- a/src/pydap/responses/das.py
+++ b/src/pydap/responses/das.py
@@ -11,8 +11,10 @@ try:
     from functools import singledispatch
 except ImportError:
     from singledispatch import singledispatch
-from collections import Iterable
-
+try:
+    from collections.abc import Iterable
+except ImportError:
+    from collections import Iterable
 from six import string_types, integer_types
 from six.moves import map
 


Test patch:
diff --git a/src/pydap/tests/test_model.py b/src/pydap/tests/test_model.py
index da1c2d2..5b6dec7 100644
--- a/src/pydap/tests/test_model.py
+++ b/src/pydap/tests/test_model.py
@@ -176,7 +176,10 @@ def test_StructureType_init():
 def test_StructureType_instance():
     """Test that it is a Mapping and DapType."""
     var = StructureType("var")
-    from collections import Mapping
+    try:
+       from collections.abc import Mapping
+    except ImportError:
+       from collections import Mapping
     assert isinstance(var, Mapping)
     assert isinstance(var, DapType)