Skip to content
Permalink
Browse files

multiple: attr.s 19.2.0 deprecates cmp -> eq

This fixes some occurances missed in commit
972e075.

With the release of 19.2.0 the cmp parameter for attr.s classes is
deprecated. Instead of fixing the deprecated features after a version
without the feature is released, adjust labgrid to use eq instead of cmp
before the deprecated feature is removed.

Signed-off-by: Jan Luebbe <jlu@pengutronix.de>
  • Loading branch information...
jluebbe authored and Emantor committed Oct 10, 2019
1 parent d11b0f0 commit f7730ee94c7c5efef8f3ab22298ea9dc587a89f9
@@ -9,7 +9,7 @@
from labgrid.strategy.common import Strategy


@attr.s(cmp=False)
@attr.s(eq=False)
class StrategyError(Exception):
msg = attr.ib(validator=attr.validators.instance_of(str))

@@ -21,7 +21,7 @@ class Status(enum.Enum):


@target_factory.reg_driver
@attr.s(cmp=False)
@attr.s(eq=False)
class BareboxRebootStrategy(Strategy):
"""A Strategy to switch to barebox or shell and back via reboot
@@ -9,7 +9,7 @@
from labgrid.strategy.common import Strategy


@attr.s(cmp=False)
@attr.s(eq=False)
class StrategyError(Exception):
msg = attr.ib(validator=attr.validators.instance_of(str))

@@ -21,7 +21,7 @@ class Status(enum.Enum):


@target_factory.reg_driver
@attr.s(cmp=False)
@attr.s(eq=False)
class QuartusHPSStrategy(Strategy):
"""QuartusHPSStrategy - Strategy to flash QSPI via 'Quartus Prime Programmer and Tools'"""
bindings = {
@@ -9,7 +9,7 @@
from labgrid.strategy import Strategy


@attr.s(cmp=False)
@attr.s(eq=False)
class StrategyError(Exception):
msg = attr.ib(validator=attr.validators.instance_of(str))

@@ -21,7 +21,7 @@ class Status(enum.Enum):


@target_factory.reg_driver
@attr.s(cmp=False)
@attr.s(eq=False)
class ExampleStrategy(Strategy):
"""ExampleStrategy - Strategy to for the usbpower labgrid example"""
bindings = {
@@ -75,8 +75,8 @@ def release(self):
self.data['acquired'] = None


@attr.s(cmp=True, repr=False, str=False)
# This class requires cmp=True, since we put the matches into a list and require
@attr.s(eq=True, repr=False, str=False)
# This class requires eq=True, since we put the matches into a list and require
# the cmp functions to be able to remove the matches from the list later on.
class ResourceMatch:
exporter = attr.ib()
@@ -242,7 +242,7 @@ def test_suppliers_optional_named_a_missing(target):


# test nested resource creation
@attr.s(cmp=False)
@attr.s(eq=False)
class DiscoveryResource(Resource):
def __attrs_post_init__(self):
super().__attrs_post_init__()

0 comments on commit f7730ee

Please sign in to comment.
You can’t perform that action at this time.