several: change attr.cmp for attr.eq
Fix several warnings of the form: subiquity/common/errorreport.py:83 DeprecationWarning: The usage of `cmp` is deprecated and will be removed on or after 2021-06-01. Please use `eq` and `order` instead. See https://www.attrs.org/en/stable/changelog.html?highlight=cmp#id76 Minimum version needed for this is 19.2.0 of attrs, and focal has 19.3.
This commit is contained in:
parent
38302fd81a
commit
6b460abaa4
|
@ -49,7 +49,7 @@ from subiquity.common.types import (
|
|||
log = logging.getLogger('subiquitycore.common.errorreport')
|
||||
|
||||
|
||||
@attr.s(cmp=False)
|
||||
@attr.s(eq=False)
|
||||
class Upload(metaclass=urwid.MetaSignals):
|
||||
signals = ['progress']
|
||||
|
||||
|
@ -80,7 +80,7 @@ class Upload(metaclass=urwid.MetaSignals):
|
|||
os.close(self.pipe_r)
|
||||
|
||||
|
||||
@attr.s(cmp=False)
|
||||
@attr.s(eq=False)
|
||||
class ErrorReport(metaclass=urwid.MetaSignals):
|
||||
|
||||
signals = ["changed"]
|
||||
|
|
|
@ -345,7 +345,7 @@ class ChannelSnapInfo:
|
|||
metadata={'time_fmt': '%Y-%m-%dT%H:%M:%S.%fZ'})
|
||||
|
||||
|
||||
@attr.s(auto_attribs=True, cmp=False)
|
||||
@attr.s(auto_attribs=True, eq=False)
|
||||
class SnapInfo:
|
||||
name: str
|
||||
summary: str = ''
|
||||
|
|
|
@ -120,7 +120,7 @@ def fsobj(typ):
|
|||
c.type = attributes.const(typ)
|
||||
c.id = attr.ib(default=None)
|
||||
c._m = attr.ib(repr=None, default=None)
|
||||
c = attr.s(cmp=False, repr=False)(c)
|
||||
c = attr.s(eq=False, repr=False)(c)
|
||||
c.__repr__ = fsobj__repr
|
||||
_type_to_cls[typ] = c
|
||||
return c
|
||||
|
@ -157,7 +157,7 @@ def reverse_dependencies(obj):
|
|||
yield v
|
||||
|
||||
|
||||
@attr.s(cmp=False)
|
||||
@attr.s(eq=False)
|
||||
class RaidLevel:
|
||||
name = attr.ib()
|
||||
value = attr.ib()
|
||||
|
@ -420,7 +420,7 @@ def asdict(inst):
|
|||
# in the FilesystemModel or FilesystemController classes.
|
||||
|
||||
|
||||
@attr.s(cmp=False)
|
||||
@attr.s(eq=False)
|
||||
class _Formattable(ABC):
|
||||
# Base class for anything that can be formatted and mounted,
|
||||
# e.g. a disk or a RAID or a partition.
|
||||
|
@ -482,7 +482,7 @@ class _Formattable(ABC):
|
|||
GPT_OVERHEAD = 2 * (1 << 20)
|
||||
|
||||
|
||||
@attr.s(cmp=False)
|
||||
@attr.s(eq=False)
|
||||
class _Device(_Formattable, ABC):
|
||||
# Anything that can have partitions, e.g. a disk or a RAID.
|
||||
|
||||
|
|
Loading…
Reference in New Issue