Skip to content

Commit 528f84b

Browse files
committed
Remove URLRabbitmqBroker. This has been deprecated since version 1.1.0.
1 parent 5a03f0c commit 528f84b

File tree

4 files changed

+8
-36
lines changed

4 files changed

+8
-36
lines changed

docs/source/changelog.rst

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,9 @@ Minor Breaking Changes
5454

5555
These are changes that while technically breaking, we believe are unlikely to effect your project.
5656

57+
* Removed ``URLRabbitmqBroker``. This has been deprecated since version 1.1.0.
58+
Use |RabbitmqBroker| with ``url`` as a keyword argument instead.
59+
(`#786`_, `@LincolnPuzey`_)
5760
* Removed the ``dev`` installable extra from the project metadata.
5861
Instead the development dependencies are defined in a `PEP-735`_
5962
``[dependency-groups]`` table in ``pyproject.toml``.
@@ -81,6 +84,7 @@ These are changes that while technically breaking, we believe are unlikely to ef
8184
.. _#772: https://github.com/Bogdanp/dramatiq/pull/772
8285
.. _#782: https://github.com/Bogdanp/dramatiq/pull/782
8386
.. _@mikeroll: https://github.com/mikeroll
87+
.. _#786: https://github.com/Bogdanp/dramatiq/pull/786
8488

8589
Fixed
8690
^^^^^
@@ -1092,8 +1096,8 @@ Changed
10921096
Deprecated
10931097
^^^^^^^^^^
10941098

1095-
* |URLRabbitmqBroker| is deprecated. The |RabbitmqBroker| takes a
1096-
``url`` parameter so use that instead. |URLRabbitmqBroker| will be
1099+
* ``URLRabbitmqBroker`` is deprecated. The |RabbitmqBroker| takes a
1100+
``url`` parameter so use that instead. ``URLRabbitmqBroker`` will be
10971101
removed in version 2.0.
10981102

10991103
Fixed
@@ -1372,7 +1376,7 @@ Changed
13721376
^^^^^^^
13731377

13741378
* Consumer reconnect backoff factor has been lowered from 10s to 100ms.
1375-
* |URLRabbitmqBroker| is now a factory function that creates instances
1379+
* ``URLRabbitmqBroker`` is now a factory function that creates instances
13761380
of |RabbitmqBroker|.
13771381

13781382
Fixed
@@ -1412,7 +1416,7 @@ Fixed
14121416
Added
14131417
^^^^^
14141418

1415-
* |URLRabbitmqbroker| (`@whalesalad`_).
1419+
* ``URLRabbitmqbroker`` (`@whalesalad`_).
14161420
* StubBroker |StubBroker_flush| and |StubBroker_flush_all|.
14171421
* |before_consumer_thread_shutdown| middleware hook.
14181422
* |before_worker_thread_shutdown| middleware hook.

docs/source/global.rst

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,6 @@
4141
.. |StubBroker| replace:: :class:`StubBroker<dramatiq.brokers.stub.StubBroker>`
4242
.. |TimeLimitExceeded| replace:: :class:`TimeLimitExceeded<dramatiq.middleware.TimeLimitExceeded>`
4343
.. |TimeLimit| replace:: :class:`TimeLimit<dramatiq.middleware.TimeLimit>`
44-
.. |URLRabbitmqBroker| replace:: :class:`URLRabbitmqBroker<dramatiq.brokers.rabbitmq.URLRabbitmqBroker>`
4544
.. |WindowRateLimiter| replace:: :class:`WindowRateLimiter<dramatiq.rate_limits.WindowRateLimiter>`
4645
.. |Worker_join| replace:: :meth:`Worker.join<dramatiq.Worker.join>`
4746
.. |Worker_pause| replace:: :meth:`Worker.pause<dramatiq.Worker.pause>`

dramatiq/brokers/rabbitmq.py

Lines changed: 0 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,6 @@
2020
import logging
2121
import os
2222
import time
23-
import warnings
2423
from functools import partial
2524
from itertools import chain
2625
from threading import Event, local
@@ -498,23 +497,6 @@ def join(
498497
self.connection.sleep(idle_time / 1000)
499498

500499

501-
def URLRabbitmqBroker(url: str, *, middleware: Optional[list[Middleware]] = None):
502-
"""Alias for the RabbitMQ broker that takes a connection URL as a
503-
positional argument.
504-
505-
Parameters:
506-
url(str): A connection string.
507-
middleware(list[Middleware]): The middleware to add to this
508-
broker.
509-
"""
510-
warnings.warn(
511-
"Use RabbitmqBroker with the 'url' parameter instead of URLRabbitmqBroker.",
512-
DeprecationWarning,
513-
stacklevel=2,
514-
)
515-
return RabbitmqBroker(url=url, middleware=middleware)
516-
517-
518500
class _IgnoreScaryLogs(logging.Filter):
519501
def filter(self, record):
520502
return "Broken pipe" not in record.getMessage()

tests/test_rabbitmq.py

Lines changed: 0 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,6 @@
1414
from dramatiq.brokers.rabbitmq import (
1515
MAX_DECLARE_ATTEMPTS,
1616
RabbitmqBroker,
17-
URLRabbitmqBroker,
1817
_IgnoreScaryLogs,
1918
)
2019
from dramatiq.common import current_millis
@@ -27,18 +26,6 @@
2726
)
2827

2928

30-
def test_urlrabbitmq_creates_instances_of_rabbitmq_broker():
31-
# Given a URL connection string
32-
url = "amqp://%s:%[email protected]:5672" % (RABBITMQ_USERNAME, RABBITMQ_PASSWORD)
33-
34-
# When I pass that to URLRabbitmqBroker
35-
with pytest.warns(DeprecationWarning):
36-
broker = URLRabbitmqBroker(url)
37-
38-
# Then I should get back a RabbitmqBroker
39-
assert isinstance(broker, RabbitmqBroker)
40-
41-
4229
@skip_unless_rabbit_mq
4330
def test_rabbitmq_broker_can_be_passed_a_semicolon_separated_list_of_uris():
4431
# Given a string with a list of RabbitMQ connection URIs, including an invalid one

0 commit comments

Comments
 (0)