remove six.add_metaclass usage

This commit is contained in:
Brad Warren 2021-02-08 12:00:34 -08:00
parent d361586300
commit 684ecc59b9
3 changed files with 9 additions and 23 deletions

View file

@ -100,12 +100,10 @@ For this reason the internal representation of data should not ignore the case.
"""
import abc
import six
@six.add_metaclass(abc.ABCMeta)
class ParserNode(object):
class ParserNode(object, metaclass=abc.ABCMeta):
"""
ParserNode is the basic building block of the tree of such nodes,
representing the structure of the configuration. It is largely meant to keep
@ -204,9 +202,7 @@ class ParserNode(object):
"""
# Linter rule exclusion done because of https://github.com/PyCQA/pylint/issues/179
@six.add_metaclass(abc.ABCMeta) # pylint: disable=abstract-method
class CommentNode(ParserNode):
class CommentNode(ParserNode, metaclass=abc.ABCMeta):
"""
CommentNode class is used for representation of comments within the parsed
configuration structure. Because of the nature of comments, it is not able
@ -249,8 +245,7 @@ class CommentNode(ParserNode):
metadata=kwargs.get('metadata', {})) # pragma: no cover
@six.add_metaclass(abc.ABCMeta)
class DirectiveNode(ParserNode):
class DirectiveNode(ParserNode, metaclass=abc.ABCMeta):
"""
DirectiveNode class represents a configuration directive within the configuration.
It can have zero or more parameters attached to it. Because of the nature of
@ -325,8 +320,7 @@ class DirectiveNode(ParserNode):
"""
@six.add_metaclass(abc.ABCMeta)
class BlockNode(DirectiveNode):
class BlockNode(DirectiveNode, metaclass=abc.ABCMeta):
"""
BlockNode class represents a block of nested configuration directives, comments
and other blocks as its children. A BlockNode can have zero or more parameters

View file

@ -1,14 +1,12 @@
"""Certbot client interfaces."""
import abc
import six
import zope.interface
# pylint: disable=no-self-argument,no-method-argument,inherit-non-class
@six.add_metaclass(abc.ABCMeta)
class AccountStorage(object):
class AccountStorage(object, metaclass=abc.ABCMeta):
"""Accounts storage interface."""
@abc.abstractmethod
@ -547,8 +545,7 @@ class IReporter(zope.interface.Interface):
"""Prints messages to the user and clears the message queue."""
@six.add_metaclass(abc.ABCMeta)
class RenewableCert(object):
class RenewableCert(object, metaclass=abc.ABCMeta):
"""Interface to a certificate lineage."""
@abc.abstractproperty
@ -613,8 +610,7 @@ class RenewableCert(object):
# an update during the run or install subcommand, it should do so when
# :func:`IInstaller.deploy_cert` is called.
@six.add_metaclass(abc.ABCMeta)
class GenericUpdater(object):
class GenericUpdater(object, metaclass=abc.ABCMeta):
"""Interface for update types not currently specified by Certbot.
This class allows plugins to perform types of updates that Certbot hasn't
@ -646,8 +642,7 @@ class GenericUpdater(object):
"""
@six.add_metaclass(abc.ABCMeta)
class RenewDeployer(object):
class RenewDeployer(object, metaclass=abc.ABCMeta):
"""Interface for update types run when a lineage is renewed
This class allows plugins to perform types of updates that need to run at

View file

@ -1,8 +1,6 @@
"""New interface style Certbot enhancements"""
import abc
import six
from acme.magic_typing import Any
from acme.magic_typing import Dict
from acme.magic_typing import List
@ -91,8 +89,7 @@ def populate_cli(add):
help=enh["cli_help"])
@six.add_metaclass(abc.ABCMeta)
class AutoHSTSEnhancement(object):
class AutoHSTSEnhancement(object, metaclass=abc.ABCMeta):
"""
Enhancement interface that installer plugins can implement in order to
provide functionality that configures the software to have a