Merge pull request #1486 from jjardon/jjardon/bst-1-collections

bst-1: Use collections.abc instead collections
diff --git a/buildstream/_artifactcache/artifactcache.py b/buildstream/_artifactcache/artifactcache.py
index 00c1707..4f710ac 100644
--- a/buildstream/_artifactcache/artifactcache.py
+++ b/buildstream/_artifactcache/artifactcache.py
@@ -21,7 +21,8 @@
 import os
 import signal
 import string
-from collections import Mapping, namedtuple
+from collections import namedtuple
+from collections.abc import Mapping
 
 from ..types import _KeyStrength
 from .._exceptions import ArtifactError, CASError, LoadError, LoadErrorReason
diff --git a/buildstream/_context.py b/buildstream/_context.py
index e26f65b..5917645 100644
--- a/buildstream/_context.py
+++ b/buildstream/_context.py
@@ -19,7 +19,8 @@
 
 import os
 import datetime
-from collections import deque, Mapping
+from collections import deque
+from collections.abc import Mapping
 from contextlib import contextmanager
 from . import utils
 from . import _cachekey
diff --git a/buildstream/_includes.py b/buildstream/_includes.py
index e6f32ca..fc609ca 100644
--- a/buildstream/_includes.py
+++ b/buildstream/_includes.py
@@ -1,5 +1,5 @@
 import os
-from collections import Mapping
+from collections.abc import Mapping
 from . import _yaml
 from ._exceptions import LoadError, LoadErrorReason
 
diff --git a/buildstream/_loader/loader.py b/buildstream/_loader/loader.py
index df272df..0cc18dc 100644
--- a/buildstream/_loader/loader.py
+++ b/buildstream/_loader/loader.py
@@ -19,7 +19,8 @@
 
 import os
 from functools import cmp_to_key
-from collections import Mapping, namedtuple
+from collections import namedtuple
+from collections.abc import Mapping
 import tempfile
 import shutil
 
diff --git a/buildstream/_options/optionpool.py b/buildstream/_options/optionpool.py
index b53e87a..1274586 100644
--- a/buildstream/_options/optionpool.py
+++ b/buildstream/_options/optionpool.py
@@ -18,7 +18,7 @@
 #        Tristan Van Berkom <tristan.vanberkom@codethink.co.uk>
 #
 
-from collections import Mapping
+from collections.abc import Mapping
 import jinja2
 
 from .. import _yaml
diff --git a/buildstream/_project.py b/buildstream/_project.py
index e026573..38d5f8e 100644
--- a/buildstream/_project.py
+++ b/buildstream/_project.py
@@ -19,7 +19,8 @@
 #        Tiago Gomes <tiago.gomes@codethink.co.uk>
 
 import os
-from collections import Mapping, OrderedDict
+from collections import OrderedDict
+from collections.abc import Mapping
 from pluginbase import PluginBase
 from . import utils
 from . import _cachekey
diff --git a/buildstream/element.py b/buildstream/element.py
index f442d9c..f2e56dd 100644
--- a/buildstream/element.py
+++ b/buildstream/element.py
@@ -76,7 +76,8 @@
 import re
 import stat
 import copy
-from collections import Mapping, OrderedDict
+from collections import OrderedDict
+from collections.abc import Mapping
 from contextlib import contextmanager
 from enum import Enum
 import tempfile
diff --git a/buildstream/plugins/elements/junction.py b/buildstream/plugins/elements/junction.py
index d2c62fe..62d52b2 100644
--- a/buildstream/plugins/elements/junction.py
+++ b/buildstream/plugins/elements/junction.py
@@ -126,7 +126,7 @@
 with the same name in the top-level project, which then takes precedence.
 """
 
-from collections import Mapping
+from collections.abc import Mapping
 from buildstream import Element
 from buildstream._pipeline import PipelineError
 
diff --git a/buildstream/plugins/sources/git.py b/buildstream/plugins/sources/git.py
index 94472ba..a93d318 100644
--- a/buildstream/plugins/sources/git.py
+++ b/buildstream/plugins/sources/git.py
@@ -104,7 +104,7 @@
 import os
 import errno
 import re
-from collections import Mapping
+from collections.abc import Mapping
 from io import StringIO
 
 from configparser import RawConfigParser
diff --git a/buildstream/source.py b/buildstream/source.py
index 7a705b4..a2dcdc2 100644
--- a/buildstream/source.py
+++ b/buildstream/source.py
@@ -147,7 +147,7 @@
 """
 
 import os
-from collections import Mapping
+from collections.abc import Mapping
 from contextlib import contextmanager
 
 from . import Plugin
diff --git a/tests/yaml/yaml.py b/tests/yaml/yaml.py
index 7817637..e938180 100644
--- a/tests/yaml/yaml.py
+++ b/tests/yaml/yaml.py
@@ -1,6 +1,6 @@
 import os
 import pytest
-from collections import Mapping
+from collections.abc import Mapping
 
 from buildstream import _yaml
 from buildstream._exceptions import LoadError, LoadErrorReason