[Notes] [Git][BuildStream/buildstream][jjardon/pycodestyle_fixes] 6 commits: Use pycodestyle instead pep8



Title: GitLab

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

Commits:

13 changed files:

Changes:

  • buildstream/_ostree.py
    ... ... @@ -34,7 +34,7 @@ from ._exceptions import BstError, ErrorDomain
    34 34
     
    
    35 35
     # pylint: disable=wrong-import-position,wrong-import-order
    
    36 36
     gi.require_version('OSTree', '1.0')
    
    37
    -from gi.repository import GLib, Gio, OSTree  # nopep8
    
    37
    +from gi.repository import GLib, Gio, OSTree  # noqa
    
    38 38
     
    
    39 39
     
    
    40 40
     # For users of this file, they must expect (except) it.
    

  • buildstream/_signals.py
    ... ... @@ -38,7 +38,7 @@ def terminator_handler(signal_, frame):
    38 38
             terminator_ = terminator_stack.pop()
    
    39 39
             try:
    
    40 40
                 terminator_()
    
    41
    -        except:                                                 # pylint: disable=bare-except
    
    41
    +        except:                                                 # pylint: disable=bare-except # noqa
    
    42 42
                 # Ensure we print something if there's an exception raised when
    
    43 43
                 # processing the handlers. Note that the default exception
    
    44 44
                 # handler won't be called because we os._exit next, so we must
    

  • buildstream/element.py
    ... ... @@ -1519,7 +1519,7 @@ class Element(Plugin):
    1519 1519
                     utils._force_rmtree(rootdir)
    
    1520 1520
     
    
    1521 1521
                 with _signals.terminator(cleanup_rootdir), \
    
    1522
    -                self.__sandbox(rootdir, output_file, output_file, self.__sandbox_config) as sandbox:  # nopep8
    
    1522
    +                self.__sandbox(rootdir, output_file, output_file, self.__sandbox_config) as sandbox:  # noqa
    
    1523 1523
     
    
    1524 1524
                     sandbox_vroot = sandbox.get_virtual_directory()
    
    1525 1525
     
    

  • buildstream/plugins/sources/tar.py
    ... ... @@ -127,7 +127,7 @@ class TarSource(DownloadableFileSource):
    127 127
             if not base_dir.endswith(os.sep):
    
    128 128
                 base_dir = base_dir + os.sep
    
    129 129
     
    
    130
    -        l = len(base_dir)
    
    130
    +        L = len(base_dir)
    
    131 131
             for member in tar.getmembers():
    
    132 132
     
    
    133 133
                 # First, ensure that a member never starts with `./`
    
    ... ... @@ -145,9 +145,9 @@ class TarSource(DownloadableFileSource):
    145 145
                     #       base directory.
    
    146 146
                     #
    
    147 147
                     if member.type == tarfile.LNKTYPE:
    
    148
    -                    member.linkname = member.linkname[l:]
    
    148
    +                    member.linkname = member.linkname[L:]
    
    149 149
     
    
    150
    -                member.path = member.path[l:]
    
    150
    +                member.path = member.path[L:]
    
    151 151
                     yield member
    
    152 152
     
    
    153 153
         # We want to iterate over all paths of a tarball, but getmembers()
    

  • buildstream/plugins/sources/zip.py
    ... ... @@ -121,13 +121,13 @@ class ZipSource(DownloadableFileSource):
    121 121
             if not base_dir.endswith(os.sep):
    
    122 122
                 base_dir = base_dir + os.sep
    
    123 123
     
    
    124
    -        l = len(base_dir)
    
    124
    +        L = len(base_dir)
    
    125 125
             for member in archive.infolist():
    
    126 126
                 if member.filename == base_dir:
    
    127 127
                     continue
    
    128 128
     
    
    129 129
                 if member.filename.startswith(base_dir):
    
    130
    -                member.filename = member.filename[l:]
    
    130
    +                member.filename = member.filename[L:]
    
    131 131
                     yield member
    
    132 132
     
    
    133 133
         # We want to iterate over all paths of an archive, but namelist()
    

  • buildstream/utils.py
    ... ... @@ -645,6 +645,7 @@ def _pretty_size(size, dec_places=0):
    645 645
                 psize /= 1024
    
    646 646
         return "{size:g}{unit}".format(size=round(psize, dec_places), unit=unit)
    
    647 647
     
    
    648
    +
    
    648 649
     # A sentinel to be used as a default argument for functions that need
    
    649 650
     # to distinguish between a kwarg set to None and an unset kwarg.
    
    650 651
     _sentinel = object()
    

  • dev-requirements.txt
    1 1
     coverage == 4.4.0
    
    2
    -pep8
    
    2
    +pycodestyle
    
    3 3
     pylint == 2.1.1
    
    4 4
     pytest >= 3.7
    
    5 5
     pytest-cov >= 2.5.0
    
    6 6
     pytest-datafiles
    
    7 7
     pytest-env
    
    8
    -pytest-pep8
    
    9 8
     pytest-pylint
    
    10 9
     pytest-xdist

  • doc/bst2html.py
    ... ... @@ -96,8 +96,8 @@ def _ansi2html_get_styles(palette):
    96 96
     
    
    97 97
             for g in range(24):
    
    98 98
                 i = g + 232
    
    99
    -            l = g * 10 + 8
    
    100
    -            indexed_style['%s' % i] = ''.join('%02X' % c if 0 <= c <= 255 else None for c in (l, l, l))
    
    99
    +            L = g * 10 + 8
    
    100
    +            indexed_style['%s' % i] = ''.join('%02X' % c if 0 <= c <= 255 else None for c in (L, L, L))
    
    101 101
     
    
    102 102
             _ANSI2HTML_STYLES[palette] = (regular_style, bold_style, indexed_style)
    
    103 103
         return _ANSI2HTML_STYLES[palette]
    
    ... ... @@ -455,6 +455,7 @@ def run_bst(directory, force, source_cache, description, palette):
    455 455
     
    
    456 456
         return 0
    
    457 457
     
    
    458
    +
    
    458 459
     if __name__ == '__main__':
    
    459 460
         try:
    
    460 461
             run_bst()
    

  • doc/source/conf.py
    ... ... @@ -19,10 +19,10 @@
    19 19
     #
    
    20 20
     import os
    
    21 21
     import sys
    
    22
    -sys.path.insert(0, os.path.abspath('..'))
    
    23
    -
    
    24 22
     from buildstream import __version__
    
    25 23
     
    
    24
    +sys.path.insert(0, os.path.abspath('..'))
    
    25
    +
    
    26 26
     # -- General configuration ------------------------------------------------
    
    27 27
     
    
    28 28
     # If your documentation needs a minimal Sphinx version, state it here.
    
    ... ... @@ -112,7 +112,7 @@ add_module_names = False
    112 112
     pygments_style = 'sphinx'
    
    113 113
     
    
    114 114
     # A list of ignored prefixes for module index sorting.
    
    115
    -modindex_common_prefix = [ 'buildstream.' ]
    
    115
    +modindex_common_prefix = ['buildstream.']
    
    116 116
     
    
    117 117
     # If true, keep warnings as "system message" paragraphs in the built documents.
    
    118 118
     # keep_warnings = False
    

  • setup.cfg
    ... ... @@ -11,20 +11,14 @@ parentdir_prefix = BuildStream-
    11 11
     test=pytest
    
    12 12
     
    
    13 13
     [tool:pytest]
    
    14
    -addopts = --verbose --basetemp ./tmp --pep8 --pylint --pylint-rcfile=.pylintrc --cov=buildstream --cov-config .coveragerc --durations=20
    
    14
    +addopts = --verbose --basetemp ./tmp --pylint --pylint-rcfile=.pylintrc --cov=buildstream --cov-config .coveragerc --durations=20
    
    15 15
     norecursedirs = tests/integration/project integration-cache tmp __pycache__ .eggs
    
    16 16
     python_files = tests/*/*.py
    
    17
    -pep8maxlinelength = 119
    
    18
    -pep8ignore =
    
    19
    -    * E129
    
    20
    -    * E125
    
    21
    -    doc/source/conf.py ALL
    
    22
    -    tmp/* ALL
    
    23
    -    */lib/python3* ALL
    
    24
    -    */bin/* ALL
    
    25
    -    buildstream/_fuse/fuse.py ALL
    
    26
    -    .eggs/* ALL
    
    27
    -    *_pb2.py ALL
    
    28
    -    *_pb2_grpc.py ALL
    
    29 17
     env =
    
    30 18
         D:BST_TEST_SUITE=True
    
    19
    +
    
    20
    +[pycodestyle]
    
    21
    +count = False
    
    22
    +ignore = E129,E125,W504,W605
    
    23
    +exclude = doc/source/conf.py, tmp/*, */lib/python3*, */bin/*, buildstream/_fuse/fuse.py, .eggs/*, *_pb2.py, *_pb2_grpc.py
    
    24
    +max-line-length = 119

  • tests/cachekey/cachekey.py
    ... ... @@ -129,6 +129,7 @@ def assert_cache_keys(project_dir, output):
    129 129
                                  "Use tests/cachekey/update.py to automatically " +
    
    130 130
                                  "update this test case")
    
    131 131
     
    
    132
    +
    
    132 133
     ##############################################
    
    133 134
     #             Test Entry Point               #
    
    134 135
     ##############################################
    

  • tests/cachekey/update.py
    ... ... @@ -65,5 +65,6 @@ def update_keys():
    65 65
     
    
    66 66
                     write_expected_key(element_name, actual_keys[element_name])
    
    67 67
     
    
    68
    +
    
    68 69
     if __name__ == '__main__':
    
    69 70
         update_keys()

  • tests/frontend/buildcheckout.py
    ... ... @@ -288,6 +288,7 @@ def test_build_checkout_force_tarball(datafiles, cli):
    288 288
         assert os.path.join('.', 'usr', 'bin', 'hello') in tar.getnames()
    
    289 289
         assert os.path.join('.', 'usr', 'include', 'pony.h') in tar.getnames()
    
    290 290
     
    
    291
    +
    
    291 292
     fetch_build_checkout_combos = \
    
    292 293
         [("strict", kind) for kind in ALL_REPO_KINDS] + \
    
    293 294
         [("non-strict", kind) for kind in ALL_REPO_KINDS]
    



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