From 0e23435139b05c8ad4a00eeb433ceece121daceea2da392c5a2da72c3f96deff Mon Sep 17 00:00:00 2001 From: Dirk Mueller Date: Mon, 9 May 2022 06:02:09 +0000 Subject: [PATCH] Accepting request 975670 from home:mcalabkova:branches:devel:languages:python - Update to 2.10.4 * Fixed a potential deadlock when opening a channel with a broken connection [#97] * Added support for custom Message implementations * Added Pagination and Filtering support to Management list calls * Updated to use pytest framework instead of nose for testing. * Fixed bug with UriConnection not handling amqps:// properly. * Fixed bad socket fd causing high cpu usage [#110] - Get new pamqp3.patch from https://github.com/eandersson/amqpstorm/pull/95, which should be in v3 (which is somehow not tagged yet) * rebased it to the new codestream - Do not require mock * mock.patch - Update to 2.8.4 OBS-URL: https://build.opensuse.org/request/show/975670 OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/python-amqpstorm?expand=0&rev=29 --- AMQPStorm-2.10.4.tar.gz | 3 + AMQPStorm-2.8.4.tar.gz | 3 - mock.patch | 107 +++++ pamqp3.patch | 897 ++++++++++++++++++++++++++++----------- python-amqpstorm.changes | 18 +- python-amqpstorm.spec | 9 +- 6 files changed, 773 insertions(+), 264 deletions(-) create mode 100644 AMQPStorm-2.10.4.tar.gz delete mode 100644 AMQPStorm-2.8.4.tar.gz create mode 100644 mock.patch diff --git a/AMQPStorm-2.10.4.tar.gz b/AMQPStorm-2.10.4.tar.gz new file mode 100644 index 0000000..934a235 --- /dev/null +++ b/AMQPStorm-2.10.4.tar.gz @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:eb3d4cedd523fe4aaf0171a0ad6161d808da480ad59858698bd5e466af096586 +size 71916 diff --git a/AMQPStorm-2.8.4.tar.gz b/AMQPStorm-2.8.4.tar.gz deleted file mode 100644 index e4c8387..0000000 --- a/AMQPStorm-2.8.4.tar.gz +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:f74f9d32d0d231f2625b16c92ce8649da7cb59de81cb4b4b800fdd34762d3223 -size 77302 diff --git a/mock.patch b/mock.patch new file mode 100644 index 0000000..58163e0 --- /dev/null +++ b/mock.patch @@ -0,0 +1,107 @@ +Index: AMQPStorm-2.10.4/amqpstorm/tests/unit/basic/test_basic.py +=================================================================== +--- AMQPStorm-2.10.4.orig/amqpstorm/tests/unit/basic/test_basic.py ++++ AMQPStorm-2.10.4/amqpstorm/tests/unit/basic/test_basic.py +@@ -3,7 +3,7 @@ import random + import string + import sys + +-import mock ++from unittest import mock + from pamqp import commands + from pamqp.body import ContentBody + from pamqp.header import ContentHeader +Index: AMQPStorm-2.10.4/amqpstorm/tests/unit/channel/test_channel.py +=================================================================== +--- AMQPStorm-2.10.4.orig/amqpstorm/tests/unit/channel/test_channel.py ++++ AMQPStorm-2.10.4/amqpstorm/tests/unit/channel/test_channel.py +@@ -1,4 +1,4 @@ +-import mock ++from unittest import mock + from pamqp import commands + + from amqpstorm import Channel +Index: AMQPStorm-2.10.4/amqpstorm/tests/unit/channel/test_channel_exception.py +=================================================================== +--- AMQPStorm-2.10.4.orig/amqpstorm/tests/unit/channel/test_channel_exception.py ++++ AMQPStorm-2.10.4/amqpstorm/tests/unit/channel/test_channel_exception.py +@@ -1,4 +1,4 @@ +-import mock ++from unittest import mock + from pamqp import commands + + import amqpstorm +Index: AMQPStorm-2.10.4/amqpstorm/tests/unit/channel/test_channel_frame.py +=================================================================== +--- AMQPStorm-2.10.4.orig/amqpstorm/tests/unit/channel/test_channel_frame.py ++++ AMQPStorm-2.10.4/amqpstorm/tests/unit/channel/test_channel_frame.py +@@ -1,4 +1,4 @@ +-import mock ++from unittest import mock + from pamqp.header import ContentHeader + from pamqp import commands + from pamqp.body import ContentBody +Index: AMQPStorm-2.10.4/amqpstorm/tests/unit/channel/test_channel_message_handling.py +=================================================================== +--- AMQPStorm-2.10.4.orig/amqpstorm/tests/unit/channel/test_channel_message_handling.py ++++ AMQPStorm-2.10.4/amqpstorm/tests/unit/channel/test_channel_message_handling.py +@@ -1,6 +1,6 @@ + import threading + +-import mock ++from unittest import mock + from pamqp.header import ContentHeader + from pamqp import commands + from pamqp.body import ContentBody +Index: AMQPStorm-2.10.4/amqpstorm/tests/unit/connection/test_connection.py +=================================================================== +--- AMQPStorm-2.10.4.orig/amqpstorm/tests/unit/connection/test_connection.py ++++ AMQPStorm-2.10.4/amqpstorm/tests/unit/connection/test_connection.py +@@ -1,7 +1,7 @@ + import socket + import threading + +-import mock ++from unittest import mock + from pamqp import exceptions as pamqp_exception + from pamqp import frame as pamqp_frame + from pamqp import commands +Index: AMQPStorm-2.10.4/amqpstorm/tests/unit/io/test_io.py +=================================================================== +--- AMQPStorm-2.10.4.orig/amqpstorm/tests/unit/io/test_io.py ++++ AMQPStorm-2.10.4/amqpstorm/tests/unit/io/test_io.py +@@ -1,7 +1,7 @@ + import socket + import ssl + +-import mock ++from unittest import mock + + import amqpstorm.io + from amqpstorm.exception import AMQPConnectionError +Index: AMQPStorm-2.10.4/amqpstorm/tests/unit/io/test_io_exception.py +=================================================================== +--- AMQPStorm-2.10.4.orig/amqpstorm/tests/unit/io/test_io_exception.py ++++ AMQPStorm-2.10.4/amqpstorm/tests/unit/io/test_io_exception.py +@@ -3,7 +3,7 @@ import socket + from errno import EINTR + from errno import EWOULDBLOCK + +-import mock ++from unittest import mock + + from amqpstorm import AMQPConnectionError + from amqpstorm import compatibility +Index: AMQPStorm-2.10.4/amqpstorm/tests/unit/test_rpc.py +=================================================================== +--- AMQPStorm-2.10.4.orig/amqpstorm/tests/unit/test_rpc.py ++++ AMQPStorm-2.10.4/amqpstorm/tests/unit/test_rpc.py +@@ -1,7 +1,7 @@ + import threading + import time + +-import mock ++from unittest import mock + + from amqpstorm.exception import AMQPChannelError + from amqpstorm.rpc import Rpc diff --git a/pamqp3.patch b/pamqp3.patch index 72e6d16..6c4ab20 100644 --- a/pamqp3.patch +++ b/pamqp3.patch @@ -1,7 +1,82 @@ -Index: AMQPStorm-2.8.4/amqpstorm/basic.py +From 6b552634d3e5f6021b13e0ab9c98869402cbb2b7 Mon Sep 17 00:00:00 2001 +From: Erik Olof Gunnar Andersson +Date: Thu, 25 Jun 2020 00:16:57 -0700 +Subject: [PATCH 1/2] Initial pamqp3 support + +--- + .travis.yml | 1 - + LICENSE | 2 +- + README.rst | 71 +------------------ + amqpstorm/__init__.py | 2 +- + amqpstorm/basic.py | 67 ++++++++--------- + amqpstorm/channel.py | 14 ++-- + amqpstorm/channel0.py | 12 ++-- + amqpstorm/compatibility.py | 45 ++---------- + amqpstorm/connection.py | 3 +- + amqpstorm/exchange.py | 2 +- + amqpstorm/queue.py | 2 +- + amqpstorm/tests/functional/test_generic.py | 6 +- + .../tests/unit/basic/test_basic_exception.py | 4 +- + amqpstorm/tests/unit/basic/test_basic.py | 60 +++++++--------- + .../unit/channel/test_channel_exception.py | 9 +-- + .../tests/unit/channel/test_channel_frame.py | 24 +++---- + .../channel/test_channel_message_handling.py | 46 ++++++------ + amqpstorm/tests/unit/channel/test_channel.py | 22 +++--- + .../unit/channel0/channel0test__frame.py | 2 +- + .../tests/unit/channel0/channel0test_.py | 2 +- + amqpstorm/tests/unit/test_compatiblity.py | 46 +----------- + .../tests/unit/connection/test_connection.py | 17 ++--- + .../tests/unit/exchange/test_exchange.py | 2 +- + amqpstorm/tests/unit/queue/test_queue.py | 8 +-- + amqpstorm/tests/unit/test_tx.py | 26 +++---- + .../test_uri_connection_exception.py | 6 -- + amqpstorm/tx.py | 8 +-- + requirements.txt | 2 +- + setup.cfg | 2 +- + setup.py | 9 +-- + 30 files changed, 180 insertions(+), 342 deletions(-) + +Index: AMQPStorm-2.10.4/LICENSE =================================================================== ---- AMQPStorm-2.8.4.orig/amqpstorm/basic.py -+++ AMQPStorm-2.8.4/amqpstorm/basic.py +--- AMQPStorm-2.10.4.orig/LICENSE ++++ AMQPStorm-2.10.4/LICENSE +@@ -1,6 +1,6 @@ + The MIT License (MIT) + +-Copyright (c) 2014-2020 Erik Olof Gunnar Andersson ++Copyright (c) 2014-2021 Erik Olof Gunnar Andersson + + Permission is hereby granted, free of charge, to any person obtaining a copy + of this software and associated documentation files (the "Software"), to deal +Index: AMQPStorm-2.10.4/README.rst +=================================================================== +--- AMQPStorm-2.10.4.orig/README.rst ++++ AMQPStorm-2.10.4/README.rst +@@ -9,8 +9,7 @@ Introduction + AMQPStorm is a library designed to be consistent, stable and thread-safe. + + - 100% Test Coverage! +-- Supports Python 2.7 and Python 3.3+. +-- Fully tested against Python Implementations; CPython and PyPy. ++- Supports Python 3.6+. + + Documentation + ============= +@@ -122,5 +121,10 @@ Credits + ======= + Special thanks to gmr (Gavin M. Roy) for creating pamqp, and in addition amqpstorm is heavily influenced by his pika and rabbitpy libraries. + ++Version 3.0.0 Alpha 1 ++--------------------- ++- This version requires Python 3.6 or newer. ++- Upgraded to pamqp3. ++ + .. |Version| image:: https://badge.fury.io/py/AMQPStorm.svg + :target: https://badge.fury.io/py/AMQPStorm +Index: AMQPStorm-2.10.4/amqpstorm/basic.py +=================================================================== +--- AMQPStorm-2.10.4.orig/amqpstorm/basic.py ++++ AMQPStorm-2.10.4/amqpstorm/basic.py @@ -5,7 +5,7 @@ import math from pamqp import body as pamqp_body @@ -10,26 +85,30 @@ Index: AMQPStorm-2.8.4/amqpstorm/basic.py +from pamqp import commands from amqpstorm import compatibility - from amqpstorm.base import Handler -@@ -45,7 +45,7 @@ class Basic(Handler): + from amqpstorm.base import BaseMessage +@@ -46,9 +46,9 @@ class Basic(Handler): raise AMQPInvalidArgument('prefetch_size should be an integer') elif not isinstance(global_, bool): raise AMQPInvalidArgument('global_ should be a boolean') - qos_frame = specification.Basic.Qos(prefetch_count=prefetch_count, +- prefetch_size=prefetch_size, +- global_=global_) + qos_frame = commands.Basic.Qos(prefetch_count=prefetch_count, - prefetch_size=prefetch_size, - global_=global_) ++ prefetch_size=prefetch_size, ++ global_=global_) return self._channel.rpc_request(qos_frame) -@@ -76,7 +76,7 @@ class Basic(Handler): - elif self._channel.consumer_tags: - raise AMQPChannelError("Cannot call 'get' when channel is " - "set to consume") + + def get(self, queue='', no_ack=False, to_dict=False, auto_decode=True, +@@ -85,7 +85,7 @@ class Basic(Handler): + ) + else: + message_impl = Message - get_frame = specification.Basic.Get(queue=queue, + get_frame = commands.Basic.Get(queue=queue, no_ack=no_ack) with self._channel.lock and self._channel.rpc.lock: - message = self._get_message(get_frame, auto_decode=auto_decode) -@@ -98,7 +98,7 @@ class Basic(Handler): + message = self._get_message(get_frame, auto_decode=auto_decode, +@@ -108,7 +108,7 @@ class Basic(Handler): """ if not isinstance(requeue, bool): raise AMQPInvalidArgument('requeue should be a boolean') @@ -38,7 +117,7 @@ Index: AMQPStorm-2.8.4/amqpstorm/basic.py return self._channel.rpc_request(recover_frame) def consume(self, callback=None, queue='', consumer_tag='', -@@ -154,7 +154,7 @@ class Basic(Handler): +@@ -164,7 +164,7 @@ class Basic(Handler): """ if not compatibility.is_string(consumer_tag): raise AMQPInvalidArgument('consumer_tag should be a string') @@ -47,54 +126,89 @@ Index: AMQPStorm-2.8.4/amqpstorm/basic.py result = self._channel.rpc_request(cancel_frame) self._channel.remove_consumer_tag(consumer_tag) return result -@@ -181,8 +181,8 @@ class Basic(Handler): +@@ -191,11 +191,11 @@ class Basic(Handler): properties, routing_key) properties = properties or {} body = self._handle_utf8_payload(body, properties) - properties = specification.Basic.Properties(**properties) - method_frame = specification.Basic.Publish(exchange=exchange, +- routing_key=routing_key, +- mandatory=mandatory, +- immediate=immediate) + properties = commands.Basic.Properties(**properties) + method_frame = commands.Basic.Publish(exchange=exchange, - routing_key=routing_key, - mandatory=mandatory, - immediate=immediate) -@@ -215,7 +215,7 @@ class Basic(Handler): ++ routing_key=routing_key, ++ mandatory=mandatory, ++ immediate=immediate) + header_frame = pamqp_header.ContentHeader(body_size=len(body), + properties=properties) + +@@ -225,8 +225,8 @@ class Basic(Handler): raise AMQPInvalidArgument('delivery_tag should be an integer') elif not isinstance(multiple, bool): raise AMQPInvalidArgument('multiple should be a boolean') - ack_frame = specification.Basic.Ack(delivery_tag=delivery_tag, +- multiple=multiple) + ack_frame = commands.Basic.Ack(delivery_tag=delivery_tag, - multiple=multiple) ++ multiple=multiple) self._channel.write_frame(ack_frame) -@@ -239,7 +239,7 @@ class Basic(Handler): + def nack(self, delivery_tag=0, multiple=False, requeue=True): +@@ -249,9 +249,9 @@ class Basic(Handler): raise AMQPInvalidArgument('multiple should be a boolean') elif not isinstance(requeue, bool): raise AMQPInvalidArgument('requeue should be a boolean') - nack_frame = specification.Basic.Nack(delivery_tag=delivery_tag, +- multiple=multiple, +- requeue=requeue) + nack_frame = commands.Basic.Nack(delivery_tag=delivery_tag, - multiple=multiple, - requeue=requeue) ++ multiple=multiple, ++ requeue=requeue) self._channel.write_frame(nack_frame) -@@ -261,7 +261,7 @@ class Basic(Handler): + + def reject(self, delivery_tag=0, requeue=True): +@@ -271,8 +271,8 @@ class Basic(Handler): raise AMQPInvalidArgument('delivery_tag should be an integer') elif not isinstance(requeue, bool): raise AMQPInvalidArgument('requeue should be a boolean') - reject_frame = specification.Basic.Reject(delivery_tag=delivery_tag, +- requeue=requeue) + reject_frame = commands.Basic.Reject(delivery_tag=delivery_tag, - requeue=requeue) ++ requeue=requeue) self._channel.write_frame(reject_frame) -@@ -289,7 +289,7 @@ class Basic(Handler): + def _consume_add_and_get_tag(self, consume_rpc_result): +@@ -299,12 +299,12 @@ class Basic(Handler): :rtype: dict """ - consume_frame = specification.Basic.Consume(queue=queue, +- consumer_tag=consumer_tag, +- exclusive=exclusive, +- no_local=no_local, +- no_ack=no_ack, +- arguments=arguments) + consume_frame = commands.Basic.Consume(queue=queue, - consumer_tag=consumer_tag, - exclusive=exclusive, - no_local=no_local, -@@ -360,7 +360,7 @@ class Basic(Handler): ++ consumer_tag=consumer_tag, ++ exclusive=exclusive, ++ no_local=no_local, ++ no_ack=no_ack, ++ arguments=arguments) + return self._channel.rpc_request(consume_frame) + + @staticmethod +@@ -348,9 +348,7 @@ class Basic(Handler): + if 'content_encoding' not in properties: + properties['content_encoding'] = 'utf-8' + encoding = properties['content_encoding'] +- if compatibility.is_unicode(body): +- body = body.encode(encoding) +- elif compatibility.PYTHON3 and isinstance(body, str): ++ if isinstance(body, str): + body = bytes(body, encoding=encoding) + return body + +@@ -371,7 +369,7 @@ class Basic(Handler): get_ok_frame = self._channel.rpc.get_request(message_uuid, raw=True, multiple=True) @@ -103,7 +217,7 @@ Index: AMQPStorm-2.8.4/amqpstorm/basic.py return None content_header = self._channel.rpc.get_request(message_uuid, raw=True, -@@ -388,7 +388,7 @@ class Basic(Handler): +@@ -399,7 +397,7 @@ class Basic(Handler): result = self._channel.rpc.get_request(confirm_uuid, raw=True) if mandatory: self._channel.check_for_exceptions() @@ -112,29 +226,31 @@ Index: AMQPStorm-2.8.4/amqpstorm/basic.py return True return False -Index: AMQPStorm-2.8.4/amqpstorm/channel.py +Index: AMQPStorm-2.10.4/amqpstorm/channel.py =================================================================== ---- AMQPStorm-2.8.4.orig/amqpstorm/channel.py -+++ AMQPStorm-2.8.4/amqpstorm/channel.py +--- AMQPStorm-2.10.4.orig/amqpstorm/channel.py ++++ AMQPStorm-2.10.4/amqpstorm/channel.py @@ -3,7 +3,7 @@ import logging - from time import sleep + import time -from pamqp import specification +from pamqp import commands from pamqp.header import ContentHeader from amqpstorm import compatibility -@@ -184,7 +184,7 @@ class Channel(BaseChannel): +@@ -195,7 +195,9 @@ class Channel(BaseChannel): self.stop_consuming() except AMQPChannelError: self.remove_consumer_tag() - self.rpc_request(specification.Channel.Close( + self.rpc_request(commands.Channel.Close( ++ class_id=0, ++ method_id=0, reply_code=reply_code, reply_text=reply_text), connection_adapter=self._connection -@@ -240,7 +240,7 @@ class Channel(BaseChannel): +@@ -249,7 +251,7 @@ class Channel(BaseChannel): :return: """ self._confirming_deliveries = True @@ -143,7 +259,7 @@ Index: AMQPStorm-2.8.4/amqpstorm/channel.py return self.rpc_request(confirm_frame) @property -@@ -273,7 +273,7 @@ class Channel(BaseChannel): +@@ -282,7 +284,7 @@ class Channel(BaseChannel): elif frame_in.name == 'Channel.Close': self._close_channel(frame_in) elif frame_in.name == 'Channel.Flow': @@ -152,52 +268,16 @@ Index: AMQPStorm-2.8.4/amqpstorm/channel.py else: LOGGER.error( '[Channel%d] Unhandled Frame: %s -- %s', -@@ -288,7 +288,7 @@ class Channel(BaseChannel): - self._inbound = [] +@@ -298,7 +300,7 @@ class Channel(BaseChannel): self._exceptions = [] + self._confirming_deliveries = False self.set_state(self.OPENING) - self.rpc_request(specification.Channel.Open()) + self.rpc_request(commands.Channel.Open()) self.set_state(self.OPEN) def process_data_events(self, to_tuple=False, auto_decode=True): -@@ -319,7 +319,7 @@ class Channel(BaseChannel): - def rpc_request(self, frame_out, connection_adapter=None): - """Perform a RPC Request. - -- :param specification.Frame frame_out: Amqp frame. -+ :param commands.Frame frame_out: Amqp frame. - :rtype: dict - """ - with self.rpc.lock: -@@ -371,7 +371,7 @@ class Channel(BaseChannel): - def write_frame(self, frame_out): - """Write a pamqp frame from the current channel. - -- :param specification.Frame frame_out: A single pamqp frame. -+ :param commands.Frame frame_out: A single pamqp frame. - - :return: - """ -@@ -391,7 +391,7 @@ class Channel(BaseChannel): - def _basic_cancel(self, frame_in): - """Handle a Basic Cancel frame. - -- :param specification.Basic.Cancel frame_in: Amqp frame. -+ :param commands.Basic.Cancel frame_in: Amqp frame. - - :return: - """ -@@ -404,7 +404,7 @@ class Channel(BaseChannel): - def _basic_return(self, frame_in): - """Handle a Basic Return Frame and treat it as an error. - -- :param specification.Basic.Return frame_in: Amqp frame. -+ :param commands.Basic.Return frame_in: Amqp frame. - - :return: - """ -@@ -451,7 +451,7 @@ class Channel(BaseChannel): +@@ -462,7 +464,7 @@ class Channel(BaseChannel): :rtype: tuple,None """ basic_deliver = self._inbound.pop(0) @@ -206,19 +286,19 @@ Index: AMQPStorm-2.8.4/amqpstorm/channel.py LOGGER.warning( 'Received an out-of-order frame: %s was ' 'expecting a Basic.Deliver frame', -@@ -489,7 +489,7 @@ class Channel(BaseChannel): - def _close_channel(self, frame_in): - """Close Channel. - -- :param specification.Channel.Close frame_in: Channel Close frame. -+ :param commands.Channel.Close frame_in: Channel Close frame. - :return: - """ - self.set_state(self.CLOSED) -Index: AMQPStorm-2.8.4/amqpstorm/channel0.py +@@ -506,7 +508,7 @@ class Channel(BaseChannel): + self.set_state(self.CLOSING) + if not self._connection.is_closed: + try: +- self.write_frame(specification.Channel.CloseOk()) ++ self.write_frame(commands.Channel.CloseOk()) + except AMQPError: + pass + self.remove_consumer_tag() +Index: AMQPStorm-2.10.4/amqpstorm/channel0.py =================================================================== ---- AMQPStorm-2.8.4.orig/amqpstorm/channel0.py -+++ AMQPStorm-2.8.4/amqpstorm/channel0.py +--- AMQPStorm-2.10.4.orig/amqpstorm/channel0.py ++++ AMQPStorm-2.10.4/amqpstorm/channel0.py @@ -3,7 +3,7 @@ import logging import platform @@ -228,34 +308,18 @@ Index: AMQPStorm-2.8.4/amqpstorm/channel0.py from pamqp.heartbeat import Heartbeat from amqpstorm import __version__ -@@ -64,7 +64,7 @@ class Channel0(object): +@@ -64,7 +64,9 @@ class Channel0(object): :return: """ - self._write_frame(specification.Connection.Close()) -+ self._write_frame(commands.Connection.Close()) ++ self._write_frame(commands.Connection.Close( ++ class_id=0, method_id=0, reply_code=0 ++ )) def send_heartbeat(self): """Send Heartbeat frame. -@@ -78,7 +78,7 @@ class Channel0(object): - def _close_connection(self, frame_in): - """Connection Close. - -- :param specification.Connection.Close frame_in: Amqp frame. -+ :param commands.Connection.Close frame_in: Amqp frame. - :return: - """ - self._set_connection_state(Stateful.CLOSED) -@@ -141,7 +141,7 @@ class Channel0(object): - def _send_start_ok(self, frame_in): - """Send Start OK frame. - -- :param specification.Connection.Start frame_in: Amqp frame. -+ :param commands.Connection.Start frame_in: Amqp frame. - :return: - """ - mechanisms = try_utf8_decode(frame_in.mechanisms) -@@ -158,7 +158,7 @@ class Channel0(object): +@@ -158,7 +160,7 @@ class Channel0(object): ) self._connection.exceptions.append(exception) return @@ -264,16 +328,7 @@ Index: AMQPStorm-2.8.4/amqpstorm/channel0.py mechanism=mechanism, client_properties=self._client_properties(), response=credentials, -@@ -169,7 +169,7 @@ class Channel0(object): - def _send_tune_ok(self, frame_in): - """Send Tune OK frame. - -- :param specification.Connection.Tune frame_in: Tune frame. -+ :param commands.Connection.Tune frame_in: Tune frame. - - :return: - """ -@@ -182,7 +182,7 @@ class Channel0(object): +@@ -182,7 +184,7 @@ class Channel0(object): self.max_frame_size, self.max_allowed_channels ) @@ -282,7 +337,7 @@ Index: AMQPStorm-2.8.4/amqpstorm/channel0.py channel_max=self.max_allowed_channels, frame_max=self.max_frame_size, heartbeat=self._heartbeat) -@@ -193,7 +193,7 @@ class Channel0(object): +@@ -193,7 +195,7 @@ class Channel0(object): :return: """ @@ -291,41 +346,130 @@ Index: AMQPStorm-2.8.4/amqpstorm/channel0.py virtual_host=self._parameters['virtual_host'] ) self._write_frame(open_frame) -Index: AMQPStorm-2.8.4/amqpstorm/connection.py +Index: AMQPStorm-2.10.4/amqpstorm/compatibility.py =================================================================== ---- AMQPStorm-2.8.4.orig/amqpstorm/connection.py -+++ AMQPStorm-2.8.4/amqpstorm/connection.py -@@ -7,7 +7,7 @@ from time import sleep +--- AMQPStorm-2.10.4.orig/amqpstorm/compatibility.py ++++ AMQPStorm-2.10.4/amqpstorm/compatibility.py +@@ -1,7 +1,5 @@ + """Python 2/3 Compatibility layer.""" + +-import sys +- + try: + import ssl + except ImportError: +@@ -12,22 +10,12 @@ try: + except ImportError: + import json # noqa + +-try: +- import urlparse # noqa +-except ImportError: +- import urllib.parse as urlparse # noqa + +-try: +- from urllib import quote # noqa +-except ImportError: +- from urllib.parse import quote # noqa ++import urllib.parse as urlparse # noqa ++from urllib.parse import quote # noqa + +-PYTHON3 = sys.version_info >= (3, 0, 0) + +-if PYTHON3: +- RANGE = range +-else: +- RANGE = xrange ++RANGE = range + + + class DummyException(Exception): +@@ -90,11 +78,7 @@ def is_string(obj): + :param object obj: + :rtype: bool + """ +- if PYTHON3: +- str_type = (bytes, str) +- else: +- str_type = (bytes, str, unicode) +- return isinstance(obj, str_type) ++ return isinstance(obj, (bytes, str)) + + + def is_integer(obj): +@@ -103,22 +87,7 @@ def is_integer(obj): + :param object obj: + :return: + """ +- if PYTHON3: +- return isinstance(obj, int) +- return isinstance(obj, (int, long)) +- +- +-def is_unicode(obj): +- """Is this a unicode string. +- +- This always returns False if running Python 3.x. +- +- :param object obj: +- :rtype: bool +- """ +- if PYTHON3: +- return False +- return isinstance(obj, unicode) ++ return isinstance(obj, int) + + + def try_utf8_decode(value): +@@ -129,9 +98,7 @@ def try_utf8_decode(value): + """ + if not value or not is_string(value): + return value +- elif PYTHON3 and not isinstance(value, bytes): +- return value +- elif not PYTHON3 and not isinstance(value, unicode): ++ elif not isinstance(value, bytes): + return value + + try: +Index: AMQPStorm-2.10.4/amqpstorm/connection.py +=================================================================== +--- AMQPStorm-2.10.4.orig/amqpstorm/connection.py ++++ AMQPStorm-2.10.4/amqpstorm/connection.py +@@ -8,7 +8,6 @@ from time import sleep from pamqp import exceptions as pamqp_exception from pamqp import frame as pamqp_frame from pamqp import header as pamqp_header -from pamqp import specification -+from pamqp import commands from amqpstorm import compatibility from amqpstorm.base import IDLE_WAIT -@@ -253,7 +253,7 @@ class Connection(Stateful): - """Marshal and write an outgoing pamqp frame to the Socket. - - :param int channel_id: Channel ID. -- :param specification.Frame frame_out: Amqp frame. -+ :param commands.Frame frame_out: Amqp frame. - - :return: - """ -@@ -320,7 +320,7 @@ class Connection(Stateful): +@@ -323,7 +322,7 @@ class Connection(Stateful): return data_in[byte_count:], channel_id, frame_in except pamqp_exception.UnmarshalingException: pass - except specification.AMQPFrameError as why: -+ except commands.AMQPFrameError as why: ++ except pamqp_exception.AMQPFrameError as why: LOGGER.error('AMQPFrameError: %r', why, exc_info=True) except ValueError as why: LOGGER.error(why, exc_info=True) -Index: AMQPStorm-2.8.4/amqpstorm/queue.py +Index: AMQPStorm-2.10.4/amqpstorm/exchange.py =================================================================== ---- AMQPStorm-2.8.4.orig/amqpstorm/queue.py -+++ AMQPStorm-2.8.4/amqpstorm/queue.py +--- AMQPStorm-2.10.4.orig/amqpstorm/exchange.py ++++ AMQPStorm-2.10.4/amqpstorm/exchange.py +@@ -2,7 +2,7 @@ + + import logging + +-from pamqp.specification import Exchange as pamqp_exchange ++from pamqp.commands import Exchange as pamqp_exchange + + from amqpstorm import compatibility + from amqpstorm.base import Handler +Index: AMQPStorm-2.10.4/amqpstorm/queue.py +=================================================================== +--- AMQPStorm-2.10.4.orig/amqpstorm/queue.py ++++ AMQPStorm-2.10.4/amqpstorm/queue.py @@ -2,7 +2,7 @@ import logging @@ -335,17 +479,48 @@ Index: AMQPStorm-2.8.4/amqpstorm/queue.py from amqpstorm import compatibility from amqpstorm.base import Handler -Index: AMQPStorm-2.8.4/amqpstorm/tests/unit/basic/basic_exception_tests.py +Index: AMQPStorm-2.10.4/amqpstorm/tests/functional/test_generic.py =================================================================== ---- AMQPStorm-2.8.4.orig/amqpstorm/tests/unit/basic/basic_exception_tests.py -+++ AMQPStorm-2.8.4/amqpstorm/tests/unit/basic/basic_exception_tests.py +--- AMQPStorm-2.10.4.orig/amqpstorm/tests/functional/test_generic.py ++++ AMQPStorm-2.10.4/amqpstorm/tests/functional/test_generic.py +@@ -175,7 +175,7 @@ class GenericTest(TestFunctionalFramewor + # Old way + result = payload.to_dict() + self.assertEqual(result['properties']['headers']['key'], 1234567890) +- self.assertEqual(result['properties']['headers']['alpha'], b'omega') ++ self.assertEqual(result['properties']['headers']['alpha'], 'omega') + self.assertIsInstance(result['properties']['app_id'], str) + self.assertIsInstance(result['properties']['correlation_id'], str) + self.assertEqual(result['properties']['app_id'], app_id) +@@ -197,7 +197,7 @@ class GenericTest(TestFunctionalFramewor + self.assertEqual(message.app_id, 'travis-ci') + + # Assign Property app_id +- app_id = 'travis-ci-2'.encode('utf-8') ++ app_id = 'travis-ci-2' + message.app_id = app_id + + # Check that it was set correctly. +@@ -213,7 +213,7 @@ class GenericTest(TestFunctionalFramewor + time.sleep(0.01) + + payload = self.channel.basic.get(self.queue_name, no_ack=True) +- self.assertEqual(payload.app_id, app_id.decode('utf-8')) ++ self.assertEqual(payload.app_id, app_id) + self.assertEqual(payload.correlation_id, correlation_id) + self.assertIsInstance(payload.properties['app_id'], str) + self.assertIsInstance(payload.properties['correlation_id'], str) +Index: AMQPStorm-2.10.4/amqpstorm/tests/unit/basic/test_basic_exception.py +=================================================================== +--- AMQPStorm-2.10.4.orig/amqpstorm/tests/unit/basic/test_basic_exception.py ++++ AMQPStorm-2.10.4/amqpstorm/tests/unit/basic/test_basic_exception.py @@ -1,4 +1,4 @@ -from pamqp import specification +from pamqp import commands from pamqp.body import ContentBody from amqpstorm import Channel -@@ -266,7 +266,7 @@ class BasicExceptionTests(TestFramework) +@@ -277,7 +277,7 @@ class BasicExceptionTests(TestFramework) def test_basic_publish_confirms_raises_on_invalid_frame(self): def on_publish_return_invalid_frame(*_): @@ -354,20 +529,26 @@ Index: AMQPStorm-2.8.4/amqpstorm/tests/unit/basic/basic_exception_tests.py connection = FakeConnection(on_write=on_publish_return_invalid_frame) channel = Channel(9, connection, 0.01) -Index: AMQPStorm-2.8.4/amqpstorm/tests/unit/basic/basic_tests.py +Index: AMQPStorm-2.10.4/amqpstorm/tests/unit/basic/test_basic.py =================================================================== ---- AMQPStorm-2.8.4.orig/amqpstorm/tests/unit/basic/basic_tests.py -+++ AMQPStorm-2.8.4/amqpstorm/tests/unit/basic/basic_tests.py +--- AMQPStorm-2.10.4.orig/amqpstorm/tests/unit/basic/test_basic.py ++++ AMQPStorm-2.10.4/amqpstorm/tests/unit/basic/test_basic.py @@ -4,7 +4,7 @@ import string import sys - from mock import Mock + import mock -from pamqp import specification +from pamqp import commands from pamqp.body import ContentBody from pamqp.header import ContentHeader -@@ -20,7 +20,7 @@ from amqpstorm.tests.utility import unit +@@ -15,13 +15,12 @@ from amqpstorm.compatibility import RANG + from amqpstorm.exception import AMQPChannelError + from amqpstorm.tests.utility import FakeConnection + from amqpstorm.tests.utility import TestFramework +-from amqpstorm.tests.utility import unittest + + class BasicTests(TestFramework): def test_basic_qos(self): def on_qos_frame(*_): @@ -376,7 +557,7 @@ Index: AMQPStorm-2.8.4/amqpstorm/tests/unit/basic/basic_tests.py connection = FakeConnection(on_write=on_qos_frame) channel = Channel(9, connection, 1) -@@ -34,7 +34,7 @@ class BasicTests(TestFramework): +@@ -35,7 +34,7 @@ class BasicTests(TestFramework): message_len = len(message) def on_get_frame(*_): @@ -385,7 +566,7 @@ Index: AMQPStorm-2.8.4/amqpstorm/tests/unit/basic/basic_tests.py channel.rpc.on_frame(ContentHeader(body_size=message_len)) channel.rpc.on_frame(ContentBody(value=message)) -@@ -54,7 +54,7 @@ class BasicTests(TestFramework): +@@ -55,7 +54,7 @@ class BasicTests(TestFramework): message_len = len(message) def on_get_frame(*_): @@ -394,7 +575,7 @@ Index: AMQPStorm-2.8.4/amqpstorm/tests/unit/basic/basic_tests.py channel.rpc.on_frame(ContentHeader(body_size=message_len)) channel.rpc.on_frame(ContentBody(value=message)) -@@ -71,7 +71,7 @@ class BasicTests(TestFramework): +@@ -72,7 +71,7 @@ class BasicTests(TestFramework): def test_basic_get_empty(self): def on_get_frame(*_): @@ -403,7 +584,7 @@ Index: AMQPStorm-2.8.4/amqpstorm/tests/unit/basic/basic_tests.py connection = FakeConnection(on_write=on_get_frame) channel = Channel(9, connection, 1) -@@ -104,7 +104,7 @@ class BasicTests(TestFramework): +@@ -105,7 +104,7 @@ class BasicTests(TestFramework): def test_basic_recover(self): def on_recover_frame(*_): @@ -412,7 +593,7 @@ Index: AMQPStorm-2.8.4/amqpstorm/tests/unit/basic/basic_tests.py connection = FakeConnection(on_write=on_recover_frame) channel = Channel(9, connection, 1) -@@ -117,7 +117,7 @@ class BasicTests(TestFramework): +@@ -118,7 +117,7 @@ class BasicTests(TestFramework): tag = 'travis-ci' def on_consume_frame(*_): @@ -421,7 +602,7 @@ Index: AMQPStorm-2.8.4/amqpstorm/tests/unit/basic/basic_tests.py connection = FakeConnection(on_write=on_consume_frame) channel = Channel(9, connection, 1) -@@ -129,7 +129,7 @@ class BasicTests(TestFramework): +@@ -130,7 +129,7 @@ class BasicTests(TestFramework): def test_basic_ack(self): def on_write(channel, frame): self.assertEqual(channel, 9) @@ -430,7 +611,7 @@ Index: AMQPStorm-2.8.4/amqpstorm/tests/unit/basic/basic_tests.py connection = FakeConnection(on_write=on_write) channel = Channel(9, connection, 1) -@@ -141,7 +141,7 @@ class BasicTests(TestFramework): +@@ -142,7 +141,7 @@ class BasicTests(TestFramework): def test_basic_nack(self): def on_write(channel, frame): self.assertEqual(channel, 9) @@ -439,7 +620,7 @@ Index: AMQPStorm-2.8.4/amqpstorm/tests/unit/basic/basic_tests.py connection = FakeConnection(on_write=on_write) channel = Channel(9, connection, 1) -@@ -153,7 +153,7 @@ class BasicTests(TestFramework): +@@ -154,7 +153,7 @@ class BasicTests(TestFramework): def test_basic_reject(self): def on_write(channel, frame): self.assertEqual(channel, 9) @@ -448,7 +629,7 @@ Index: AMQPStorm-2.8.4/amqpstorm/tests/unit/basic/basic_tests.py connection = FakeConnection(on_write=on_write) channel = Channel(9, connection, 1) -@@ -187,7 +187,7 @@ class BasicTests(TestFramework): +@@ -188,7 +187,7 @@ class BasicTests(TestFramework): self.assertEqual(channel_id, 9) # Verify Classes @@ -457,7 +638,7 @@ Index: AMQPStorm-2.8.4/amqpstorm/tests/unit/basic/basic_tests.py self.assertIsInstance(content_header, ContentHeader) self.assertIsInstance(content_body, ContentBody) -@@ -201,7 +201,7 @@ class BasicTests(TestFramework): +@@ -202,7 +201,7 @@ class BasicTests(TestFramework): def test_basic_publish_confirms_ack(self): def on_publish_return_ack(*_): @@ -466,7 +647,7 @@ Index: AMQPStorm-2.8.4/amqpstorm/tests/unit/basic/basic_tests.py connection = FakeConnection(on_write=on_publish_return_ack) channel = Channel(9, connection, 1) -@@ -214,7 +214,7 @@ class BasicTests(TestFramework): +@@ -215,7 +214,7 @@ class BasicTests(TestFramework): def test_basic_publish_confirms_nack(self): def on_publish_return_nack(*_): @@ -475,13 +656,14 @@ Index: AMQPStorm-2.8.4/amqpstorm/tests/unit/basic/basic_tests.py connection = FakeConnection(on_write=on_publish_return_nack) channel = Channel(9, connection, 1) -@@ -275,11 +275,11 @@ class BasicTests(TestFramework): +@@ -276,11 +275,11 @@ class BasicTests(TestFramework): message = self.message.encode('utf-8') message_len = len(message) - get_frame = specification.Basic.Get(queue='travis-ci', +- no_ack=False) + get_frame = commands.Basic.Get(queue='travis-ci', - no_ack=False) ++ no_ack=False) def on_get_frame(*_): - channel.rpc.on_frame(specification.Basic.GetOk()) @@ -489,13 +671,14 @@ Index: AMQPStorm-2.8.4/amqpstorm/tests/unit/basic/basic_tests.py channel.rpc.on_frame(ContentHeader(body_size=message_len)) channel.rpc.on_frame(ContentBody(value=message)) -@@ -296,11 +296,11 @@ class BasicTests(TestFramework): +@@ -298,11 +297,11 @@ class BasicTests(TestFramework): message = self.message.encode('utf-8') message_len = len(message) - get_frame = specification.Basic.Get(queue='travis-ci', +- no_ack=False) + get_frame = commands.Basic.Get(queue='travis-ci', - no_ack=False) ++ no_ack=False) def on_get_frame(*_): - channel.rpc.on_frame(specification.Basic.GetOk()) @@ -503,13 +686,14 @@ Index: AMQPStorm-2.8.4/amqpstorm/tests/unit/basic/basic_tests.py channel.rpc.on_frame(ContentHeader(body_size=message_len)) channel.rpc.on_frame(ContentBody(value=message)) -@@ -314,11 +314,11 @@ class BasicTests(TestFramework): +@@ -317,11 +316,11 @@ class BasicTests(TestFramework): self.assertEqual(result.body.encode('utf-8'), message) def test_basic_get_message_empty_queue(self): - get_frame = specification.Basic.Get(queue='travis-ci', +- no_ack=False) + get_frame = commands.Basic.Get(queue='travis-ci', - no_ack=False) ++ no_ack=False) def on_get_frame(*_): - channel.rpc.on_frame(specification.Basic.GetEmpty()) @@ -517,7 +701,31 @@ Index: AMQPStorm-2.8.4/amqpstorm/tests/unit/basic/basic_tests.py connection = FakeConnection(on_write=on_get_frame) channel = Channel(9, connection, 1) -@@ -396,14 +396,14 @@ class BasicTests(TestFramework): +@@ -354,7 +353,6 @@ class BasicTests(TestFramework): + + self.assertEqual(basic._get_content_body(uuid, 10), b'') + +- @unittest.skipIf(sys.version_info[0] == 2, 'No bytes decoding in Python 2') + def test_basic_py3_utf_8_payload(self): + message = 'Hellå World!' + basic = Basic(None) +@@ -362,15 +360,6 @@ class BasicTests(TestFramework): + + self.assertEqual(payload, b'Hell\xc3\xa5 World!') + +- @unittest.skipIf(sys.version_info[0] == 3, 'No unicode obj in Python 3') +- def test_basic_py2_utf_8_payload(self): +- message = u'Hellå World!' +- basic = Basic(None) +- properties = {} +- payload = basic._handle_utf8_payload(message, properties) +- +- self.assertEqual(payload, 'Hell\xc3\xa5 World!') +- + def test_basic_content_in_properties(self): + basic = Basic(None) + properties = { +@@ -400,14 +389,14 @@ class BasicTests(TestFramework): tag = 'travis-ci' def on_publish_return_ack(_, frame): @@ -534,28 +742,31 @@ Index: AMQPStorm-2.8.4/amqpstorm/tests/unit/basic/basic_tests.py connection = FakeConnection(on_write=on_publish_return_ack) channel = Channel(9, connection, 1) -Index: AMQPStorm-2.8.4/amqpstorm/tests/unit/channel/channel_exception_tests.py +Index: AMQPStorm-2.10.4/amqpstorm/tests/unit/channel/test_channel_exception.py =================================================================== ---- AMQPStorm-2.8.4.orig/amqpstorm/tests/unit/channel/channel_exception_tests.py -+++ AMQPStorm-2.8.4/amqpstorm/tests/unit/channel/channel_exception_tests.py -@@ -1,6 +1,6 @@ +--- AMQPStorm-2.10.4.orig/amqpstorm/tests/unit/channel/test_channel_exception.py ++++ AMQPStorm-2.10.4/amqpstorm/tests/unit/channel/test_channel_exception.py +@@ -1,5 +1,5 @@ import mock - from mock import Mock -from pamqp import specification +from pamqp import commands import amqpstorm from amqpstorm import AMQPChannelError -@@ -167,7 +167,7 @@ class ChannelExceptionTests(TestFramewor +@@ -189,9 +189,10 @@ class ChannelExceptionTests(TestFramewor channel = Channel(0, FakeConnection(), 360) channel.set_state(channel.OPEN) - basic_return = specification.Basic.Return( + basic_return = commands.Basic.Return( reply_code=500, - reply_text='Error' +- reply_text='Error' ++ reply_text='Error', ++ routing_key='', ) -@@ -189,7 +189,7 @@ class ChannelExceptionTests(TestFramewor + channel._basic_return(basic_return) + +@@ -211,7 +212,7 @@ class ChannelExceptionTests(TestFramewor channel.set_state(channel.OPEN) channel._consumer_tags = [4, 5, 6] @@ -564,14 +775,15 @@ Index: AMQPStorm-2.8.4/amqpstorm/tests/unit/channel/channel_exception_tests.py reply_code=500, reply_text='travis-ci' ) -Index: AMQPStorm-2.8.4/amqpstorm/tests/unit/channel/channel_frame_tests.py +Index: AMQPStorm-2.10.4/amqpstorm/tests/unit/channel/test_channel_frame.py =================================================================== ---- AMQPStorm-2.8.4.orig/amqpstorm/tests/unit/channel/channel_frame_tests.py -+++ AMQPStorm-2.8.4/amqpstorm/tests/unit/channel/channel_frame_tests.py +--- AMQPStorm-2.10.4.orig/amqpstorm/tests/unit/channel/test_channel_frame.py ++++ AMQPStorm-2.10.4/amqpstorm/tests/unit/channel/test_channel_frame.py @@ -1,6 +1,6 @@ - from mock import Mock - from pamqp import ContentHeader + import mock +-from pamqp import ContentHeader -from pamqp import specification ++from pamqp.header import ContentHeader +from pamqp import commands from pamqp.body import ContentBody @@ -595,7 +807,7 @@ Index: AMQPStorm-2.8.4/amqpstorm/tests/unit/channel/channel_frame_tests.py self.assertEqual( self.get_last_log(), @@ -50,7 +50,7 @@ class ChannelFrameTests(TestFramework): - channel = Channel(0, Mock(name='Connection'), rpc_timeout=1) + channel = Channel(0, mock.Mock(name='Connection'), rpc_timeout=1) channel.add_consumer_tag(tag) - channel.on_frame(specification.Basic.CancelOk(tag)) @@ -605,7 +817,7 @@ Index: AMQPStorm-2.8.4/amqpstorm/tests/unit/channel/channel_frame_tests.py @@ -58,7 +58,7 @@ class ChannelFrameTests(TestFramework): tag = 'travis-ci' - channel = Channel(0, Mock(name='Connection'), rpc_timeout=1) + channel = Channel(0, mock.Mock(name='Connection'), rpc_timeout=1) - channel.on_frame(specification.Basic.ConsumeOk(tag)) + channel.on_frame(commands.Basic.ConsumeOk(tag)) @@ -662,15 +874,17 @@ Index: AMQPStorm-2.8.4/amqpstorm/tests/unit/channel/channel_frame_tests.py ) def test_channel_unhandled_frame(self): -Index: AMQPStorm-2.8.4/amqpstorm/tests/unit/channel/channel_message_handling_tests.py +Index: AMQPStorm-2.10.4/amqpstorm/tests/unit/channel/test_channel_message_handling.py =================================================================== ---- AMQPStorm-2.8.4.orig/amqpstorm/tests/unit/channel/channel_message_handling_tests.py -+++ AMQPStorm-2.8.4/amqpstorm/tests/unit/channel/channel_message_handling_tests.py -@@ -2,7 +2,7 @@ import threading +--- AMQPStorm-2.10.4.orig/amqpstorm/tests/unit/channel/test_channel_message_handling.py ++++ AMQPStorm-2.10.4/amqpstorm/tests/unit/channel/test_channel_message_handling.py +@@ -1,8 +1,8 @@ + import threading - from mock import Mock - from pamqp import ContentHeader + import mock +-from pamqp import ContentHeader -from pamqp import specification ++from pamqp.header import ContentHeader +from pamqp import commands from pamqp.body import ContentBody @@ -684,7 +898,7 @@ Index: AMQPStorm-2.8.4/amqpstorm/tests/unit/channel/channel_message_handling_tes header = ContentHeader(body_size=message_len) body = ContentBody(value=message) -@@ -35,7 +35,7 @@ class ChannelBuildMessageTests(TestFrame +@@ -36,7 +36,7 @@ class ChannelBuildMessageTests(TestFrame message = self.message.encode('utf-8') message_len = len(message) @@ -693,7 +907,7 @@ Index: AMQPStorm-2.8.4/amqpstorm/tests/unit/channel/channel_message_handling_tes header = ContentHeader(body_size=message_len) body = ContentBody(value=message) -@@ -51,7 +51,7 @@ class ChannelBuildMessageTests(TestFrame +@@ -52,7 +52,7 @@ class ChannelBuildMessageTests(TestFrame message = self.message message_len = len(message) @@ -702,7 +916,7 @@ Index: AMQPStorm-2.8.4/amqpstorm/tests/unit/channel/channel_message_handling_tes header = ContentHeader(body_size=message_len) channel._inbound = [deliver, deliver, header] -@@ -67,7 +67,7 @@ class ChannelBuildMessageTests(TestFrame +@@ -68,7 +68,7 @@ class ChannelBuildMessageTests(TestFrame message = self.message message_len = len(message) @@ -711,9 +925,9 @@ Index: AMQPStorm-2.8.4/amqpstorm/tests/unit/channel/channel_message_handling_tes header = ContentHeader(body_size=message_len) body = ContentBody(value=message) -@@ -81,20 +81,20 @@ class ChannelBuildMessageTests(TestFrame +@@ -82,20 +82,20 @@ class ChannelBuildMessageTests(TestFrame def test_channel_build_message_headers(self): - channel = Channel(0, Mock(name='Connection'), 360) + channel = Channel(0, mock.Mock(name='Connection'), 360) - deliver = specification.Basic.Deliver() + deliver = commands.Basic.Deliver() @@ -728,14 +942,23 @@ Index: AMQPStorm-2.8.4/amqpstorm/tests/unit/channel/channel_message_handling_tes self.assertEqual(result[1].body_size, 10) def test_channel_build_message_headers_out_of_order(self): - channel = Channel(0, Mock(name='Connection'), 360) + channel = Channel(0, mock.Mock(name='Connection'), 360) - deliver = specification.Basic.Deliver() + deliver = commands.Basic.Deliver() header = ContentHeader(body_size=10) channel._inbound = [header, deliver] -@@ -208,7 +208,7 @@ class ChannelBuildMessageTests(TestFrame +@@ -128,7 +128,7 @@ class ChannelBuildMessageTests(TestFrame + channel._inbound = [] + + def add_inbound(): +- channel._inbound.append(ContentBody()) ++ channel._inbound.append(ContentBody(None)) + + threading.Timer(function=add_inbound, interval=0.1).start() + +@@ -209,7 +209,7 @@ class ChannelBuildMessageTests(TestFrame channel._inbound.append(ContentHeader(body_size=message_len)) channel._inbound.append(ContentBody(value=message)) @@ -744,7 +967,7 @@ Index: AMQPStorm-2.8.4/amqpstorm/tests/unit/channel/channel_message_handling_tes channel._inbound = [deliver] self.assertTrue(channel._inbound) -@@ -227,7 +227,7 @@ class ChannelBuildMessageTests(TestFrame +@@ -228,7 +228,7 @@ class ChannelBuildMessageTests(TestFrame message = self.message.encode('utf-8') message_len = len(message) @@ -753,7 +976,7 @@ Index: AMQPStorm-2.8.4/amqpstorm/tests/unit/channel/channel_message_handling_tes header = ContentHeader(body_size=message_len) body = ContentBody(value=message) -@@ -247,7 +247,7 @@ class ChannelBuildMessageTests(TestFrame +@@ -248,7 +248,7 @@ class ChannelBuildMessageTests(TestFrame message = self.message.encode('utf-8') message_len = len(message) @@ -762,7 +985,7 @@ Index: AMQPStorm-2.8.4/amqpstorm/tests/unit/channel/channel_message_handling_tes header = ContentHeader(body_size=message_len) body = ContentBody(value=message) -@@ -268,7 +268,7 @@ class ChannelBuildMessageTests(TestFrame +@@ -269,7 +269,7 @@ class ChannelBuildMessageTests(TestFrame message = self.message.encode('utf-8') message_len = len(message) @@ -771,7 +994,7 @@ Index: AMQPStorm-2.8.4/amqpstorm/tests/unit/channel/channel_message_handling_tes header = ContentHeader(body_size=message_len) body = ContentBody(value=message) -@@ -291,7 +291,7 @@ class ChannelBuildMessageTests(TestFrame +@@ -292,7 +292,7 @@ class ChannelBuildMessageTests(TestFrame message = self.message.encode('utf-8') message_len = len(message) @@ -780,7 +1003,7 @@ Index: AMQPStorm-2.8.4/amqpstorm/tests/unit/channel/channel_message_handling_tes header = ContentHeader(body_size=message_len) body = ContentBody(value=message) -@@ -316,7 +316,7 @@ class ChannelBuildMessageTests(TestFrame +@@ -317,7 +317,7 @@ class ChannelBuildMessageTests(TestFrame message = self.message.encode('utf-8') message_len = len(message) @@ -789,7 +1012,7 @@ Index: AMQPStorm-2.8.4/amqpstorm/tests/unit/channel/channel_message_handling_tes header = ContentHeader(body_size=message_len) body = ContentBody(value=message) -@@ -342,7 +342,7 @@ class ChannelProcessDataEventTests(TestF +@@ -343,7 +343,7 @@ class ChannelProcessDataEventTests(TestF message = self.message.encode('utf-8') message_len = len(message) @@ -798,7 +1021,7 @@ Index: AMQPStorm-2.8.4/amqpstorm/tests/unit/channel/channel_message_handling_tes header = ContentHeader(body_size=message_len) body = ContentBody(value=message) -@@ -367,7 +367,7 @@ class ChannelProcessDataEventTests(TestF +@@ -368,7 +368,7 @@ class ChannelProcessDataEventTests(TestF message = self.message.encode('utf-8') message_len = len(message) @@ -807,7 +1030,7 @@ Index: AMQPStorm-2.8.4/amqpstorm/tests/unit/channel/channel_message_handling_tes header = ContentHeader(body_size=message_len) body = ContentBody(value=message) -@@ -401,7 +401,7 @@ class ChannelStartConsumingTests(TestFra +@@ -402,7 +402,7 @@ class ChannelStartConsumingTests(TestFra message = self.message.encode('utf-8') message_len = len(message) @@ -816,7 +1039,7 @@ Index: AMQPStorm-2.8.4/amqpstorm/tests/unit/channel/channel_message_handling_tes header = ContentHeader(body_size=message_len) body = ContentBody(value=message) -@@ -430,7 +430,7 @@ class ChannelStartConsumingTests(TestFra +@@ -431,7 +431,7 @@ class ChannelStartConsumingTests(TestFra message_len = len(message) def add_inbound(): @@ -825,7 +1048,7 @@ Index: AMQPStorm-2.8.4/amqpstorm/tests/unit/channel/channel_message_handling_tes header = ContentHeader(body_size=message_len) body = ContentBody(value=message) -@@ -465,11 +465,11 @@ class ChannelStartConsumingTests(TestFra +@@ -466,11 +466,11 @@ class ChannelStartConsumingTests(TestFra message = self.message.encode('utf-8') message_len = len(message) @@ -840,12 +1063,12 @@ Index: AMQPStorm-2.8.4/amqpstorm/tests/unit/channel/channel_message_handling_tes consumer_tag='travis-ci-3') header = ContentHeader(body_size=message_len) body = ContentBody(value=message) -Index: AMQPStorm-2.8.4/amqpstorm/tests/unit/channel/channel_tests.py +Index: AMQPStorm-2.10.4/amqpstorm/tests/unit/channel/test_channel.py =================================================================== ---- AMQPStorm-2.8.4.orig/amqpstorm/tests/unit/channel/channel_tests.py -+++ AMQPStorm-2.8.4/amqpstorm/tests/unit/channel/channel_tests.py +--- AMQPStorm-2.10.4.orig/amqpstorm/tests/unit/channel/test_channel.py ++++ AMQPStorm-2.10.4/amqpstorm/tests/unit/channel/test_channel.py @@ -1,5 +1,5 @@ - from mock import Mock + import mock -from pamqp import specification +from pamqp import commands @@ -897,19 +1120,21 @@ Index: AMQPStorm-2.8.4/amqpstorm/tests/unit/channel/channel_tests.py connection = FakeConnection(on_write=on_select_ok) channel = Channel(0, connection, 0.01) -@@ -144,7 +144,7 @@ class ChannelTests(TestFramework): +@@ -144,8 +144,8 @@ class ChannelTests(TestFramework): channel.set_state(channel.OPEN) channel._consumer_tags = [4, 5, 6] - close_frame = specification.Channel.Close(reply_code=200, +- reply_text='travis-ci') + close_frame = commands.Channel.Close(reply_code=200, - reply_text='travis-ci') ++ reply_text='travis-ci') # Close Channel. channel._close_channel(close_frame) -Index: AMQPStorm-2.8.4/amqpstorm/tests/unit/channel0/channel0_frame_tests.py + +Index: AMQPStorm-2.10.4/amqpstorm/tests/unit/channel0/test_channel0_frame.py =================================================================== ---- AMQPStorm-2.8.4.orig/amqpstorm/tests/unit/channel0/channel0_frame_tests.py -+++ AMQPStorm-2.8.4/amqpstorm/tests/unit/channel0/channel0_frame_tests.py +--- AMQPStorm-2.10.4.orig/amqpstorm/tests/unit/channel0/test_channel0_frame.py ++++ AMQPStorm-2.10.4/amqpstorm/tests/unit/channel0/test_channel0_frame.py @@ -1,5 +1,5 @@ from pamqp.heartbeat import Heartbeat -from pamqp.specification import Connection @@ -917,10 +1142,10 @@ Index: AMQPStorm-2.8.4/amqpstorm/tests/unit/channel0/channel0_frame_tests.py import amqpstorm from amqpstorm import AMQPConnectionError -Index: AMQPStorm-2.8.4/amqpstorm/tests/unit/channel0/channel0_tests.py +Index: AMQPStorm-2.10.4/amqpstorm/tests/unit/channel0/test_channel0.py =================================================================== ---- AMQPStorm-2.8.4.orig/amqpstorm/tests/unit/channel0/channel0_tests.py -+++ AMQPStorm-2.8.4/amqpstorm/tests/unit/channel0/channel0_tests.py +--- AMQPStorm-2.10.4.orig/amqpstorm/tests/unit/channel0/test_channel0.py ++++ AMQPStorm-2.10.4/amqpstorm/tests/unit/channel0/test_channel0.py @@ -1,7 +1,7 @@ import platform @@ -930,22 +1155,115 @@ Index: AMQPStorm-2.8.4/amqpstorm/tests/unit/channel0/channel0_tests.py import amqpstorm from amqpstorm import AMQPConnectionError -Index: AMQPStorm-2.8.4/amqpstorm/tests/unit/connection/connection_tests.py +Index: AMQPStorm-2.10.4/amqpstorm/tests/unit/test_compatibility.py =================================================================== ---- AMQPStorm-2.8.4.orig/amqpstorm/tests/unit/connection/connection_tests.py -+++ AMQPStorm-2.8.4/amqpstorm/tests/unit/connection/connection_tests.py -@@ -3,8 +3,8 @@ import threading +--- AMQPStorm-2.10.4.orig/amqpstorm/tests/unit/test_compatibility.py ++++ AMQPStorm-2.10.4/amqpstorm/tests/unit/test_compatibility.py +@@ -21,11 +21,6 @@ class CompatibilityTests(TestFramework): + x = '' + self.assertFalse(compatibility.is_integer(x)) - from mock import Mock +- @unittest.skipIf(sys.version_info[0] == 3, 'No long obj in Python 3') +- def test_compatibility_long_integer(self): +- x = long(100) +- self.assertTrue(compatibility.is_integer(x)) +- + def test_compatibility_normal_string(self): + x = '' + self.assertTrue(compatibility.is_string(x)) +@@ -34,34 +29,10 @@ class CompatibilityTests(TestFramework): + x = b'' + self.assertTrue(compatibility.is_string(x)) + +- @unittest.skipIf(sys.version_info[0] == 3, 'No unicode obj in Python 3') +- def test_compatibility_unicode_string(self): +- x = u'Mor, lilla mor, vem är väl som du' +- self.assertTrue(compatibility.is_string(x)) +- + def test_compatibility_is_not_string(self): + x = 100 + self.assertFalse(compatibility.is_string(x)) + +- @unittest.skipIf(sys.version_info[0] == 3, 'No unicode obj in Python 3') +- def test_compatibility_is_unicode(self): +- x = u'Mor, lilla mor, vem är väl som du' +- self.assertTrue(compatibility.is_unicode(x)) +- +- def test_compatibility_is_not_unicode(self): +- x = '' +- self.assertFalse(compatibility.is_unicode(x)) +- +- @unittest.skipIf(sys.version_info[0] == 3, 'No unicode obj in Python 3') +- def test_compatibility_py2_try_utf8_decode(self): +- x = unicode('hello world') +- self.assertEqual(str(x), compatibility.try_utf8_decode(x)) +- +- @unittest.skipIf(sys.version_info[0] == 2, 'No bytes decoding in Python 2') +- def test_compatibility_py3_try_utf8_decode(self): +- x = bytes('hello world', 'utf-8') +- self.assertEqual(x.decode('utf-8'), compatibility.try_utf8_decode(x)) +- + def test_compatibility_fail_silently_on_utf_16(self): + x = 'hello'.encode('utf-16') + self.assertEqual(compatibility.try_utf8_decode(x), x) +@@ -78,20 +49,7 @@ class CompatibilityTests(TestFramework): + x = dict(hello='world') + self.assertEqual(x, compatibility.try_utf8_decode(x)) + +- @unittest.skipIf(sys.version_info[0] == 3, 'Python 2.x test') +- def test_compatibility_python_2_x(self): +- self.assertFalse(compatibility.PYTHON3) +- +- @unittest.skipIf(sys.version_info[0] == 2, 'Python 3.x test') +- def test_compatibility_python_3_x(self): +- self.assertTrue(compatibility.PYTHON3) +- +- @unittest.skipIf(sys.version_info[0] == 3, 'Python 2.x test') +- def test_compatibility_python_2_x_range(self): +- self.assertEqual(compatibility.RANGE, xrange) +- +- @unittest.skipIf(sys.version_info[0] == 2, 'Python 3.x test') +- def test_compatibility_python_3_x_range(self): ++ def test_compatibility_python_range(self): + self.assertEqual(compatibility.RANGE, range) + + def test_compatibility_ssl_is_set(self): +@@ -201,7 +159,7 @@ class CompatibilitySslTests(unittest.Tes + imp.reload(compatibility) + + def test_compatibility_only_tls_v1_supported(self): +- """This tests mimics the behavior of Python 2.7.8 or earlier that ++ """This test mimics the behavior of earlier versions of Python that + only supported TLS v1 and SSLv23. + """ + restore_tls_v1_2 = sys.modules['ssl'].PROTOCOL_TLSv1_2 +Index: AMQPStorm-2.10.4/amqpstorm/tests/unit/connection/test_connection.py +=================================================================== +--- AMQPStorm-2.10.4.orig/amqpstorm/tests/unit/connection/test_connection.py ++++ AMQPStorm-2.10.4/amqpstorm/tests/unit/connection/test_connection.py +@@ -2,9 +2,10 @@ import socket + import threading + + import mock ++from pamqp import exceptions as pamqp_exception from pamqp import frame as pamqp_frame -from pamqp import specification -from pamqp.specification import Basic as spec_basic -+from pamqp import commands as commands ++from pamqp import commands +from pamqp.commands import Basic as spec_basic from amqpstorm import Channel from amqpstorm import Connection -@@ -111,7 +111,7 @@ class ConnectionTests(TestFramework): +@@ -81,7 +82,7 @@ class ConnectionTests(TestFramework): + + def test_connection_basic_read_buffer(self): + connection = Connection('127.0.0.1', 'guest', 'guest', lazy=True) +- cancel_ok_frame = spec_basic.CancelOk().marshal() ++ cancel_ok_frame = spec_basic.CancelOk(consumer_tag='').marshal() + + self.assertEqual(connection._read_buffer(cancel_ok_frame), b'\x00') + +@@ -125,7 +126,7 @@ class ConnectionTests(TestFramework): self.assertEqual(data_in, b'') self.assertEqual(channel_id, 0) @@ -954,16 +1272,16 @@ Index: AMQPStorm-2.8.4/amqpstorm/tests/unit/connection/connection_tests.py def test_connection_handle_amqp_frame_none_returns_none(self): connection = Connection('127.0.0.1', 'guest', 'guest', lazy=True) -@@ -125,7 +125,7 @@ class ConnectionTests(TestFramework): +@@ -139,7 +140,7 @@ class ConnectionTests(TestFramework): connection = Connection('127.0.0.1', 'guest', 'guest', lazy=True) def throw_error(*_): - raise specification.AMQPFrameError() -+ raise commands.AMQPFrameError() ++ raise pamqp_exception.AMQPFrameError() restore_func = pamqp_frame.unmarshal try: -@@ -288,7 +288,7 @@ class ConnectionTests(TestFramework): +@@ -302,7 +303,7 @@ class ConnectionTests(TestFramework): index + 1, connection, 360) def on_write(frame_out): @@ -972,7 +1290,7 @@ Index: AMQPStorm-2.8.4/amqpstorm/tests/unit/connection/connection_tests.py connection._channel0._close_connection_ok() connection._channel0._write_frame = on_write -@@ -410,8 +410,8 @@ class ConnectionTests(TestFramework): +@@ -424,8 +425,8 @@ class ConnectionTests(TestFramework): connection.set_state(connection.OPEN) def on_open_ok(_, frame_out): @@ -983,30 +1301,20 @@ Index: AMQPStorm-2.8.4/amqpstorm/tests/unit/connection/connection_tests.py connection.write_frame = on_open_ok -Index: AMQPStorm-2.8.4/amqpstorm/tests/unit/exchange/exchange_tests.py +Index: AMQPStorm-2.10.4/amqpstorm/tests/unit/exchange/test_exchange.py =================================================================== ---- AMQPStorm-2.8.4.orig/amqpstorm/tests/unit/exchange/exchange_tests.py -+++ AMQPStorm-2.8.4/amqpstorm/tests/unit/exchange/exchange_tests.py +--- AMQPStorm-2.10.4.orig/amqpstorm/tests/unit/exchange/test_exchange.py ++++ AMQPStorm-2.10.4/amqpstorm/tests/unit/exchange/test_exchange.py @@ -1,4 +1,4 @@ -from pamqp.specification import Exchange as pamqp_exchange +from pamqp.commands import Exchange as pamqp_exchange from amqpstorm.channel import Channel from amqpstorm.channel import Exchange -Index: AMQPStorm-2.8.4/amqpstorm/tests/unit/queue/queue_tests.py +Index: AMQPStorm-2.10.4/amqpstorm/tests/unit/test_tx.py =================================================================== ---- AMQPStorm-2.8.4.orig/amqpstorm/tests/unit/queue/queue_tests.py -+++ AMQPStorm-2.8.4/amqpstorm/tests/unit/queue/queue_tests.py -@@ -1,4 +1,4 @@ --from pamqp.specification import Queue as pamqp_queue -+from pamqp.commands import Queue as pamqp_queue - - from amqpstorm.channel import Channel - from amqpstorm.channel import Queue -Index: AMQPStorm-2.8.4/amqpstorm/tests/unit/tx_tests.py -=================================================================== ---- AMQPStorm-2.8.4.orig/amqpstorm/tests/unit/tx_tests.py -+++ AMQPStorm-2.8.4/amqpstorm/tests/unit/tx_tests.py +--- AMQPStorm-2.10.4.orig/amqpstorm/tests/unit/test_tx.py ++++ AMQPStorm-2.10.4/amqpstorm/tests/unit/test_tx.py @@ -1,4 +1,4 @@ -from pamqp import specification +from pamqp import commands @@ -1096,10 +1404,33 @@ Index: AMQPStorm-2.8.4/amqpstorm/tests/unit/tx_tests.py connection = FakeConnection(on_write=on_tx) channel = Channel(0, connection, 0.01) -Index: AMQPStorm-2.8.4/amqpstorm/tx.py +Index: AMQPStorm-2.10.4/amqpstorm/tests/unit/uri_connection/test_uri_connection_exception.py =================================================================== ---- AMQPStorm-2.8.4.orig/amqpstorm/tx.py -+++ AMQPStorm-2.8.4/amqpstorm/tx.py +--- AMQPStorm-2.10.4.orig/amqpstorm/tests/unit/uri_connection/test_uri_connection_exception.py ++++ AMQPStorm-2.10.4/amqpstorm/tests/unit/uri_connection/test_uri_connection_exception.py +@@ -6,18 +6,12 @@ from amqpstorm import AMQPConnectionErro + from amqpstorm import UriConnection + from amqpstorm import compatibility + from amqpstorm.tests.utility import TestFramework +-from amqpstorm.tests.utility import unittest + + + class UriConnectionExceptionTests(TestFramework): +- @unittest.skipIf(sys.version_info < (3, 3), 'Python 3.x test') + def test_uri_py3_raises_on_invalid_uri(self): + self.assertRaises(ValueError, UriConnection, 'amqp://a:b', {}, True) + +- @unittest.skipIf(sys.version_info[0] == 3, 'Python 2.x test') +- def test_uri_py2_raises_on_invalid_uri(self): +- self.assertRaises(ValueError, UriConnection, 'amqp://a:b', {}, True) +- + def test_uri_raises_on_invalid_object(self): + self.assertRaises(AttributeError, UriConnection, None) + self.assertRaises(AttributeError, UriConnection, {}) +Index: AMQPStorm-2.10.4/amqpstorm/tx.py +=================================================================== +--- AMQPStorm-2.10.4.orig/amqpstorm/tx.py ++++ AMQPStorm-2.10.4/amqpstorm/tx.py @@ -2,7 +2,7 @@ import logging @@ -1133,16 +1464,72 @@ Index: AMQPStorm-2.8.4/amqpstorm/tx.py self._tx_active = False - return self._channel.rpc_request(specification.Tx.Rollback()) + return self._channel.rpc_request(commands.Tx.Rollback()) -Index: AMQPStorm-2.8.4/amqpstorm/exchange.py +Index: AMQPStorm-2.10.4/setup.cfg =================================================================== ---- AMQPStorm-2.8.4.orig/amqpstorm/exchange.py -+++ AMQPStorm-2.8.4/amqpstorm/exchange.py +--- AMQPStorm-2.10.4.orig/setup.cfg ++++ AMQPStorm-2.10.4/setup.cfg @@ -2,7 +2,7 @@ + verbosity = 2 - import logging + [bdist_wheel] +-universal = 1 ++universal = 0 --from pamqp.specification import Exchange as pamqp_exchange -+from pamqp.commands import Exchange as pamqp_exchange + [metadata] + description-file = README.rst +Index: AMQPStorm-2.10.4/setup.py +=================================================================== +--- AMQPStorm-2.10.4.orig/setup.py ++++ AMQPStorm-2.10.4/setup.py +@@ -22,7 +22,7 @@ def get_version(rel_path): - from amqpstorm import compatibility - from amqpstorm.base import Handler + setup( + name='AMQPStorm', +- python_requires='>=2.7', ++ python_requires='>=3.6', + version=get_version('amqpstorm/__init__.py'), + description='Thread-safe Python RabbitMQ Client & Management library.', + long_description=open('README.rst').read(), +@@ -32,7 +32,7 @@ setup( + packages=find_packages(), + license='MIT License', + url='https://www.amqpstorm.io', +- install_requires=['pamqp>=2.0.0,<3.0'], ++ install_requires=['pamqp>=3.0'], + extras_require={ + 'management': ['requests>2'], + 'pool': ['amqpstorm-pool'] +@@ -44,17 +44,11 @@ setup( + 'License :: OSI Approved :: MIT License', + 'Natural Language :: English', + 'Operating System :: OS Independent', +- 'Programming Language :: Python :: 2', +- 'Programming Language :: Python :: 2.7', +- 'Programming Language :: Python :: 3', +- 'Programming Language :: Python :: 3.4', +- 'Programming Language :: Python :: 3.5', + 'Programming Language :: Python :: 3.6', + 'Programming Language :: Python :: 3.7', + 'Programming Language :: Python :: 3.8', + 'Programming Language :: Python :: 3.9', + 'Programming Language :: Python :: Implementation :: CPython', +- 'Programming Language :: Python :: Implementation :: PyPy', + 'Topic :: Communications', + 'Topic :: Internet', + 'Topic :: Internet :: WWW/HTTP', +Index: AMQPStorm-2.10.4/CHANGELOG.rst +=================================================================== +--- AMQPStorm-2.10.4.orig/CHANGELOG.rst ++++ AMQPStorm-2.10.4/CHANGELOG.rst +@@ -35,6 +35,11 @@ Version 2.8.5 + ------------- + - Fixed a potential deadlock when opening a channel with a broken connection [#97] - Thanks mehdigmira. + ++Version 3.0.0 Alpha 1 ++--------------------- ++- This version requires Python 3.6 or newer. ++- Upgraded to pamqp3. ++ + Version 2.8.4 + ------------- + - Fixed a bug in Message.create where it would mutate the properties dict [#92] - Thanks Killerama. diff --git a/python-amqpstorm.changes b/python-amqpstorm.changes index 9bded90..4bb1a7f 100644 --- a/python-amqpstorm.changes +++ b/python-amqpstorm.changes @@ -1,7 +1,23 @@ +------------------------------------------------------------------- +Mon May 9 04:55:21 UTC 2022 - Markéta Machová + +- Update to 2.10.4 + * Fixed a potential deadlock when opening a channel with a broken connection [#97] + * Added support for custom Message implementations + * Added Pagination and Filtering support to Management list calls + * Updated to use pytest framework instead of nose for testing. + * Fixed bug with UriConnection not handling amqps:// properly. + * Fixed bad socket fd causing high cpu usage [#110] +- Get new pamqp3.patch from https://github.com/eandersson/amqpstorm/pull/95, + which should be in v3 (which is somehow not tagged yet) + * rebased it to the new codestream +- Do not require mock + * mock.patch + ------------------------------------------------------------------- Mon Apr 19 13:03:19 UTC 2021 - Markéta Machová -- Upadte to 2.8.4 +- Update to 2.8.4 * Added getter/setter methods for Message properties expiration, message_type and user_id * Fixed pip sdist circular dependency * Fixed basic.consume argument type in documentation diff --git a/python-amqpstorm.spec b/python-amqpstorm.spec index 8ef0842..7657e7f 100644 --- a/python-amqpstorm.spec +++ b/python-amqpstorm.spec @@ -1,7 +1,7 @@ # # spec file for package python-amqpstorm # -# Copyright (c) 2021 SUSE LLC +# Copyright (c) 2022 SUSE LLC # # All modifications and additions to the file contributed by third parties # remain the property of their copyright owners, unless otherwise agreed @@ -18,14 +18,14 @@ %{?!python_module:%define python_module() python-%{**} python3-%{**}} Name: python-amqpstorm -Version: 2.8.4 +Version: 2.10.4 Release: 0 Summary: Thread-safe Python RabbitMQ Client & Management library License: MIT URL: https://github.com/eandersson/amqpstorm Source: https://files.pythonhosted.org/packages/source/A/AMQPStorm/AMQPStorm-%{version}.tar.gz Patch0: pamqp3.patch -BuildRequires: %{python_module mock} +Patch1: mock.patch BuildRequires: %{python_module pamqp >= 3.0} BuildRequires: %{python_module pytest} BuildRequires: %{python_module requests} @@ -50,7 +50,6 @@ When using a SSL connection, TLSv1 or higher is required. %prep %setup -q -n AMQPStorm-%{version} %autopatch -p1 -sed -i -e "s/'pamqp>=2.0.0,<3.0'/'pamqp>=3.0'/" setup.py %build export LANG="en_US.UTF8" @@ -69,7 +68,7 @@ export LANG="en_US.UTF8" %files %{python_files} %license LICENSE -%doc README.rst examples +%doc README.rst %{python_sitelib}/* %changelog