You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@buildstream.apache.org by gi...@apache.org on 2020/12/29 13:17:02 UTC

[buildstream] 02/03: Use pycodestyle instead pep8

This is an automated email from the ASF dual-hosted git repository.

github-bot pushed a commit to branch jjardon/pycodestyle_pycodestyle
in repository https://gitbox.apache.org/repos/asf/buildstream.git

commit 46ffa1bdc5dd95a326cd775cdf859bd8f46d9fab
Author: Javier Jardón <jj...@gnome.org>
AuthorDate: Fri Aug 10 23:39:31 2018 +0100

    Use pycodestyle instead pep8
    
    pep8 package was renamed to pycodestyle
    
    I have tried to use pytest-codestyle but It seems it not possible
    to exclude paths yet: https://github.com/henry0312/pytest-codestyle/issues/32
---
 buildstream/_ostree.py  |  2 +-
 buildstream/_signals.py |  2 +-
 buildstream/element.py  |  2 +-
 dev-requirements.txt    |  3 +--
 setup.cfg               | 20 +++++++-------------
 5 files changed, 11 insertions(+), 18 deletions(-)

diff --git a/buildstream/_ostree.py b/buildstream/_ostree.py
index 5a4039f..ab652d7 100644
--- a/buildstream/_ostree.py
+++ b/buildstream/_ostree.py
@@ -34,7 +34,7 @@ from ._exceptions import BstError, ErrorDomain
 
 # pylint: disable=wrong-import-position,wrong-import-order
 gi.require_version('OSTree', '1.0')
-from gi.repository import GLib, Gio, OSTree  # nopep8
+from gi.repository import GLib, Gio, OSTree  # noqa
 
 
 # For users of this file, they must expect (except) it.
diff --git a/buildstream/_signals.py b/buildstream/_signals.py
index 0035485..6b6b097 100644
--- a/buildstream/_signals.py
+++ b/buildstream/_signals.py
@@ -38,7 +38,7 @@ def terminator_handler(signal_, frame):
         terminator_ = terminator_stack.pop()
         try:
             terminator_()
-        except:                                                 # pylint: disable=bare-except
+        except:                                                 # pylint: disable=bare-except # noqa
             # Ensure we print something if there's an exception raised when
             # processing the handlers. Note that the default exception
             # handler won't be called because we os._exit next, so we must
diff --git a/buildstream/element.py b/buildstream/element.py
index 0bc35ce..7f8e63e 100644
--- a/buildstream/element.py
+++ b/buildstream/element.py
@@ -1519,7 +1519,7 @@ class Element(Plugin):
                 utils._force_rmtree(rootdir)
 
             with _signals.terminator(cleanup_rootdir), \
-                self.__sandbox(rootdir, output_file, output_file, self.__sandbox_config) as sandbox:  # nopep8
+                self.__sandbox(rootdir, output_file, output_file, self.__sandbox_config) as sandbox:  # noqa
 
                 sandbox_vroot = sandbox.get_virtual_directory()
 
diff --git a/dev-requirements.txt b/dev-requirements.txt
index ee2db03..4bef70b 100644
--- a/dev-requirements.txt
+++ b/dev-requirements.txt
@@ -1,10 +1,9 @@
 coverage == 4.4.0
-pep8
+pycodestyle
 pylint == 2.1.1
 pytest >= 3.7
 pytest-cov >= 2.5.0
 pytest-datafiles
 pytest-env
-pytest-pep8
 pytest-pylint
 pytest-xdist
diff --git a/setup.cfg b/setup.cfg
index 7d40c3d..135f850 100644
--- a/setup.cfg
+++ b/setup.cfg
@@ -11,20 +11,14 @@ parentdir_prefix = BuildStream-
 test=pytest
 
 [tool:pytest]
-addopts = --verbose --basetemp ./tmp --pep8 --pylint --pylint-rcfile=.pylintrc --cov=buildstream --cov-config .coveragerc --durations=20
+addopts = --verbose --basetemp ./tmp --pylint --pylint-rcfile=.pylintrc --cov=buildstream --cov-config .coveragerc --durations=20
 norecursedirs = tests/integration/project integration-cache tmp __pycache__ .eggs
 python_files = tests/*/*.py
-pep8maxlinelength = 119
-pep8ignore =
-    * E129
-    * E125
-    doc/source/conf.py ALL
-    tmp/* ALL
-    */lib/python3* ALL
-    */bin/* ALL
-    buildstream/_fuse/fuse.py ALL
-    .eggs/* ALL
-    *_pb2.py ALL
-    *_pb2_grpc.py ALL
 env =
     D:BST_TEST_SUITE=True
+
+[pycodestyle]
+count = False
+ignore = E129,E125
+exclude = doc/source/conf.py, tmp/*, */lib/python3*, */bin/*, buildstream/_fuse/fuse.py, .eggs/*, *_pb2.py, *_pb2_grpc.py
+max-line-length = 119