From 7e9e1e5c44d94b5d5c72c94b191fa53b9d661b25 Mon Sep 17 00:00:00 2001 From: "John L. Villalovos" Date: Tue, 3 Apr 2018 12:30:35 -0700 Subject: [PATCH] Fix PEP8 failures for H236, remove unneeded ignores, use newer hacking Fix [H236] Use six.add_metaclass instead of __metaclass__. Remove ignoring of: H233, H234, and H236 as they are passing. Use hacking>=1.0.0 Change-Id: I310f1161467339c6784bae253e0e3713f23d5218 --- storyboard/plugin/email/workers.py | 2 -- storyboard/plugin/event_worker.py | 4 ++-- test-requirements.txt | 2 +- tox.ini | 7 ++----- 4 files changed, 5 insertions(+), 10 deletions(-) diff --git a/storyboard/plugin/email/workers.py b/storyboard/plugin/email/workers.py index b1bab7ac..646c76b1 100644 --- a/storyboard/plugin/email/workers.py +++ b/storyboard/plugin/email/workers.py @@ -49,8 +49,6 @@ class EmailWorkerBase(EmailPluginBase, WorkerTaskBase): building emails off of our event queue. """ - __metaclass__ = abc.ABCMeta - def handle(self, session, author, method, url, path, query_string, status, resource, resource_id, sub_resource=None, sub_resource_id=None, resource_before=None, resource_after=None): diff --git a/storyboard/plugin/event_worker.py b/storyboard/plugin/event_worker.py index 93572d2e..75a8c0f2 100644 --- a/storyboard/plugin/event_worker.py +++ b/storyboard/plugin/event_worker.py @@ -19,6 +19,7 @@ from threading import Timer from oslo_config import cfg from oslo_log import log +import six import storyboard.db.api.base as db_api from storyboard.notifications.notification_hook import class_mappings @@ -157,11 +158,10 @@ class PerpetualTimer(object): self.thread.cancel() +@six.add_metaclass(abc.ABCMeta) class WorkerTaskBase(PluginBase): """Base class for a worker that listens to API Events.""" - __metaclass__ = abc.ABCMeta - def event(self, author_id, method, url, path, query_string, status, resource, resource_id, sub_resource=None, sub_resource_id=None, resource_before=None, resource_after=None): diff --git a/test-requirements.txt b/test-requirements.txt index f4c1f025..33b112e4 100644 --- a/test-requirements.txt +++ b/test-requirements.txt @@ -1,4 +1,4 @@ -hacking>=0.11.0,<0.12 +hacking>=1.0.0 coverage>=3.6 fixtures>=0.3.14 diff --git a/tox.ini b/tox.ini index b6383669..0d335065 100644 --- a/tox.ini +++ b/tox.ini @@ -46,12 +46,9 @@ commands = python setup.py testr --coverage --testr-args='{posargs}' # E125 and E128 are ignored on purpose, they are invalid pep8 # The following rules should either be addressed or determined to be # skippable long term. -# H405 is ignored to make switch to newer hacking easier -# H234 is ignored to make switch to newer hacking easier -# H233 is ignored to make switch to newer hacking easier # E265 is ignored to make switch to newer hacking easier -# H236 is ignored to make switch to newer hacking easier -ignore = E125,E128,H405,H234,H233,E265,H236 +# H405 is ignored to make switch to newer hacking easier +ignore = E125,E128,E265,H405 builtins = _ show-source = True exclude=.venv,.git,.tox,dist,doc,*lib/python*,*egg,build