From f32fcc6623ccaf4c465700c23fa20f66c5c79daf Mon Sep 17 00:00:00 2001 From: Andreas Jaeger Date: Fri, 27 Mar 2020 21:06:18 +0100 Subject: [PATCH] Update hacking for Python3 The repo is Python 3 now, so update hacking to version 3.0 which supports Python 3. Blacklist: W504 line break after binary operator W503 line break before binary operator Fix other problems found Change-Id: I2fb257a4f42b499df3702f3e8f3c99ecb28557d6 --- keystonemiddleware/auth_token/__init__.py | 2 +- keystonemiddleware/tests/unit/utils.py | 2 +- test-requirements.txt | 2 +- tox.ini | 4 +++- 4 files changed, 6 insertions(+), 4 deletions(-) diff --git a/keystonemiddleware/auth_token/__init__.py b/keystonemiddleware/auth_token/__init__.py index d961f591..0feed6f8 100644 --- a/keystonemiddleware/auth_token/__init__.py +++ b/keystonemiddleware/auth_token/__init__.py @@ -822,7 +822,7 @@ class AuthProtocol(BaseAuthProtocol): plugin_opts = loading.get_auth_plugin_conf_options(plugin_loader) self._conf.oslo_conf_obj.register_opts(plugin_opts, group=group) - getter = lambda opt: self._conf.get(opt.dest, group=group) + getter = lambda opt: self._conf.get(opt.dest, group=group) # noqa return plugin_loader.load_from_options_getter(getter) def _create_session(self, **kwargs): diff --git a/keystonemiddleware/tests/unit/utils.py b/keystonemiddleware/tests/unit/utils.py index 6a07ec1d..8b0944fa 100644 --- a/keystonemiddleware/tests/unit/utils.py +++ b/keystonemiddleware/tests/unit/utils.py @@ -82,7 +82,7 @@ if tuple(sys.version_info)[0:2] < (2, 7): class MiddlewareTestCase(BaseTestCase): def create_middleware(self, cb, **kwargs): - raise NotImplemented("implement this in your tests") + raise NotImplementedError("implement this in your tests") def create_simple_middleware(self, status='200 OK', diff --git a/test-requirements.txt b/test-requirements.txt index 6ca0c432..3ab58aa1 100644 --- a/test-requirements.txt +++ b/test-requirements.txt @@ -2,7 +2,7 @@ # of appearance. Changing the order has an impact on the overall integration # process, which may cause wedges in the gate later. -hacking<0.11,>=0.10.0 +hacking>=3.0,<4.0.0 # Apache-2.0 flake8-docstrings==0.2.1.post1 # MIT coverage!=4.4,>=4.0 # Apache-2.0 diff --git a/tox.ini b/tox.ini index a576bb61..4023606b 100644 --- a/tox.ini +++ b/tox.ini @@ -50,7 +50,9 @@ commands = oslo_debug_helper -t keystonemiddleware/tests {posargs} # D103: Missing docstring in public function # D104: Missing docstring in public package # D203: 1 blank line required before class docstring (deprecated in pep257) -ignore = D100,D101,D102,D103,D104,D203 +# W503 line break before binary operator +# W504 line break after binary operator +ignore = D100,D101,D102,D103,D104,D203,W503,W504 show-source = True exclude = .venv,.tox,dist,doc,*egg,build