[Notes] [Git][BuildStream/buildstream][jjardon/warnings_collections] Fix python warnings: Use collections.abc instead collections



Title: GitLab

Javier Jardón pushed to branch jjardon/warnings_collections at BuildStream / buildstream

Commits:

12 changed files:

Changes:

  • buildstream/_artifactcache/artifactcache.py
    ... ... @@ -19,7 +19,8 @@
    19 19
     
    
    20 20
     import os
    
    21 21
     import string
    
    22
    -from collections import Mapping, namedtuple
    
    22
    +from collections import namedtuple
    
    23
    +from collections.abc import Mapping
    
    23 24
     
    
    24 25
     from ..types import _KeyStrength
    
    25 26
     from .._exceptions import ArtifactError, ImplError, LoadError, LoadErrorReason
    

  • buildstream/_context.py
    ... ... @@ -19,7 +19,8 @@
    19 19
     
    
    20 20
     import os
    
    21 21
     import datetime
    
    22
    -from collections import deque, Mapping
    
    22
    +from collections import deque
    
    23
    +from collections.abc import Mapping
    
    23 24
     from contextlib import contextmanager
    
    24 25
     from . import utils
    
    25 26
     from . import _cachekey
    

  • buildstream/_includes.py
    1 1
     import os
    
    2
    -from collections import Mapping
    
    2
    +from collections.abc import Mapping
    
    3 3
     from . import _yaml
    
    4 4
     from ._exceptions import LoadError, LoadErrorReason
    
    5 5
     
    

  • buildstream/_loader/loadelement.py
    ... ... @@ -18,7 +18,7 @@
    18 18
     #        Tristan Van Berkom <tristan vanberkom codethink co uk>
    
    19 19
     
    
    20 20
     # System imports
    
    21
    -from collections import Mapping
    
    21
    +from collections.abc import Mapping
    
    22 22
     
    
    23 23
     # BuildStream toplevel imports
    
    24 24
     from .._exceptions import LoadError, LoadErrorReason
    

  • buildstream/_loader/loader.py
    ... ... @@ -19,7 +19,8 @@
    19 19
     
    
    20 20
     import os
    
    21 21
     from functools import cmp_to_key
    
    22
    -from collections import Mapping, namedtuple
    
    22
    +from collections import Mapping
    
    23
    +from collections.abc import namedtuple
    
    23 24
     import tempfile
    
    24 25
     import shutil
    
    25 26
     
    

  • buildstream/_options/optionpool.py
    ... ... @@ -18,7 +18,7 @@
    18 18
     #        Tristan Van Berkom <tristan vanberkom codethink co uk>
    
    19 19
     #
    
    20 20
     
    
    21
    -from collections import Mapping
    
    21
    +from collections.abc import Mapping
    
    22 22
     import jinja2
    
    23 23
     
    
    24 24
     from .. import _yaml
    

  • buildstream/_project.py
    ... ... @@ -19,7 +19,8 @@
    19 19
     #        Tiago Gomes <tiago gomes codethink co uk>
    
    20 20
     
    
    21 21
     import os
    
    22
    -from collections import Mapping, OrderedDict
    
    22
    +from collections import OrderedDict
    
    23
    +from collections.abc import Mapping
    
    23 24
     from pluginbase import PluginBase
    
    24 25
     from . import utils
    
    25 26
     from . import _cachekey
    

  • buildstream/element.py
    ... ... @@ -76,7 +76,8 @@ import os
    76 76
     import re
    
    77 77
     import stat
    
    78 78
     import copy
    
    79
    -from collections import Mapping, OrderedDict
    
    79
    +from collections import OrderedDict
    
    80
    +from collections.abc import Mapping
    
    80 81
     from contextlib import contextmanager
    
    81 82
     import tempfile
    
    82 83
     import shutil
    

  • buildstream/plugins/elements/junction.py
    ... ... @@ -124,7 +124,7 @@ the user to resolve possibly conflicting nested junctions by creating a junction
    124 124
     with the same name in the top-level project, which then takes precedence.
    
    125 125
     """
    
    126 126
     
    
    127
    -from collections import Mapping
    
    127
    +from collections.abc import Mapping
    
    128 128
     from buildstream import Element
    
    129 129
     from buildstream._pipeline import PipelineError
    
    130 130
     
    

  • buildstream/plugins/sources/git.py
    ... ... @@ -89,7 +89,7 @@ import os
    89 89
     import errno
    
    90 90
     import re
    
    91 91
     import shutil
    
    92
    -from collections import Mapping
    
    92
    +from collections.abc import Mapping
    
    93 93
     from io import StringIO
    
    94 94
     
    
    95 95
     from configparser import RawConfigParser
    

  • buildstream/source.py
    ... ... @@ -155,7 +155,7 @@ Class Reference
    155 155
     """
    
    156 156
     
    
    157 157
     import os
    
    158
    -from collections import Mapping
    
    158
    +from collections.abc import Mapping
    
    159 159
     from contextlib import contextmanager
    
    160 160
     
    
    161 161
     from . import Plugin, Consistency
    

  • tests/yaml/yaml.py
    1 1
     import os
    
    2 2
     import pytest
    
    3 3
     import tempfile
    
    4
    -from collections import Mapping
    
    4
    +from collections.abc import Mapping
    
    5 5
     
    
    6 6
     from buildstream import _yaml
    
    7 7
     from buildstream._exceptions import LoadError, LoadErrorReason
    



  • [Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]