Skip to content

Commit ee073fa

Browse files
gmrclaude
andcommitted
Remove deprecated SmartConsumer, PublishingConsumer, SmartPublishingConsumer
These have been deprecated aliases for Consumer since 3.17 / 4.0. Removing them as part of the 4.0 release — use Consumer directly. Co-Authored-By: Claude Sonnet 4.6 (1M context) <noreply@anthropic.com>
1 parent 18d731d commit ee073fa

4 files changed

Lines changed: 4 additions & 59 deletions

File tree

rejected/__init__.py

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -15,9 +15,6 @@
1515
ConsumerException,
1616
MessageException,
1717
ProcessingException,
18-
PublishingConsumer,
19-
SmartConsumer,
20-
SmartPublishingConsumer,
2118
)
2219

2320
__author__ = 'Gavin M. Roy <gavinmroy@gmail.com>'
@@ -33,9 +30,6 @@
3330
'ConsumerException',
3431
'MessageException',
3532
'ProcessingException',
36-
'PublishingConsumer',
37-
'SmartConsumer',
38-
'SmartPublishingConsumer',
3933
'__author__',
4034
'__since__',
4135
'__version__',

rejected/consumer.py

Lines changed: 0 additions & 49 deletions
Original file line numberDiff line numberDiff line change
@@ -1652,55 +1652,6 @@ def _serialize_avro(avro_schema: dict, data: dict) -> bytes:
16521652
return stream.getvalue()
16531653

16541654

1655-
class SmartConsumer(Consumer):
1656-
"""Deprecated alias for :class:`Consumer`.
1657-
1658-
.. deprecated:: 4.0.0
1659-
Use :class:`Consumer` directly.
1660-
1661-
"""
1662-
1663-
def __init__(self, *args, **kwargs):
1664-
warnings.warn(
1665-
'SmartConsumer is deprecated, use Consumer directly',
1666-
DeprecationWarning,
1667-
stacklevel=2,
1668-
)
1669-
super().__init__(*args, **kwargs)
1670-
1671-
1672-
class PublishingConsumer(Consumer):
1673-
"""Deprecated alias for :class:`Consumer`.
1674-
1675-
.. deprecated:: 3.17.0
1676-
1677-
"""
1678-
1679-
def __init__(self, *args, **kwargs):
1680-
warnings.warn(
1681-
'PublishingConsumer is deprecated, use Consumer directly',
1682-
DeprecationWarning,
1683-
stacklevel=2,
1684-
)
1685-
super().__init__(*args, **kwargs)
1686-
1687-
1688-
class SmartPublishingConsumer(Consumer):
1689-
"""Deprecated alias for :class:`Consumer`.
1690-
1691-
.. deprecated:: 3.17.0
1692-
1693-
"""
1694-
1695-
def __init__(self, *args, **kwargs):
1696-
warnings.warn(
1697-
'SmartPublishingConsumer is deprecated, use Consumer directly',
1698-
DeprecationWarning,
1699-
stacklevel=2,
1700-
)
1701-
super().__init__(*args, **kwargs)
1702-
1703-
17041655
class RejectedException(Exception):
17051656
"""Base exception for :py:class:`~rejected.consumer.Consumer` related
17061657
exceptions.

tests/test_consumer.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -196,7 +196,7 @@ async def test_user_id_property(self):
196196
self.assertEqual(self.obj.user_id, mocks.PROPERTIES.user_id)
197197

198198

199-
class TestSmartConsumer(consumer.SmartConsumer):
199+
class TestSmartConsumer(consumer.Consumer):
200200
async def process(self):
201201
pass
202202

tests/test_testing.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55

66
class TestPublishedMessages(testing.AsyncTestCase):
77
def get_consumer(self):
8-
class Consumer(consumer.SmartConsumer):
8+
class Consumer(consumer.Consumer):
99
async def process(self):
1010
for i in range(10):
1111
self.publish_message(
@@ -37,7 +37,7 @@ async def test_order_preserved(self):
3737

3838
class TestProcessingException(testing.AsyncTestCase):
3939
def get_consumer(self):
40-
class Consumer(consumer.SmartConsumer):
40+
class Consumer(consumer.Consumer):
4141
async def process(self):
4242
raise consumer.ProcessingException
4343

@@ -75,7 +75,7 @@ async def test_republished(self):
7575

7676
class TestMessageException(testing.AsyncTestCase):
7777
def get_consumer(self):
78-
class Consumer(consumer.SmartConsumer):
78+
class Consumer(consumer.Consumer):
7979
MESSAGE_TYPE = 'a_type'
8080

8181
return Consumer

0 commit comments

Comments
 (0)