From 96f6d5bdaf3db88e198817e1addb333a5267b70e Mon Sep 17 00:00:00 2001 From: David Euresti Date: Wed, 9 Oct 2019 16:12:11 -0700 Subject: [PATCH 1/2] [Attrs] Remove deprecated error for cmp --- mypy/plugins/attrs.py | 1 - 1 file changed, 1 deletion(-) diff --git a/mypy/plugins/attrs.py b/mypy/plugins/attrs.py index 425eeb77600e..39b0baa83c01 100644 --- a/mypy/plugins/attrs.py +++ b/mypy/plugins/attrs.py @@ -190,7 +190,6 @@ def _determine_eq_order(ctx: 'mypy.plugin.ClassDefContext') -> Tuple[bool, bool] # cmp takes precedence due to bw-compatibility. if cmp is not None: - ctx.api.fail("cmp is deprecated, use eq and order", ctx.reason) return cmp, cmp # If left None, equality is on and ordering mirrors equality. From 160f1f71e1075b243043fb5f7f8cfe57bf1b2310 Mon Sep 17 00:00:00 2001 From: David Euresti Date: Wed, 9 Oct 2019 16:14:16 -0700 Subject: [PATCH 2/2] Fix the tests. --- test-data/unit/check-attr.test | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/test-data/unit/check-attr.test b/test-data/unit/check-attr.test index de7b4f9c59d1..2175af5e39ab 100644 --- a/test-data/unit/check-attr.test +++ b/test-data/unit/check-attr.test @@ -278,15 +278,15 @@ A(1) != 1 [case testAttrsCmpEqOrderValues] from attr import attrib, attrs -@attrs(cmp=True) # E: cmp is deprecated, use eq and order +@attrs(cmp=True) class DeprecatedTrue: ... -@attrs(cmp=False) # E: cmp is deprecated, use eq and order +@attrs(cmp=False) class DeprecatedFalse: ... -@attrs(cmp=False, eq=True) # E: Don't mix `cmp` with `eq' and `order` # E: cmp is deprecated, use eq and order +@attrs(cmp=False, eq=True) # E: Don't mix `cmp` with `eq' and `order` class Mixed: ...