From 7979bd9be01f0dca7dbc945b1949c0dc8ab0b37a Mon Sep 17 00:00:00 2001 From: Evgeni Pandurski Date: Sat, 7 Sep 2019 01:12:22 +0300 Subject: [PATCH] Removed support for Pika < 1.0 --- CHANGES.rst | 8 ++++++++ docs/conf.py | 6 +++--- flask_melodramatiq/rabbitmq.py | 10 +--------- setup.py | 2 +- 4 files changed, 13 insertions(+), 13 deletions(-) diff --git a/CHANGES.rst b/CHANGES.rst index 44ab5ba..d12e827 100644 --- a/CHANGES.rst +++ b/CHANGES.rst @@ -1,6 +1,14 @@ Changelog ========= +Version 0.3.7 +------------- + +- Removed support for `Pika` < 1.0. +- Fixd a connection timeout problem when using + `RabbitmqBroker.publish_message()` + + Version 0.3.6 ------------- diff --git a/docs/conf.py b/docs/conf.py index bfabed9..33dd62c 100644 --- a/docs/conf.py +++ b/docs/conf.py @@ -62,9 +62,9 @@ # built documents. # # The short X.Y version. -version = '0.3.6' +version = '0.3.7' # The full version, including alpha/beta/rc tags. -release = '0.3.6' +release = '0.3.7' # The language for content autogenerated by Sphinx. Refer to documentation # for a list of supported languages. @@ -138,7 +138,7 @@ # The name for this set of Sphinx documents. # " v documentation" by default. # -# html_title = 'Flask-Melodramatiq v0.3.6' +# html_title = 'Flask-Melodramatiq v0.3.7' # A shorter title for the navigation bar. Default is the same as html_title. # diff --git a/flask_melodramatiq/rabbitmq.py b/flask_melodramatiq/rabbitmq.py index a5be056..dfa24d2 100644 --- a/flask_melodramatiq/rabbitmq.py +++ b/flask_melodramatiq/rabbitmq.py @@ -33,17 +33,9 @@ def publish_message(self, message, *, exchange='', routing_key=None): ) attempts = 1 - try: - # In pika 1.0 the legacy `basic_publish` method is - # removed, and `publish` renamed to `basic_publish`. So, - # to support pika versions before and after 1.0 we need an - # ugly hack. - publish = self.channel.publish - except AttributeError: - publish = self.channel.basic_publish while True: try: - publish( + self.channel.basic_publish( exchange=exchange, routing_key=routing_key, body=message.encode(), diff --git a/setup.py b/setup.py index a45a30c..187979b 100644 --- a/setup.py +++ b/setup.py @@ -22,7 +22,7 @@ def rel(*xs): setup( name='Flask-Melodramatiq', - version='0.3.6', + version='0.3.7', url='https://github.com/epandurski/flask_melodramatiq', license='MIT', author='Evgeni Pandurski',