summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJavier Jardón <jjardon@gnome.org>2018-10-18 15:07:56 +0100
committerJavier Jardón <jjardon@gnome.org>2018-10-18 15:13:35 +0100
commitf1aa0974d36f4201098004794ca8b5f263fb01a1 (patch)
treefea0132e12378885370285271bb8490112f50fa5
parent892866e1fbc08c9cb233ee9f4fe23cd01d0a4b56 (diff)
downloadbuildstream-jjardon/warnings_collections.tar.gz
Fix python warnings: Use collections.abc instead collectionsjjardon/warnings_collections
Since python 3.3, collections has been moved to collections.abc module. For backwards compatibility, they continue to be visible in this module through Python 3.7. Subsequently, they will be removed entirely. See https://docs.python.org/3/library/collections.html
-rw-r--r--buildstream/_artifactcache/artifactcache.py3
-rw-r--r--buildstream/_context.py3
-rw-r--r--buildstream/_includes.py2
-rw-r--r--buildstream/_loader/loadelement.py2
-rw-r--r--buildstream/_loader/loader.py3
-rw-r--r--buildstream/_options/optionpool.py2
-rw-r--r--buildstream/_project.py3
-rw-r--r--buildstream/element.py3
-rw-r--r--buildstream/plugins/elements/junction.py2
-rw-r--r--buildstream/plugins/sources/git.py2
-rw-r--r--buildstream/source.py2
-rw-r--r--tests/yaml/yaml.py2
12 files changed, 17 insertions, 12 deletions
diff --git a/buildstream/_artifactcache/artifactcache.py b/buildstream/_artifactcache/artifactcache.py
index ecb5738d7..7977691c0 100644
--- a/buildstream/_artifactcache/artifactcache.py
+++ b/buildstream/_artifactcache/artifactcache.py
@@ -19,7 +19,8 @@
import os
import string
-from collections import Mapping, namedtuple
+from collections import namedtuple
+from collections.abc import Mapping
from ..types import _KeyStrength
from .._exceptions import ArtifactError, ImplError, LoadError, LoadErrorReason
diff --git a/buildstream/_context.py b/buildstream/_context.py
index cb29968a4..d2086af93 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 e30003630..df14c9f2d 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/loadelement.py b/buildstream/_loader/loadelement.py
index 4104dfd59..72e89879e 100644
--- a/buildstream/_loader/loadelement.py
+++ b/buildstream/_loader/loadelement.py
@@ -18,7 +18,7 @@
# Tristan Van Berkom <tristan.vanberkom@codethink.co.uk>
# System imports
-from collections import Mapping
+from collections.abc import Mapping
# BuildStream toplevel imports
from .._exceptions import LoadError, LoadErrorReason
diff --git a/buildstream/_loader/loader.py b/buildstream/_loader/loader.py
index 5f6d23a71..8a81a71c1 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 b53e87a3d..1274586f7 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 44e5171e6..83aa1f47e 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 1e6bf548c..de1988d2a 100644
--- a/buildstream/element.py
+++ b/buildstream/element.py
@@ -76,7 +76,8 @@ import os
import re
import stat
import copy
-from collections import Mapping, OrderedDict
+from collections import OrderedDict
+from collections.abc import Mapping
from contextlib import contextmanager
import tempfile
import shutil
diff --git a/buildstream/plugins/elements/junction.py b/buildstream/plugins/elements/junction.py
index ee5ed24d5..7f9817359 100644
--- a/buildstream/plugins/elements/junction.py
+++ b/buildstream/plugins/elements/junction.py
@@ -124,7 +124,7 @@ the user to resolve possibly conflicting nested junctions by creating a junction
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 bce399cd9..431ae37ef 100644
--- a/buildstream/plugins/sources/git.py
+++ b/buildstream/plugins/sources/git.py
@@ -89,7 +89,7 @@ import os
import errno
import re
import shutil
-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 ad7c57fb0..e42bad1a5 100644
--- a/buildstream/source.py
+++ b/buildstream/source.py
@@ -155,7 +155,7 @@ Class Reference
"""
import os
-from collections import Mapping
+from collections.abc import Mapping
from contextlib import contextmanager
from . import Plugin, Consistency
diff --git a/tests/yaml/yaml.py b/tests/yaml/yaml.py
index a944c0e36..26515caee 100644
--- a/tests/yaml/yaml.py
+++ b/tests/yaml/yaml.py
@@ -1,7 +1,7 @@
import os
import pytest
import tempfile
-from collections import Mapping
+from collections.abc import Mapping
from buildstream import _yaml
from buildstream._exceptions import LoadError, LoadErrorReason