Hello community, here is the log from the commit of package python3-kombu for openSUSE:Factory checked in at 2016-04-22 16:23:31 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/python3-kombu (Old) and /work/SRC/openSUSE:Factory/.python3-kombu.new (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Package is "python3-kombu" Changes: -------- --- /work/SRC/openSUSE:Factory/python3-kombu/python3-kombu.changes 2016-03-17 16:48:18.000000000 +0100 +++ /work/SRC/openSUSE:Factory/.python3-kombu.new/python3-kombu.changes 2016-04-22 16:23:32.000000000 +0200 @@ -1,0 +2,13 @@ +Sat Mar 26 04:11:29 UTC 2016 - arun@gmx.de + +- update to version 3.0.35: + * msgpack: msgpack support now requires msgpack-python > 0.4.7. + * Redis: TimeoutError was no longer handled as a recoverable error. + * Redis: Adds the ability to set more Redis connection options using + "Connection(transport_options={...})". + + "socket_connect_timeout" + + "socket_keepalive" (requires :mod:`redis-py` > 2.10) + + "socket_keepalive_options" (requires :mod:`redis-py` > 2.10) + * msgpack: Fixes support for binary/unicode data + +------------------------------------------------------------------- Old: ---- kombu-3.0.34.tar.gz New: ---- kombu-3.0.35.tar.gz ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ python3-kombu.spec ++++++ --- /var/tmp/diff_new_pack.xlzfiZ/_old 2016-04-22 16:23:33.000000000 +0200 +++ /var/tmp/diff_new_pack.xlzfiZ/_new 2016-04-22 16:23:33.000000000 +0200 @@ -17,7 +17,7 @@ Name: python3-kombu -Version: 3.0.34 +Version: 3.0.35 Release: 0 Summary: AMQP Messaging Framework for Python License: BSD-3-Clause ++++++ kombu-3.0.34.tar.gz -> kombu-3.0.35.tar.gz ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/kombu-3.0.34/Changelog new/kombu-3.0.35/Changelog --- old/kombu-3.0.34/Changelog 2016-03-04 02:29:37.000000000 +0100 +++ new/kombu-3.0.35/Changelog 2016-03-22 20:09:59.000000000 +0100 @@ -4,6 +4,26 @@ Change history ================ +.. _version-3.0.35: + +3.0.35 +====== +:release-date: 2016-03-22 11:22 P.M PST +:release-by: Ask Solem + +- msgpack: msgpack support now requires msgpack-python > 0.4.7. + +- Redis: TimeoutError was no longer handled as a recoverable error. + +- Redis: Adds the ability to set more Redis connection options + using ``Connection(transport_options={...})``. + + - ``socket_connect_timeout`` + - ``socket_keepalive`` (requires :mod:`redis-py` > 2.10) + - ``socket_keepalive_options`` (requires :mod:`redis-py` > 2.10) + +- msgpack: Fixes support for binary/unicode data + .. _version-3.0.34: 3.0.34 @@ -235,7 +255,8 @@ Contributed by Joshua Harlow. -- Redis: Now properly handles ``TimeoutError raised by py-redis. +- Redis: Now properly handles :exc:`redis.exceptions.TimeoutError` + raised by :mod:`redis`. Contributed by markow. diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/kombu-3.0.34/PKG-INFO new/kombu-3.0.35/PKG-INFO --- old/kombu-3.0.34/PKG-INFO 2016-03-04 02:56:23.000000000 +0100 +++ new/kombu-3.0.35/PKG-INFO 2016-03-22 20:15:13.000000000 +0100 @@ -1,6 +1,6 @@ Metadata-Version: 1.1 Name: kombu -Version: 3.0.34 +Version: 3.0.35 Summary: Messaging library for Python Home-page: http://kombu.readthedocs.org Author: Ask Solem @@ -12,7 +12,7 @@ kombu - Messaging library for Python ======================================== - :Version: 3.0.34 + :Version: 3.0.35 `Kombu` is a messaging library for Python. diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/kombu-3.0.34/README.rst new/kombu-3.0.35/README.rst --- old/kombu-3.0.34/README.rst 2016-03-04 02:30:07.000000000 +0100 +++ new/kombu-3.0.35/README.rst 2016-03-22 20:09:59.000000000 +0100 @@ -4,7 +4,7 @@ kombu - Messaging library for Python ======================================== -:Version: 3.0.34 +:Version: 3.0.35 `Kombu` is a messaging library for Python. diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/kombu-3.0.34/docs/changelog.rst new/kombu-3.0.35/docs/changelog.rst --- old/kombu-3.0.34/docs/changelog.rst 2016-03-04 02:29:37.000000000 +0100 +++ new/kombu-3.0.35/docs/changelog.rst 2016-03-22 20:09:59.000000000 +0100 @@ -4,6 +4,26 @@ Change history ================ +.. _version-3.0.35: + +3.0.35 +====== +:release-date: 2016-03-22 11:22 P.M PST +:release-by: Ask Solem + +- msgpack: msgpack support now requires msgpack-python > 0.4.7. + +- Redis: TimeoutError was no longer handled as a recoverable error. + +- Redis: Adds the ability to set more Redis connection options + using ``Connection(transport_options={...})``. + + - ``socket_connect_timeout`` + - ``socket_keepalive`` (requires :mod:`redis-py` > 2.10) + - ``socket_keepalive_options`` (requires :mod:`redis-py` > 2.10) + +- msgpack: Fixes support for binary/unicode data + .. _version-3.0.34: 3.0.34 @@ -235,7 +255,8 @@ Contributed by Joshua Harlow. -- Redis: Now properly handles ``TimeoutError raised by py-redis. +- Redis: Now properly handles :exc:`redis.exceptions.TimeoutError` + raised by :mod:`redis`. Contributed by markow. diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/kombu-3.0.34/docs/conf.py new/kombu-3.0.35/docs/conf.py --- old/kombu-3.0.34/docs/conf.py 2016-03-04 02:28:42.000000000 +0100 +++ new/kombu-3.0.35/docs/conf.py 2016-03-22 20:09:54.000000000 +0100 @@ -12,11 +12,23 @@ from django.conf import settings # noqa if not settings.configured: settings.configure() +try: + from django import setup as django_setup +except ImportError: + pass +else: + django_setup() # General configuration # --------------------- -extensions = ['sphinx.ext.autodoc', 'sphinx.ext.coverage'] +extensions = [ + 'sphinx.ext.autodoc', + 'sphinx.ext.intersphinx', + 'sphinx.ext.coverage', + 'sphinx.ext.viewcode', + 'sphinx.ext.pngmath', +] # Add any paths that contain templates here, relative to this directory. templates_path = ['.templates'] @@ -31,6 +43,23 @@ project = 'Kombu' copyright = '2009-2016, Ask Solem' +intersphinx_mapping = { + 'python': ('http://docs.python.org/dev', None), + 'celery': ('http://docs.celeryproject.org/en/latest', None), + 'djcelery': ('http://django-celery.readthedocs.org/en/latest', None), + 'cyme': ('http://cyme.readthedocs.org/en/latest', None), + 'amqp': ('http://amqp.readthedocs.org/en/latest', None), + 'vine': ('http://vine.readthedocs.org/en/latest', None), + 'redis': ('http://redis-py.readthedocs.org/en/latest', None), + 'django': ('http://django.readthedocs.org/en/latest', None), + 'boto': ('http://boto.readthedocs.org/en/latest', None), + 'sqlalchemy': ('http://sqlalchemy.readthedocs.org/en/latest', None), + 'kazoo': ('http://kazoo.readthedocs.org/en/latest', None), + 'pyzmq': ('http://pyzmq.readthedocs.org/en/latest', None), + 'msgpack': ('http://pythonhosted.org/msgpack-python/', None), + 'sphinx': ('http://www.sphinx-doc.org/en/stable/', None), +} + # The version info for the project you're documenting, acts as replacement for # |version| and |release|, also used in various other places throughout the # built documents. diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/kombu-3.0.34/docs/introduction.rst new/kombu-3.0.35/docs/introduction.rst --- old/kombu-3.0.34/docs/introduction.rst 2016-03-04 02:30:07.000000000 +0100 +++ new/kombu-3.0.35/docs/introduction.rst 2016-03-22 20:09:59.000000000 +0100 @@ -4,7 +4,7 @@ kombu - Messaging library for Python ======================================== -:Version: 3.0.34 +:Version: 3.0.35 `Kombu` is a messaging library for Python. diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/kombu-3.0.34/extra/requirements/docs.txt new/kombu-3.0.35/extra/requirements/docs.txt --- old/kombu-3.0.34/extra/requirements/docs.txt 2014-01-22 21:00:00.000000000 +0100 +++ new/kombu-3.0.35/extra/requirements/docs.txt 2016-03-22 20:09:58.000000000 +0100 @@ -1,3 +1,4 @@ Sphinx sphinxcontrib-issuetracker>=0.9 Django +-r extras/mongodb.txt diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/kombu-3.0.34/extra/requirements/extras/msgpack.txt new/kombu-3.0.35/extra/requirements/extras/msgpack.txt --- old/kombu-3.0.34/extra/requirements/extras/msgpack.txt 2015-09-25 21:25:05.000000000 +0200 +++ new/kombu-3.0.35/extra/requirements/extras/msgpack.txt 2016-03-09 02:58:39.000000000 +0100 @@ -1 +1 @@ -msgpack-python>=0.3.0 +msgpack-python>=0.4.7 diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/kombu-3.0.34/extra/requirements/test-ci3.txt new/kombu-3.0.35/extra/requirements/test-ci3.txt --- old/kombu-3.0.34/extra/requirements/test-ci3.txt 2016-03-04 02:28:42.000000000 +0100 +++ new/kombu-3.0.35/extra/requirements/test-ci3.txt 2016-03-04 05:15:48.000000000 +0100 @@ -3,4 +3,3 @@ redis PyYAML msgpack-python>0.2.0 # 0.2.0 dropped 2.5 support -boto diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/kombu-3.0.34/kombu/__init__.py new/kombu-3.0.35/kombu/__init__.py --- old/kombu-3.0.34/kombu/__init__.py 2016-03-04 02:29:47.000000000 +0100 +++ new/kombu-3.0.35/kombu/__init__.py 2016-03-22 20:09:59.000000000 +0100 @@ -11,7 +11,7 @@ 'version_info_t', ('major', 'minor', 'micro', 'releaselevel', 'serial'), ) -VERSION = version_info_t(3, 0, 34, '', '') +VERSION = version_info_t(3, 0, 35, '', '') __version__ = '{0.major}.{0.minor}.{0.micro}{0.releaselevel}'.format(VERSION) __author__ = 'Ask Solem' __contact__ = 'ask@celeryproject.org' diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/kombu-3.0.34/kombu/serialization.py new/kombu-3.0.35/kombu/serialization.py --- old/kombu-3.0.34/kombu/serialization.py 2016-03-04 02:28:42.000000000 +0100 +++ new/kombu-3.0.35/kombu/serialization.py 2016-03-22 20:08:32.000000000 +0100 @@ -362,26 +362,33 @@ def register_msgpack(): """See http://msgpack.sourceforge.net/""" + pack = unpack = None try: - try: - from msgpack import packb as pack, unpackb as unpack - except ImportError: - # msgpack < 0.2.0 and Python 2.5 - from msgpack import packs as pack, unpacks as unpack # noqa - registry.register( - 'msgpack', pack, unpack, - content_type='application/x-msgpack', - content_encoding='binary') - except (ImportError, ValueError): + import msgpack + if msgpack.version >= (0, 4): + from msgpack import packb, unpackb + + def pack(s): + return packb(s, use_bin_type=True) + def unpack(s): + return unpackb(s, encoding='utf-8') + else: + def version_mismatch(*args, **kwargs): + raise SerializerNotInstalled( + 'msgpack requires msgpack-python >= 0.4.0') + pack = unpack = version_mismatch + except (ImportError, ValueError): def not_available(*args, **kwargs): - """In case a client receives a msgpack message, but msgpack - isn't installed.""" raise SerializerNotInstalled( 'No decoder installed for msgpack. ' - 'Please install the msgpack library') - registry.register('msgpack', None, not_available, - 'application/x-msgpack') + 'Please install the msgpack-python library') + pack = unpack = not_available + registry.register( + 'msgpack', pack, unpack, + content_type='application/x-msgpack', + content_encoding='binary', + ) # Register the base serialization methods. register_json() diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/kombu-3.0.34/kombu/tests/test_serialization.py new/kombu-3.0.35/kombu/tests/test_serialization.py --- old/kombu-3.0.34/kombu/tests/test_serialization.py 2016-03-04 02:53:54.000000000 +0100 +++ new/kombu-3.0.35/kombu/tests/test_serialization.py 2016-03-22 20:08:32.000000000 +0100 @@ -1,14 +1,13 @@ #!/usr/bin/python # -*- coding: utf-8 -*- -from __future__ import absolute_import -from __future__ import unicode_literals +from __future__ import absolute_import, unicode_literals import sys from base64 import b64decode from kombu.exceptions import ContentDisallowed, EncodeError, DecodeError -from kombu.five import text_t, bytes_t, items +from kombu.five import text_t, bytes_t from kombu.serialization import ( registry, register, SerializerNotInstalled, raw_encode, register_yaml, register_msgpack, @@ -60,12 +59,7 @@ msgpack_py_data = dict(py_data) -msgpack_py_data['unicode'] = b'Th quick brown fox jumps over th lazy dog' -msgpack_py_data['list'] = [str_to_bytes(x) for x in msgpack_py_data['list']] -msgpack_py_data = dict( - (str_to_bytes(k), str_to_bytes(v) if isinstance(v, text_t) else v) - for k, v in items(msgpack_py_data) -) +msgpack_py_data['unicode'] = 'Th quick brown fox jumps over th lazy dog' # Unicode chars are lost in transmit :( msgpack_data = b64decode(str_to_bytes("""\ haNpbnQKpWZsb2F0y0AJIftTyNTxpGxpc3SUpmdlb3JnZaVqZXJyeaZlbGFpbmWlY29zbW+mc3Rya\ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/kombu-3.0.34/kombu/tests/transport/test_SQS.py new/kombu-3.0.35/kombu/tests/transport/test_SQS.py --- old/kombu-3.0.34/kombu/tests/transport/test_SQS.py 2016-03-04 02:28:42.000000000 +0100 +++ new/kombu-3.0.35/kombu/tests/transport/test_SQS.py 2016-03-22 20:08:32.000000000 +0100 @@ -7,19 +7,25 @@ from __future__ import absolute_import +import sys + from kombu import Connection from kombu import messaging from kombu import five from kombu.tests.case import Case, SkipTest import kombu -try: - from kombu.transport import SQS -except ImportError: - # Boto must not be installed if the SQS transport fails to import, - # so we skip all unit tests. Set SQS to None here, and it will be - # checked during the setUp() phase later. - SQS = None + +if sys.version_info[0] >= 3: + SQS, skip_reason = None, 'boto does not support Python 3' # noqa +else: + try: + from kombu.transport import SQS + except ImportError: + # Boto must not be installed if the SQS transport fails to import, + # so we skip all unit tests. Set SQS to None here, and it will be + # checked during the setUp() phase later. + SQS, skip_reason = None, 'boto not installed' # noqa class SQSQueueMock(object): @@ -98,7 +104,7 @@ # Sanity check... if SQS is None, then it did not import and we # cannot execute our tests. if SQS is None: - raise SkipTest('Boto is not installed') + raise SkipTest(skip_reason) SQS.Channel._queue_cache.clear() diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/kombu-3.0.34/kombu/transport/qpid.py new/kombu-3.0.35/kombu/transport/qpid.py --- old/kombu-3.0.34/kombu/transport/qpid.py 2016-03-04 02:28:42.000000000 +0100 +++ new/kombu-3.0.35/kombu/transport/qpid.py 2016-03-22 20:09:59.000000000 +0100 @@ -5,15 +5,19 @@ `Qpid`_ transport using `qpid-python`_ as the client and `qpid-tools`_ for broker management. -.. _`Qpid`: http://qpid.apache.org/ -.. _`qpid-python`: http://pypi.python.org/pypi/qpid-python/ -.. _`qpid-tools`: http://pypi.python.org/pypi/qpid-tools/ - The use this transport you must install the necessary dependencies. These dependencies are available via PyPI and can be installed using the pip command: -`pip install qpid-tools qpid-python` +.. code-block:: console + + $ pip install kombu[qpid] + +or to install the requirements manually: + +.. code-block:: console + + $ pip install qpid-tools qpid-python .. admonition:: Python 3 and PyPy Limitations @@ -21,6 +25,10 @@ to underlying dependencies not being compatible. This version is tested and works with with Python 2.7. +.. _`Qpid`: http://qpid.apache.org/ +.. _`qpid-python`: http://pypi.python.org/pypi/qpid-python/ +.. _`qpid-tools`: http://pypi.python.org/pypi/qpid-tools/ + Authentication ============== @@ -67,7 +75,7 @@ :class:`~kombu.Connection` object are passed directly to the :class:`qpid.messaging.endpoints.Connection` as keyword arguments. These options override and replace any other default or specified values. If using -Celery with Kombu, this can be accomplished by setting the +Celery, this can be accomplished by setting the *BROKER_TRANSPORT_OPTIONS* Celery option. """ @@ -147,13 +155,18 @@ class QoS(object): """A helper object for message prefetch and ACKing purposes. + :keyword prefetch_count: Initial prefetch count, hard set to 1. + :type prefetch_count: int + + NOTE: prefetch_count is currently hard set to 1, and needs to be improved - This object is instantiated 1-for-1 with a :class:`Channel`. QoS - allows prefetch_count to be set to the number of outstanding messages - the corresponding :class:`Channel` should be allowed to prefetch. - Setting prefetch_count to 0 disables prefetch limits, and the object - can hold an arbitrary number of messages. + This object is instantiated 1-for-1 with a + :class:`~.kombu.transport.qpid.Channel` instance. QoS allows + ``prefetch_count`` to be set to the number of outstanding messages + the corresponding :class:`~kombu.transport.qpid.Channel` should be + allowed to prefetch. Setting ``prefetch_count`` to 0 disables + prefetch limits, and the object can hold an arbitrary number of messages. Messages are added using :meth:`append`, which are held until they are ACKed asynchronously through a call to :meth:`ack`. Messages that are @@ -168,19 +181,13 @@ """ def __init__(self, session, prefetch_count=1): - """Instantiate a QoS object. - - :keyword prefetch_count: Initial prefetch count, hard set to 1. - :type prefetch_count: int - - """ self.session = session self.prefetch_count = 1 self._not_yet_acked = OrderedDict() def can_consume(self): - """Return True if the :class:`Channel` can consume more messages, - else False. + """Return True if the :class:`~kombu.transport.qpid.Channel` can + consume more messages, else False. Used to ensure the client adheres to currently active prefetch limits. @@ -189,46 +196,50 @@ without violating the prefetch_count. If prefetch_count is 0, can_consume will always return True. :rtype: bool + """ - return not self.prefetch_count or len(self._not_yet_acked) < self\ - .prefetch_count + return ( + not self.prefetch_count or + len(self._not_yet_acked) < self.prefetch_count + ) def can_consume_max_estimate(self): """Return the remaining message capacity for the associated - :class:`Channel`. + :class:`kombu.transport.qpid.Channel`. Returns an estimated number of outstanding messages that a - :class:`Channel` can accept without exceeding prefetch_count. If - prefetch_count is 0, then this method returns 1. + :class:`kombu.transport.qpid.Channel` can accept without + exceeding ``prefetch_count``. If ``prefetch_count`` is 0, then + this method returns 1. :returns: The number of estimated messages that can be fetched without violating the prefetch_count. :rtype: int + """ - if self.prefetch_count: - return self.prefetch_count - len(self._not_yet_acked) - else: - return 1 + return 1 if not self.prefetch_count else ( + self.prefetch_count - len(self._not_yet_acked) + ) def append(self, message, delivery_tag): """Append message to the list of un-ACKed messages. Add a message, referenced by the delivery_tag, for ACKing, rejecting, or getting later. Messages are saved into an - :class:`~kombu.utils.compat.OrderedDict` by delivery_tag. + :class:`collections.OrderedDict` by delivery_tag. :param message: A received message that has not yet been ACKed. :type message: qpid.messaging.Message :param delivery_tag: A UUID to refer to this message by upon receipt. :type delivery_tag: uuid.UUID + """ self._not_yet_acked[delivery_tag] = message def get(self, delivery_tag): - """ - Get an un-ACKed message by delivery_tag. If called with an invalid - delivery_tag a KeyError is raised. + """Get an un-ACKed message by delivery_tag. If called with an invalid + delivery_tag a :exc:`KeyError` is raised. :param delivery_tag: The delivery tag associated with the message to be returned. @@ -236,6 +247,7 @@ :return: An un-ACKed message that is looked up by delivery_tag. :rtype: qpid.messaging.Message + """ return self._not_yet_acked[delivery_tag] @@ -248,6 +260,7 @@ :param delivery_tag: the delivery tag associated with the message to be acknowledged. :type delivery_tag: uuid.UUID + """ message = self._not_yet_acked.pop(delivery_tag) self.session.acknowledge(message=message) @@ -255,7 +268,7 @@ def reject(self, delivery_tag, requeue=False): """Reject a message by delivery_tag. - Explicitly notify the broker that the :class:`Channel` associated + Explicitly notify the broker that the channel associated with this QoS object is rejecting the message that was previously delivered. @@ -271,6 +284,7 @@ message entirely. In both cases, the message will be removed from this object. :type requeue: bool + """ message = self._not_yet_acked.pop(delivery_tag) QpidDisposition = qpid.messaging.Disposition @@ -284,7 +298,13 @@ class Channel(base.StdChannel): """Supports broker configuration and messaging send and receive. - A Channel object is designed to have method-parity with a Channel as + :param connection: A Connection object that this Channel can + reference. Currently only used to access callbacks. + :type connection: kombu.transport.qpid.Connection + :param transport: The Transport this Channel is associated with. + :type transport: kombu.transport.qpid.Transport + + A channel object is designed to have method-parity with a Channel as defined in AMQP 0-10 and earlier, which allows for the following broker actions: @@ -300,25 +320,26 @@ Channels are designed to all share a single TCP connection with a broker, but provide a level of isolated communication with the broker while benefiting from a shared TCP connection. The Channel is given - its :class:`Connection` object by the :class:`Transport` that - instantiates the Channel. + its :class:`~kombu.transport.qpid.Connection` object by the + :class:`~kombu.transport.qpid.Transport` that + instantiates the channel. - This Channel inherits from :class:`~kombu.transport.base.StdChannel`, - which makes this a 'native' Channel versus a 'virtual' Channel which + This channel inherits from :class:`~kombu.transport.base.StdChannel`, + which makes this a 'native' channel versus a 'virtual' channel which would inherit from :class:`kombu.transports.virtual`. - Messages sent using this Channel are assigned a delivery_tag. The + Messages sent using this channel are assigned a delivery_tag. The delivery_tag is generated for a message as they are prepared for sending by :meth:`basic_publish`. The delivery_tag is unique per - Channel instance. The delivery_tag has no meaningful context in other + channel instance. The delivery_tag has no meaningful context in other objects, and is only maintained in the memory of this object, and the underlying :class:`QoS` object that provides support. - Each Channel object instantiates exactly one :class:`QoS` object for + Each channel object instantiates exactly one :class:`QoS` object for prefetch limiting, and asynchronous ACKing. The :class:`QoS` object is lazily instantiated through a property method :meth:`qos`. The :class:`QoS` object is a supporting object that should not be accessed - directly except by the Channel itself. + directly except by the channel itself. Synchronous reads on a queue are done using a call to :meth:`basic_get` which uses :meth:`_get` to perform the reading. These methods read @@ -368,14 +389,6 @@ codecs = {'base64': Base64()} def __init__(self, connection, transport): - """Instantiate a Channel object. - - :param connection: A Connection object that this Channel can - reference. Currently only used to access callbacks. - :type connection: Connection - :param transport: The Transport this Channel is associated with. - :type transport: Transport - """ self.connection = connection self.transport = transport qpid_connection = connection.get_qpid_connection() @@ -392,9 +405,9 @@ from a queue by name. This method creates a :class:`~qpid.messaging.endpoints.Receiver` to read from the queue using the :class:`~qpid.messaging.endpoints.Session` saved on the - associated :class:`Transport`. The receiver is closed before the - method exits. If a message is available, a - :class:`qpid.messaging.Message` object is returned. If no message is + associated :class:`~kombu.transport.qpid.Transport`. The receiver + is closed before the method exits. If a message is available, a + :class:`qpid.messaging.Message` object is returned. If no message is available, a :class:`qpid.messaging.exceptions.Empty` exception is raised. @@ -408,6 +421,7 @@ :rtype: :class:`qpid.messaging.Message` :raises: :class:`qpid.messaging.exceptions.Empty` if no message is available. + """ rx = self.transport.session.receiver(queue) try: @@ -432,8 +446,8 @@ This method creates a :class:`qpid.messaging.endpoints.Sender` to send the message to the queue using the :class:`qpid.messaging.endpoints.Session` created and referenced by - the associated :class:`Transport`. The sender is closed before the - method exits. + the associated :class:`~kombu.transport.qpid.Transport`. The sender + is closed before the method exits. External calls for put functionality should be done using :meth:`basic_publish`. @@ -449,10 +463,11 @@ should be sent on. If no exchange is specified, the message is sent directly to a queue specified by routing_key. :type exchange: str + """ if not exchange: - address = '%s; {assert: always, node: {type: queue}}' % \ - routing_key + address = '%s; {assert: always, node: {type: queue}}' % ( + routing_key,) msg_subject = None else: address = '%s/%s; {assert: always, node: {type: topic}}' % ( @@ -498,6 +513,7 @@ :raises: :class:`qpid.messaging.exceptions.NotFound` if the queue being purged cannot be found. + """ queue_to_purge = self._broker.getQueue(queue) if queue_to_purge is None: @@ -521,6 +537,7 @@ :return the number of messages in the queue specified by name. :rtype: int + """ queue_to_check = self._broker.getQueue(queue) message_depth = queue_to_check.values['msgDepth'] @@ -539,6 +556,7 @@ :param queue: The name of the queue to be deleted. :type queue: str + """ self._purge(queue) self._broker.delQueue(queue) @@ -552,6 +570,7 @@ :return: True if a queue exists on the broker, and false otherwise. :rtype: bool + """ if self._broker.getQueue(queue): return True @@ -667,6 +686,7 @@ :keyword if_empty: If True, only delete the queue if it is empty. If False, delete the queue if it is empty or not. :type if_empty: bool + """ if self._has_queue(queue): if if_empty and self._size(queue): @@ -702,6 +722,7 @@ :keyword durable: True if the exchange should be durable, or False otherwise. :type durable: bool + """ options = {'durable': durable} try: @@ -715,6 +736,7 @@ :param exchange_name: The name of the exchange to be deleted. :type exchange_name: str + """ self._broker.delExchange(exchange_name) @@ -734,6 +756,7 @@ :param routing_key: The bind key that the specified queue should bind to the specified exchange with. :type routing_key: str + """ self._broker.bind(exchange, queue, routing_key) @@ -755,6 +778,7 @@ :param routing_key: The existing bind key between the specified queue and a specified exchange that should be unbound. :type routing_key: str + """ self._broker.unbind(exchange, queue, routing_key) @@ -787,6 +811,7 @@ :raises: :class:`qpid.messaging.exceptions.NotFound` if the queue being purged cannot be found. + """ return self._purge(queue) @@ -817,6 +842,7 @@ :return: The received message. :rtype: :class:`~kombu.transport.virtual.Message` + """ try: qpid_message = self._get(queue) @@ -841,6 +867,7 @@ :param delivery_tag: The delivery tag associated with the message to be acknowledged. :type delivery_tag: uuid.UUID + """ self.qos.ack(delivery_tag) @@ -928,6 +955,7 @@ :param consumer_tag: a tag to reference the created consumer by. This consumer_tag is needed to cancel the consumer. :type consumer_tag: an immutable object + """ self._tag_to_queue[consumer_tag] = queue @@ -959,6 +987,7 @@ cancelled. Originally specified when the consumer was created as a parameter to :meth:`basic_consume`. :type consumer_tag: an immutable object + """ if consumer_tag in self._receivers: receiver = self._receivers.pop(consumer_tag) @@ -973,6 +1002,7 @@ known consumer_tag. It also closes the self._broker sessions. Closing the sessions implicitly causes all outstanding, un-ACKed messages to be considered undelivered by the broker. + """ if not self.closed: self.closed = True @@ -991,6 +1021,7 @@ :return: An already existing, or newly created QoS object :rtype: :class:`QoS` + """ if self._qos is None: self._qos = self.QoS(self.transport.session) @@ -1007,6 +1038,7 @@ :param prefetch_count: Not used. This method is hard-coded to 1. :type prefetch_count: int + """ self.qos.prefetch_count = 1 @@ -1041,6 +1073,7 @@ attributes. See parameters for more details on attributes that can be set. :rtype: dict + """ properties = properties or {} info = properties.setdefault('delivery_info', {}) @@ -1081,6 +1114,7 @@ :param routing_key: The routing key to be used as the message is submitted onto the exchange. :type routing_key: str + """ message['body'], body_encoding = self.encode_body( message['body'], self.body_encoding, @@ -1117,6 +1151,7 @@ encoding used. If encoding is not specified, the body is passed through unchanged. :rtype: tuple + """ if encoding: return self.codecs.get(encoding).encode(body), encoding @@ -1140,6 +1175,7 @@ :return: If encoding is specified, the decoded body is returned. If encoding is not specified, the body is returned unchanged. :rtype: str + """ if encoding: return self.codecs.get(encoding).decode(body) @@ -1162,6 +1198,7 @@ :return: The exchange type either 'direct', 'topic', or 'fanout'. :rtype: str + """ qpid_exchange = self._broker.getExchange(exchange) if qpid_exchange: @@ -1172,12 +1209,45 @@ class Connection(object): - """Encapsulate a connection object for the :class:`Transport`. + """Encapsulate a connection object for the + :class:`~kombu.transport.qpid.Transport`. + + :param host: The host that connections should connect to. + :param port: The port that connection should connect to. + :param username: The username that connections should connect with. + Optional. + :param password: The password that connections should connect with. + Optional but requires a username. + :param transport: The transport type that connections should use. + Either 'tcp', or 'ssl' are expected as values. + :param timeout: the timeout used when a Connection connects + to the broker. + :param sasl_mechanisms: The sasl authentication mechanism type to use. + refer to SASL documentation for an explanation of valid + values. + + .. note:: + + qpid.messaging has an AuthenticationFailure exception type, but + instead raises a ConnectionError with a message that indicates an + authentication failure occurred in those situations. + ConnectionError is listed as a recoverable error type, so kombu + will attempt to retry if a ConnectionError is raised. Retrying + the operation without adjusting the credentials is not correct, + so this method specifically checks for a ConnectionError that + indicates an Authentication Failure occurred. In those + situations, the error type is mutated while preserving the + original message and raised so kombu will allow the exception to + not be considered recoverable. + - A Connection object is created by a :class:`Transport` during a call to - :meth:`Transport.establish_connection`. The :class:`Transport` passes in + A connection object is created by a + :class:`~kombu.transport.qpid.Transport` during a call to + :meth:`~kombu.transport.qpid.Transport.establish_connection`. The + :class:`~kombu.transport.qpid.Transport` passes in connection options as keywords that should be used for any connections - created. Each :class:`Transport` creates exactly one Connection. + created. Each :class:`~kombu.transport.qpid.Transport` creates exactly + one Connection. A Connection object maintains a reference to a :class:`~qpid.messaging.endpoints.Connection` which can be accessed @@ -1200,46 +1270,13 @@ All keyword arguments are collected into the connection_options dict and passed directly through to :meth:`qpid.messaging.endpoints.Connection.establish`. + """ # A class reference to the :class:`Channel` object Channel = Channel def __init__(self, **connection_options): - """Instantiate a Connection object. - - The following parameters are expected: - - * host: The host that connections should connect to. - * port: The port that connection should connect to. - * username: The username that connections should connect with. - Optional. - * password: The password that connections should connect with. - Optional but requires a username. - * transport: The transport type that connections should use. - Either 'tcp', or 'ssl' are expected as values. - * timeout: the timeout used when a Connection connects to the - broker. - * sasl_mechanisms: The sasl authentication mechanism type to use. - refer to SASL documentation for an explanation of valid - values. - - Creates a :class:`qpid.messaging.endpoints.Connection` object with - the saved parameters, and stores it as _qpid_conn. - - qpid.messaging has an AuthenticationFailure exception type, but - instead raises a ConnectionError with a message that indicates an - authentication failure occurred in those situations. - ConnectionError is listed as a recoverable error type, so kombu - will attempt to retry if a ConnectionError is raised. Retrying - the operation without adjusting the credentials is not correct, - so this method specifically checks for a ConnectionError that - indicates an Authentication Failure occurred. In those - situations, the error type is mutated while preserving the - original message and raised so kombu will allow the exception to - not be considered recoverable. - - """ self.connection_options = connection_options self.channels = [] self._callbacks = {} @@ -1289,6 +1326,7 @@ :return: The existing qpid.messaging.Connection :rtype: :class:`qpid.messaging.endpoints.Connection` + """ return self._qpid_conn @@ -1297,17 +1335,19 @@ Closing the connection will close all associated session, senders, or receivers used by the Connection. + """ self._qpid_conn.close() def close_channel(self, channel): """Close a Channel. - Close a channel specified by a reference to the :class:`Channel` - object. + Close a channel specified by a reference to the + :class:`~kombu.transport.qpid.Channel` object. :param channel: Channel that should be closed. - :type channel: Channel + :type channel: :class:`~kombu.transport.qpid.Channel`. + """ try: self.channels.remove(channel) @@ -1350,6 +1390,7 @@ For backwards compatibility to the pre Kombu 3.0 exception interface, the recoverable errors are also listed as `connection_errors` and `channel_errors`. + """ # Reference to the class that should be used as the Connection object @@ -1385,12 +1426,6 @@ channel_errors = recoverable_channel_errors def __init__(self, *args, **kwargs): - """Instantiate a Transport object. - - This method creates a pipe, and saves the read and write file - descriptors as attributes. The behavior of the read file descriptor - is modified to be non-blocking using fcntl.fcntl. - """ self.verify_runtime_environment() super(Transport, self).__init__(*args, **kwargs) self.r, self._w = os.pipe() @@ -1410,6 +1445,7 @@ RuntimeError is raised. :raises: RuntimeError if the runtime environment is not acceptable. + """ if getattr(sys, 'pypy_version_info', None): raise RuntimeError( @@ -1456,8 +1492,8 @@ Nothing is expected to be returned from :meth:`drain_events` because :meth:`drain_events` handles messages by calling callbacks that are - maintained on the :class:`Connection` object. When - :meth:`drain_events` returns, all associated messages have been + maintained on the :class:`~kombu.transport.qpid.Connection` object. + When :meth:`drain_events` returns, all associated messages have been handled. This method calls drain_events() which reads as many messages as are @@ -1483,10 +1519,11 @@ :param connection: The connection associated with the readable events, which contains the callbacks that need to be called for the readable objects. - :type connection: Connection + :type connection: kombu.transport.qpid.Connection :param loop: The asynchronous loop object that contains epoll like functionality. :type loop: kombu.async.Hub + """ os.read(self.r, 1) try: @@ -1515,9 +1552,10 @@ :param connection: A reference to the connection associated with this Transport. - :type connection: Connection + :type connection: kombu.transport.qpid.Connection :param loop: A reference to the external loop. :type loop: kombu.async.hub.Hub + """ loop.add_reader(self.r, self.on_readable, connection, loop) @@ -1541,6 +1579,7 @@ :return: The created :class:`Connection` object is returned. :rtype: :class:`Connection` + """ conninfo = self.client for name, default_value in items(self.default_connection_params): @@ -1608,11 +1647,11 @@ return conn def close_connection(self, connection): - """ - Close the :class:`Connection` object. + """Close the :class:`Connection` object. :param connection: The Connection that should be closed. :type connection: :class:`kombu.transport.qpid.Connection` + """ connection.close() @@ -1626,15 +1665,16 @@ For each drained message, the message is called to the appropriate callback. Callbacks are organized by queue name. - :param connection: The :class:`Connection` that contains the - callbacks, indexed by queue name, which will be called by this - method. - :type connection: Connection + :param connection: The :class:`~kombu.transport.qpid.Connection` that + contains the callbacks, indexed by queue name, which will be called + by this method. + :type connection: kombu.transport.qpid.Connection :keyword timeout: The timeout that limits how long this method will run for. The timeout could interrupt a blocking read that is waiting for a new message, or cause this method to return before all messages are drained. Defaults to 0. :type timeout: int + """ start_time = time.time() elapsed_time = -1 @@ -1651,18 +1691,19 @@ raise socket.timeout() def create_channel(self, connection): - """Create and return a :class:`Channel`. + """Create and return a :class:`~kombu.transport.qpid.Channel`. - Creates a new :class:`Channel`, and append the :class:`Channel` to the - list of channels known by the :class:`Connection`. Once the new - :class:`Channel` is created, it is returned. + Creates a new channel, and appends the channel to the + list of channels known by the Connection. Once the new + channel is created, it is returned. :param connection: The connection that should support the new - :class:`Channel`. - :type connection: Connection + :class:`~kombu.transport.qpid.Channel`. + :type connection: kombu.transport.qpid.Connection :return: The new Channel that is made. - :rtype: :class:`Channel`. + :rtype: :class:`kombu.transport.qpid.Channel`. + """ channel = connection.Channel(connection, self) connection.channels.append(channel) @@ -1677,6 +1718,7 @@ :return: A dict containing the default parameters. :rtype: dict + """ return { 'hostname': 'localhost', @@ -1684,9 +1726,7 @@ } def __del__(self): - """ - Ensure file descriptors opened in __init__() are closed. - """ + """Ensure file descriptors opened in __init__() are closed.""" for fd in (self.r, self._w): try: os.close(fd) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/kombu-3.0.34/kombu/transport/redis.py new/kombu-3.0.35/kombu/transport/redis.py --- old/kombu-3.0.34/kombu/transport/redis.py 2016-03-04 02:28:42.000000000 +0100 +++ new/kombu-3.0.35/kombu/transport/redis.py 2016-03-22 20:08:32.000000000 +0100 @@ -89,7 +89,7 @@ OSError, exceptions.ConnectionError, exceptions.AuthenticationError, - getattr(exceptions, 'south_south_TimeoutError', None))))), + getattr(exceptions, 'TimeoutError', None))))), (virtual.Transport.channel_errors + ( DataError, exceptions.InvalidResponse, @@ -395,6 +395,9 @@ visibility_timeout = 3600 # 1 hour priority_steps = PRIORITY_STEPS socket_timeout = None + socket_connect_timeout = None + socket_keepalive = None + socket_keepalive_options = None max_connections = 10 #: Transport option to enable disable fanout keyprefix. #: Should be enabled by default, but that is not @@ -424,6 +427,10 @@ 'fanout_prefix', 'fanout_patterns', 'socket_timeout', + 'socket_connect_timeout', + 'socket_keepalive', + 'socket_keepalive_options', + 'queue_order_strategy', 'max_connections', 'priority_steps') # <-- do not add comma here! ) @@ -803,12 +810,24 @@ def _connparams(self, async=False): conninfo = self.connection.client - connparams = {'host': conninfo.hostname or '127.0.0.1', - 'port': conninfo.port or DEFAULT_PORT, - 'virtual_host': conninfo.virtual_host, - 'password': conninfo.password, - 'max_connections': self.max_connections, - 'socket_timeout': self.socket_timeout} + connparams = { + 'host': conninfo.hostname or '127.0.0.1', + 'port': conninfo.port or DEFAULT_PORT, + 'virtual_host': conninfo.virtual_host, + 'password': conninfo.password, + 'max_connections': self.max_connections, + 'socket_timeout': self.socket_timeout, + 'socket_connect_timeout': self.socket_connect_timeout, + 'socket_keepalive': self.socket_keepalive, + 'socket_keepalive_options': self.socket_keepalive_options, + } + if redis.VERSION < (2, 10): + for param in ('socket_keepalive', 'socket_keepalive_options'): + val = connparams.pop('socket_keepalive', None) + if val is not None: + raise VersionMismatch( + 'redis: {0!r} requires redis 2.10.0 or higher'.format( + param)) host = connparams['host'] if '://' in host: scheme, _, _, _, password, path, query = _parse_url(host) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/kombu-3.0.34/kombu.egg-info/PKG-INFO new/kombu-3.0.35/kombu.egg-info/PKG-INFO --- old/kombu-3.0.34/kombu.egg-info/PKG-INFO 2016-03-04 02:55:48.000000000 +0100 +++ new/kombu-3.0.35/kombu.egg-info/PKG-INFO 2016-03-22 20:15:04.000000000 +0100 @@ -1,6 +1,6 @@ Metadata-Version: 1.1 Name: kombu -Version: 3.0.34 +Version: 3.0.35 Summary: Messaging library for Python Home-page: http://kombu.readthedocs.org Author: Ask Solem @@ -12,7 +12,7 @@ kombu - Messaging library for Python ======================================== - :Version: 3.0.34 + :Version: 3.0.35 `Kombu` is a messaging library for Python. diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/kombu-3.0.34/kombu.egg-info/requires.txt new/kombu-3.0.35/kombu.egg-info/requires.txt --- old/kombu-3.0.34/kombu.egg-info/requires.txt 2016-03-04 02:55:48.000000000 +0100 +++ new/kombu-3.0.35/kombu.egg-info/requires.txt 2016-03-22 20:15:04.000000000 +0100 @@ -18,7 +18,7 @@ pymongo>=2.6.2 [msgpack] -msgpack-python>=0.3.0 +msgpack-python>=0.4.7 [pyro] pyro4 diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/kombu-3.0.34/requirements/docs.txt new/kombu-3.0.35/requirements/docs.txt --- old/kombu-3.0.34/requirements/docs.txt 2014-01-22 21:00:00.000000000 +0100 +++ new/kombu-3.0.35/requirements/docs.txt 2016-03-22 20:09:58.000000000 +0100 @@ -1,3 +1,4 @@ Sphinx sphinxcontrib-issuetracker>=0.9 Django +-r extras/mongodb.txt diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/kombu-3.0.34/requirements/extras/msgpack.txt new/kombu-3.0.35/requirements/extras/msgpack.txt --- old/kombu-3.0.34/requirements/extras/msgpack.txt 2015-09-25 21:25:05.000000000 +0200 +++ new/kombu-3.0.35/requirements/extras/msgpack.txt 2016-03-09 02:58:39.000000000 +0100 @@ -1 +1 @@ -msgpack-python>=0.3.0 +msgpack-python>=0.4.7 diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/kombu-3.0.34/requirements/test-ci3.txt new/kombu-3.0.35/requirements/test-ci3.txt --- old/kombu-3.0.34/requirements/test-ci3.txt 2016-03-04 02:28:42.000000000 +0100 +++ new/kombu-3.0.35/requirements/test-ci3.txt 2016-03-04 05:15:48.000000000 +0100 @@ -3,4 +3,3 @@ redis PyYAML msgpack-python>0.2.0 # 0.2.0 dropped 2.5 support -boto