[Notes] [Git][BuildStream/buildstream][jjardon/pycodestyle] 8 commits: Merge branch 'tristan/remove-redundant-test' into 'master'



Title: GitLab

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

Commits:

13 changed files:

Changes:

  • .gitlab-ci.yml
    ... ... @@ -71,6 +71,8 @@ source_dist:
    71 71
       - chown -R buildstream:buildstream buildstream
    
    72 72
       - cd buildstream
    
    73 73
     
    
    74
    +  - pip3 install pytest-codestyle
    
    75
    +
    
    74 76
       # Run the tests from the source distribution, We run as a simple
    
    75 77
       # user to test for permission issues
    
    76 78
       - su buildstream -c 'python3 setup.py test --index-url invalid://uri --addopts --integration'
    
    ... ... @@ -120,6 +122,8 @@ tests-unix:
    120 122
         # Unpack and get into dist/buildstream
    
    121 123
         - cd dist && ./unpack.sh && cd buildstream
    
    122 124
     
    
    125
    +    - pip3 install pytest-codestyle
    
    126
    +
    
    123 127
         # Since the unix platform is required to run as root, no user change required
    
    124 128
         - python3 setup.py test --index-url invalid://uri --addopts --integration
    
    125 129
     
    

  • 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/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
    
    3 2
     pylint == 2.1.1
    
    4 3
     pytest >= 3.7
    
    4
    +pytest-codestyle
    
    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
    ... ... @@ -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,11 @@ 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 --codestyle --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
    
    17
    +codestyle_max_line_length = 119
    
    18
    +codestyle_ignore =
    
    19
    +    *_pb2.py
    
    29 20
     env =
    
    30 21
         D:BST_TEST_SUITE=True

  • 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]