Hello community, here is the log from the commit of package python-kombu for openSUSE:Factory checked in at 2014-08-16 15:37:57 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/python-kombu (Old) and /work/SRC/openSUSE:Factory/.python-kombu.new (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "python-kombu" Changes: -------- --- /work/SRC/openSUSE:Factory/python-kombu/python-kombu.changes 2014-06-04 18:39:26.000000000 +0200 +++ /work/SRC/openSUSE:Factory/.python-kombu.new/python-kombu.changes 2014-08-16 15:38:11.000000000 +0200 @@ -1,0 +2,6 @@ +Fri Aug 15 11:42:32 UTC 2014 - [email protected] + +- update to 3.0.21; + - see http://kombu.readthedocs.org/en/latest/changelog.html for full changelog + +------------------------------------------------------------------- Old: ---- kombu-3.0.16.tar.gz New: ---- kombu-3.0.21.tar.gz ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ python-kombu.spec ++++++ --- /var/tmp/diff_new_pack.FiPNaT/_old 2014-08-16 15:38:12.000000000 +0200 +++ /var/tmp/diff_new_pack.FiPNaT/_new 2014-08-16 15:38:12.000000000 +0200 @@ -17,7 +17,7 @@ Name: python-kombu -Version: 3.0.16 +Version: 3.0.21 Release: 0 Summary: AMQP Messaging Framework for Python License: BSD-3-Clause ++++++ kombu-3.0.16.tar.gz -> kombu-3.0.21.tar.gz ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/kombu-3.0.16/AUTHORS new/kombu-3.0.21/AUTHORS --- old/kombu-3.0.16/AUTHORS 2014-05-06 15:01:41.000000000 +0200 +++ new/kombu-3.0.21/AUTHORS 2014-07-07 15:17:34.000000000 +0200 @@ -37,6 +37,7 @@ Ephemera <[email protected]> Eric Reynolds <[email protected]> Fabrice Rabaute <[email protected]> +Felix Schwarz <[email protected]> Fernando Jorge Mota <[email protected]> Flavio [FlaPer87] Percoco Premoli <[email protected]> Florian Munz <[email protected]> @@ -61,6 +62,8 @@ Keith Fitzgerald <[email protected]> Kevin McCarthy <[email protected]> Kevin McDonald <[email protected]> +Latitia M. Haskins <[email protected]> +Len Buckens <[email protected]> Mahendra M <[email protected]> Marcin Lulek (ergo) <[email protected]> Mark Lavin <[email protected]> @@ -83,6 +86,7 @@ Ralf Nyren <[email protected]> Randy Barlow <[email protected]> Rob Ottaway <[email protected]> +Roger Hu <[email protected]> Rumyana Neykova <[email protected]> Rune Halvorsen <[email protected]> Ryan Petrello <[email protected]> diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/kombu-3.0.16/Changelog new/kombu-3.0.21/Changelog --- old/kombu-3.0.16/Changelog 2014-05-06 15:33:45.000000000 +0200 +++ new/kombu-3.0.21/Changelog 2014-07-07 17:11:56.000000000 +0200 @@ -4,6 +4,87 @@ Change history ================ +.. _version-3.0.21: + +3.0.21 +====== +:release-date: 2014-07-07 02:00 P.M UTC +:release-by: Ask Solem + +- Fixed remaining bug in ``maybe_declare`` for ``auto_delete`` exchanges. + + Fix contributed by Roger Hu. + +- MongoDB: Creating a channel now properly evaluates a connection (Issue #363). + + Fix contributed by Len Buckens. + +.. _version-3.0.20: + +3.0.20 +====== +:release-date: 2014-06-24 02:30 P.M UTC +:release-by: Ask Solem + +- Reverts change in 3.0.17 where ``maybe_declare`` caches the declaration + of auto_delete queues and exchanges. + + Fix contributed by Roger Hu. + +- Redis: Fixed race condition when using gevent and the channel is closed. + + Fix contributed by Andrew Rodionoff. + +.. _version-3.0.19: + +3.0.19 +====== +:release-date: 2014-06-09 03:10 P.M UTC +:release-by: Ask Solem + +- The wheel distribution did not support Python 2.6 by failing to list + the extra dependencies required. + +- Durable and auto_delete queues/exchanges can be be cached using + ``maybe_declare``. + +.. _version-3.0.18: + +3.0.18 +====== +:release-date: 2014-06-02 06:00 P.M UTC +:release-by: Ask Solem + +- A typo introduced in 3.0.17 caused kombu.async.hub to crash (Issue #360). + +.. _version-3.0.17: + +3.0.17 +====== +:release-date: 2014-06-02 05:00 P.M UTC +:release-by: Ask Solem + +- ``kombu[librabbitmq]`` now depends on librabbitmq 1.5.2. + +- Async: Event loop now selectively removes file descriptors for the mode + it failed in, and keeps others (e.g read vs write). + + Fix contributed by Roger Hu. + +- CouchDB: Now works without userid set. + + Fix contributed by Latitia M. Haskins. + +- SQLAlchemy: Now supports recovery from connection errors. + + Contributed by Felix Schwarz. + +- Redis: Restore at shutdown now works when ack emulation is disabled. + +- :func:`kombu.common.eventloop` accidentally swallowed socket errors. + +- Adds :func:`kombu.utils.url.sanitize_url` + .. _version-3.0.16: 3.0.16 diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/kombu-3.0.16/LICENSE new/kombu-3.0.21/LICENSE --- old/kombu-3.0.16/LICENSE 2014-01-22 21:00:00.000000000 +0100 +++ new/kombu-3.0.21/LICENSE 2014-06-11 15:50:43.000000000 +0200 @@ -1,4 +1,4 @@ -Copyright (c) 2012-2013 GoPivotal, Inc. All rights reserved. +Copyright (c) 2012-2014 GoPivotal, Inc. All rights reserved. Copyright (c) 2009-2012, Ask Solem & contributors. All rights reserved. diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/kombu-3.0.16/PKG-INFO new/kombu-3.0.21/PKG-INFO --- old/kombu-3.0.16/PKG-INFO 2014-05-06 15:37:46.000000000 +0200 +++ new/kombu-3.0.21/PKG-INFO 2014-07-07 17:12:53.000000000 +0200 @@ -1,6 +1,6 @@ Metadata-Version: 1.1 Name: kombu -Version: 3.0.16 +Version: 3.0.21 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.16 + :Version: 3.0.21 `Kombu` is a messaging library for Python. diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/kombu-3.0.16/README.rst new/kombu-3.0.21/README.rst --- old/kombu-3.0.16/README.rst 2014-05-06 15:34:02.000000000 +0200 +++ new/kombu-3.0.21/README.rst 2014-07-07 16:57:16.000000000 +0200 @@ -4,7 +4,7 @@ kombu - Messaging library for Python ======================================== -:Version: 3.0.16 +:Version: 3.0.21 `Kombu` is a messaging library for Python. diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/kombu-3.0.16/docs/changelog.rst new/kombu-3.0.21/docs/changelog.rst --- old/kombu-3.0.16/docs/changelog.rst 2014-05-06 15:33:45.000000000 +0200 +++ new/kombu-3.0.21/docs/changelog.rst 2014-07-07 17:11:56.000000000 +0200 @@ -4,6 +4,87 @@ Change history ================ +.. _version-3.0.21: + +3.0.21 +====== +:release-date: 2014-07-07 02:00 P.M UTC +:release-by: Ask Solem + +- Fixed remaining bug in ``maybe_declare`` for ``auto_delete`` exchanges. + + Fix contributed by Roger Hu. + +- MongoDB: Creating a channel now properly evaluates a connection (Issue #363). + + Fix contributed by Len Buckens. + +.. _version-3.0.20: + +3.0.20 +====== +:release-date: 2014-06-24 02:30 P.M UTC +:release-by: Ask Solem + +- Reverts change in 3.0.17 where ``maybe_declare`` caches the declaration + of auto_delete queues and exchanges. + + Fix contributed by Roger Hu. + +- Redis: Fixed race condition when using gevent and the channel is closed. + + Fix contributed by Andrew Rodionoff. + +.. _version-3.0.19: + +3.0.19 +====== +:release-date: 2014-06-09 03:10 P.M UTC +:release-by: Ask Solem + +- The wheel distribution did not support Python 2.6 by failing to list + the extra dependencies required. + +- Durable and auto_delete queues/exchanges can be be cached using + ``maybe_declare``. + +.. _version-3.0.18: + +3.0.18 +====== +:release-date: 2014-06-02 06:00 P.M UTC +:release-by: Ask Solem + +- A typo introduced in 3.0.17 caused kombu.async.hub to crash (Issue #360). + +.. _version-3.0.17: + +3.0.17 +====== +:release-date: 2014-06-02 05:00 P.M UTC +:release-by: Ask Solem + +- ``kombu[librabbitmq]`` now depends on librabbitmq 1.5.2. + +- Async: Event loop now selectively removes file descriptors for the mode + it failed in, and keeps others (e.g read vs write). + + Fix contributed by Roger Hu. + +- CouchDB: Now works without userid set. + + Fix contributed by Latitia M. Haskins. + +- SQLAlchemy: Now supports recovery from connection errors. + + Contributed by Felix Schwarz. + +- Redis: Restore at shutdown now works when ack emulation is disabled. + +- :func:`kombu.common.eventloop` accidentally swallowed socket errors. + +- Adds :func:`kombu.utils.url.sanitize_url` + .. _version-3.0.16: 3.0.16 diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/kombu-3.0.16/docs/conf.py new/kombu-3.0.21/docs/conf.py --- old/kombu-3.0.16/docs/conf.py 2014-01-22 21:00:00.000000000 +0100 +++ new/kombu-3.0.21/docs/conf.py 2014-06-11 15:50:43.000000000 +0200 @@ -29,7 +29,7 @@ # General information about the project. project = 'Kombu' -copyright = '2009-2013, Ask Solem' +copyright = '2009-2014, Ask Solem' # The version info for the project you're documenting, acts as replacement for # |version| and |release|, also used in various other places throughout the diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/kombu-3.0.16/docs/introduction.rst new/kombu-3.0.21/docs/introduction.rst --- old/kombu-3.0.16/docs/introduction.rst 2014-05-06 15:34:02.000000000 +0200 +++ new/kombu-3.0.21/docs/introduction.rst 2014-07-07 16:57:16.000000000 +0200 @@ -4,7 +4,7 @@ kombu - Messaging library for Python ======================================== -:Version: 3.0.16 +:Version: 3.0.21 `Kombu` is a messaging library for Python. diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/kombu-3.0.16/docs/reference/index.rst new/kombu-3.0.21/docs/reference/index.rst --- old/kombu-3.0.16/docs/reference/index.rst 2014-04-23 18:45:15.000000000 +0200 +++ new/kombu-3.0.21/docs/reference/index.rst 2014-07-07 16:56:44.000000000 +0200 @@ -27,7 +27,7 @@ kombu.async.hub kombu.async.semaphore kombu.async.timer - kombu.async..debug + kombu.async.debug kombu.transport kombu.transport.pyamqp kombu.transport.librabbitmq diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/kombu-3.0.16/kombu/__init__.py new/kombu-3.0.21/kombu/__init__.py --- old/kombu-3.0.16/kombu/__init__.py 2014-05-06 15:33:57.000000000 +0200 +++ new/kombu-3.0.21/kombu/__init__.py 2014-07-07 16:57:13.000000000 +0200 @@ -7,7 +7,7 @@ 'version_info_t', ('major', 'minor', 'micro', 'releaselevel', 'serial'), ) -VERSION = version_info_t(3, 0, 16, '', '') +VERSION = version_info_t(3, 0, 21, '', '') __version__ = '{0.major}.{0.minor}.{0.micro}{0.releaselevel}'.format(VERSION) __author__ = 'Ask Solem' __contact__ = '[email protected]' diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/kombu-3.0.16/kombu/async/hub.py new/kombu-3.0.21/kombu/async/hub.py --- old/kombu-3.0.16/kombu/async/hub.py 2014-05-06 14:57:54.000000000 +0200 +++ new/kombu-3.0.21/kombu/async/hub.py 2014-07-07 16:56:44.000000000 +0200 @@ -272,35 +272,39 @@ item() poll_timeout = fire_timers(propagate=propagate) if scheduled else 1 - #print('[[[HUB]]]: %s' % (self.repr_active(), )) if readers or writers: to_consolidate = [] try: events = poll(poll_timeout) - #print('[EVENTS]: %s' % (self.nepr_events(events or []), )) except ValueError: # Issue 882 raise StopIteration() - for fileno, event in events or (): - if fileno in consolidate and \ - writers.get(fileno) is None: - to_consolidate.append(fileno) + for fd, event in events or (): + if fd in consolidate and \ + writers.get(fd) is None: + to_consolidate.append(fd) continue cb = cbargs = None - try: - if event & READ: - cb, cbargs = readers[fileno] - elif event & WRITE: - cb, cbargs = writers[fileno] - elif event & ERR: - try: - cb, cbargs = (readers.get(fileno) or - writers.get(fileno)) - except TypeError: - pass - except (KeyError, Empty): - hub_remove(fileno) - continue + + if event & READ: + try: + cb, cbargs = readers[fd] + except KeyError: + self.remove_reader(fd) + continue + elif event & WRITE: + try: + cb, cbargs = writers[fd] + except KeyError: + self.remove_writer(fd) + continue + elif event & ERR: + try: + cb, cbargs = (readers.get(fd) or + writers.get(fd)) + except TypeError: + pass + if cb is None: continue if isinstance(cb, generator): @@ -309,11 +313,11 @@ except OSError as exc: if get_errno(exc) != errno.EBADF: raise - hub_remove(fileno) + hub_remove(fd) except StopIteration: pass except Exception: - hub_remove(fileno) + hub_remove(fd) raise else: try: diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/kombu-3.0.16/kombu/common.py new/kombu-3.0.21/kombu/common.py --- old/kombu-3.0.16/kombu/common.py 2014-02-13 18:29:35.000000000 +0100 +++ new/kombu-3.0.21/kombu/common.py 2014-07-04 18:46:18.000000000 +0200 @@ -22,7 +22,6 @@ from .entity import Exchange, Queue from .five import range from .log import get_logger -from .messaging import Consumer as _Consumer from .serialization import registry as serializers from .utils import uuid @@ -91,33 +90,43 @@ def maybe_declare(entity, channel=None, retry=False, **retry_policy): - if not entity.is_bound: + is_bound = entity.is_bound + + if not is_bound: assert channel entity = entity.bind(channel) + + if channel is None: + assert is_bound + channel = entity.channel + + declared = ident = None + if channel.connection and entity.can_cache_declaration: + declared = channel.connection.client.declared_entities + ident = hash(entity) + if ident in declared: + return False + if retry: - return _imaybe_declare(entity, **retry_policy) - return _maybe_declare(entity) + return _imaybe_declare(entity, declared, ident, + channel, **retry_policy) + return _maybe_declare(entity, declared, ident, channel) -def _maybe_declare(entity): - channel = entity.channel +def _maybe_declare(entity, declared, ident, channel): + channel = channel or entity.channel if not channel.connection: raise RecoverableConnectionError('channel disconnected') - if entity.can_cache_declaration: - declared = channel.connection.client.declared_entities - ident = hash(entity) - if ident not in declared: - entity.declare() - declared.add(ident) - return True - return False entity.declare() + if declared is not None and ident: + declared.add(ident) return True -def _imaybe_declare(entity, **retry_policy): +def _imaybe_declare(entity, declared, ident, channel, **retry_policy): return entity.channel.connection.client.ensure( - entity, _maybe_declare, **retry_policy)(entity) + entity, _maybe_declare, **retry_policy)( + entity, declared, ident, channel) def drain_consumer(consumer, limit=1, timeout=None, callbacks=None): @@ -138,8 +147,8 @@ def itermessages(conn, channel, queue, limit=1, timeout=None, - Consumer=_Consumer, callbacks=None, **kwargs): - return drain_consumer(Consumer(channel, queues=[queue], **kwargs), + callbacks=None, **kwargs): + return drain_consumer(conn.Consumer(channel, queues=[queue], **kwargs), limit=limit, timeout=timeout, callbacks=callbacks) @@ -181,8 +190,6 @@ except socket.timeout: if timeout and not ignore_timeouts: # pragma: no cover raise - except socket.error: # pragma: no cover - pass def send_reply(exchange, req, msg, diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/kombu-3.0.16/kombu/connection.py new/kombu-3.0.21/kombu/connection.py --- old/kombu-3.0.16/kombu/connection.py 2014-05-06 14:57:54.000000000 +0200 +++ new/kombu-3.0.21/kombu/connection.py 2014-07-07 16:56:44.000000000 +0200 @@ -11,13 +11,8 @@ import socket from contextlib import contextmanager -from functools import partial from itertools import count, cycle from operator import itemgetter -try: - from urllib.parse import quote -except ImportError: # Py2 - from urllib import quote # noqa # jython breaks on relative import for .exceptions for some reason # (Issue #112) @@ -28,7 +23,7 @@ from .utils import cached_property, retry_over_time, shufflecycle, HashedSeq from .utils.compat import OrderedDict from .utils.functional import lazy -from .utils.url import parse_url, urlparse +from .utils.url import as_url, parse_url, quote, urlparse __all__ = ['Connection', 'ConnectionPool', 'ChannelPool'] @@ -199,6 +194,7 @@ """Switch connection parameters to use a new URL (does not reconnect)""" self.close() + self.declared_entities.clear() self._closed = False self._init_params(**dict(self._initial_params, **parse_url(url))) @@ -569,36 +565,23 @@ self.password, self.virtual_host, self.port, repr(self.transport_options)) - def as_uri(self, include_password=False, mask=''): + def as_uri(self, include_password=False, mask='**', + getfields=itemgetter('port', 'userid', 'password', + 'virtual_host', 'transport')): """Convert connection parameters to URL form.""" hostname = self.hostname or 'localhost' if self.transport.can_parse_url: if self.uri_prefix: return '%s+%s' % (self.uri_prefix, hostname) return self.hostname - quoteS = partial(quote, safe='') # strict quote fields = self.info() - port, userid, password, transport = itemgetter( - 'port', 'userid', 'password', 'transport' - )(fields) - url = '%s://' % transport - if userid or password: - if userid: - url += quoteS(userid) - if password: - if include_password: - url += ':' + quoteS(password) - else: - url += ':' + mask if mask else '' - url += '@' - url += quoteS(fields['hostname']) - if port: - url += ':%s' % (port, ) - - url += '/' + quote(fields['virtual_host']) - if self.uri_prefix: - return '%s+%s' % (self.uri_prefix, url) - return url + port, userid, password, vhost, transport = getfields(fields) + scheme = ('{0}+{1}'.format(self.uri_prefix, transport) + if self.uri_prefix else transport) + return as_url( + scheme, hostname, port, userid, password, quote(vhost), + sanitize=not include_password, mask=mask, + ) def Pool(self, limit=None, preload=None): """Pool of connections. diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/kombu-3.0.16/kombu/entity.py new/kombu-3.0.21/kombu/entity.py --- old/kombu-3.0.16/kombu/entity.py 2014-02-13 18:29:35.000000000 +0100 +++ new/kombu-3.0.21/kombu/entity.py 2014-07-04 18:46:18.000000000 +0200 @@ -288,7 +288,7 @@ @property def can_cache_declaration(self): - return self.durable and not self.auto_delete + return not self.auto_delete class binding(object): @@ -672,7 +672,7 @@ @property def can_cache_declaration(self): - return self.durable and not self.auto_delete + return not self.auto_delete @classmethod def from_dict(self, queue, **options): diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/kombu-3.0.16/kombu/five.py new/kombu-3.0.21/kombu/five.py --- old/kombu-3.0.16/kombu/five.py 2014-03-03 17:25:11.000000000 +0100 +++ new/kombu-3.0.21/kombu/five.py 2014-07-07 16:56:44.000000000 +0200 @@ -10,7 +10,7 @@ """ from __future__ import absolute_import -############## py3k ######################################################### +# ############# py3k ######################################################### import sys PY3 = sys.version_info[0] == 3 @@ -34,7 +34,7 @@ except NameError: # pragma: no cover bytes_t = str # noqa -############## time.monotonic ################################################ +# ############# time.monotonic ############################################### if sys.version_info < (3, 3): @@ -89,7 +89,7 @@ except ImportError: monotonic = _monotonic # noqa -############## Py3 <-> Py2 ################################################### +# ############# Py3 <-> Py2 ################################################## if PY3: # pragma: no cover import builtins diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/kombu-3.0.16/kombu/messaging.py new/kombu-3.0.21/kombu/messaging.py --- old/kombu-3.0.16/kombu/messaging.py 2014-04-23 18:45:15.000000000 +0200 +++ new/kombu-3.0.21/kombu/messaging.py 2014-07-04 18:46:18.000000000 +0200 @@ -11,6 +11,7 @@ from itertools import count +from .common import maybe_declare from .compression import compress from .connection import maybe_channel, is_connection from .entity import Exchange, Queue, DELIVERY_MODES @@ -107,7 +108,6 @@ """Declare the exchange if it hasn't already been declared during this session.""" if entity: - from .common import maybe_declare return maybe_declare(entity, self.channel, retry, **retry_policy) def publish(self, body, routing_key=None, delivery_mode=None, diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/kombu-3.0.16/kombu/pidbox.py new/kombu-3.0.21/kombu/pidbox.py --- old/kombu-3.0.16/kombu/pidbox.py 2014-04-23 18:45:15.000000000 +0200 +++ new/kombu-3.0.21/kombu/pidbox.py 2014-07-07 16:56:44.000000000 +0200 @@ -210,14 +210,14 @@ def get_reply_queue(self): oid = self.oid - return Queue('%s.%s' % (oid, self.reply_exchange.name), - exchange=self.reply_exchange, - routing_key=oid, - durable=False, - auto_delete=True, - queue_arguments={ - 'x-expires': int(REPLY_QUEUE_EXPIRES * 1000), - }) + return Queue( + '%s.%s' % (oid, self.reply_exchange.name), + exchange=self.reply_exchange, + routing_key=oid, + durable=False, + auto_delete=True, + queue_arguments={'x-expires': int(REPLY_QUEUE_EXPIRES * 1000)}, + ) @cached_property def reply_queue(self): diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/kombu-3.0.16/kombu/syn.py new/kombu-3.0.21/kombu/syn.py --- old/kombu-3.0.16/kombu/syn.py 2014-01-22 21:00:00.000000000 +0100 +++ new/kombu-3.0.21/kombu/syn.py 2014-06-11 15:50:44.000000000 +0200 @@ -21,7 +21,7 @@ def _detect_environment(): - ## -eventlet- + # ## -eventlet- if 'eventlet' in sys.modules: try: from eventlet.patcher import is_monkey_patched as is_eventlet @@ -32,7 +32,7 @@ except ImportError: pass - # -gevent- + # ## -gevent- if 'gevent' in sys.modules: try: from gevent import socket as _gsocket diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/kombu-3.0.16/kombu/tests/test_common.py new/kombu-3.0.21/kombu/tests/test_common.py --- old/kombu-3.0.16/kombu/tests/test_common.py 2014-02-13 18:29:35.000000000 +0100 +++ new/kombu-3.0.21/kombu/tests/test_common.py 2014-06-20 16:46:32.000000000 +0200 @@ -105,6 +105,8 @@ def test_with_retry(self): channel = Mock() + client = channel.connection.client = Mock() + client.declared_entities = set() entity = Mock() entity.can_cache_declaration = True entity.is_bound = True @@ -265,8 +267,8 @@ conn = self.MockConnection() channel = Mock() channel.connection.client = conn - it = common.itermessages(conn, channel, 'q', limit=1, - Consumer=MockConsumer) + conn.Consumer = MockConsumer + it = common.itermessages(conn, channel, 'q', limit=1) ret = next(it) self.assertTupleEqual(ret, ('body', 'message')) @@ -279,8 +281,8 @@ conn.should_raise_timeout = True channel = Mock() channel.connection.client = conn - it = common.itermessages(conn, channel, 'q', limit=1, - Consumer=MockConsumer) + conn.Consumer = MockConsumer + it = common.itermessages(conn, channel, 'q', limit=1) with self.assertRaises(StopIteration): next(it) @@ -291,8 +293,8 @@ deque_instance.popleft.side_effect = IndexError() conn = self.MockConnection() channel = Mock() - it = common.itermessages(conn, channel, 'q', limit=1, - Consumer=MockConsumer) + conn.Consumer = MockConsumer + it = common.itermessages(conn, channel, 'q', limit=1) with self.assertRaises(StopIteration): next(it) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/kombu-3.0.16/kombu/tests/test_connection.py new/kombu-3.0.21/kombu/tests/test_connection.py --- old/kombu-3.0.16/kombu/tests/test_connection.py 2014-05-06 14:57:54.000000000 +0200 +++ new/kombu-3.0.21/kombu/tests/test_connection.py 2014-07-07 16:56:44.000000000 +0200 @@ -17,7 +17,7 @@ def setUp(self): self.url = 'amqp://user:pass@localhost:5672/my/vhost' - self.nopass = 'amqp://user@localhost:5672/my/vhost' + self.nopass = 'amqp://user:**@localhost:5672/my/vhost' self.expected = { 'transport': 'amqp', 'userid': 'user', @@ -31,10 +31,6 @@ result = parse_url(self.url) self.assertDictEqual(result, self.expected) - def test_parse_url_mongodb(self): - result = parse_url('mongodb://example.com/') - self.assertEqual(result['hostname'], 'example.com/') - def test_parse_generated_as_uri(self): conn = Connection(self.url) info = conn.info() diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/kombu-3.0.16/kombu/tests/test_entities.py new/kombu-3.0.21/kombu/tests/test_entities.py --- old/kombu-3.0.16/kombu/tests/test_entities.py 2014-05-06 14:57:54.000000000 +0200 +++ new/kombu-3.0.21/kombu/tests/test_entities.py 2014-07-07 16:56:44.000000000 +0200 @@ -76,7 +76,7 @@ def test_can_cache_declaration(self): self.assertTrue(Exchange('a', durable=True).can_cache_declaration) - self.assertFalse(Exchange('a', durable=False).can_cache_declaration) + self.assertTrue(Exchange('a', durable=False).can_cache_declaration) def test_pickle(self): e1 = Exchange('foo', 'direct') @@ -285,7 +285,7 @@ def test_can_cache_declaration(self): self.assertTrue(Queue('a', durable=True).can_cache_declaration) - self.assertFalse(Queue('a', durable=False).can_cache_declaration) + self.assertTrue(Queue('a', durable=False).can_cache_declaration) def test_eq(self): q1 = Queue('xxx', Exchange('xxx', 'direct'), 'xxx') diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/kombu-3.0.16/kombu/tests/test_messaging.py new/kombu-3.0.21/kombu/tests/test_messaging.py --- old/kombu-3.0.16/kombu/tests/test_messaging.py 2014-05-06 14:57:54.000000000 +0200 +++ new/kombu-3.0.21/kombu/tests/test_messaging.py 2014-07-07 16:56:44.000000000 +0200 @@ -36,7 +36,7 @@ p = Producer(None) self.assertFalse(p._channel) - @patch('kombu.common.maybe_declare') + @patch('kombu.messaging.maybe_declare') def test_maybe_declare(self, maybe_declare): p = self.connection.Producer() q = Queue('foo') diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/kombu-3.0.16/kombu/tests/test_mixins.py new/kombu-3.0.21/kombu/tests/test_mixins.py --- old/kombu-3.0.16/kombu/tests/test_mixins.py 2014-05-06 14:57:54.000000000 +0200 +++ new/kombu-3.0.21/kombu/tests/test_mixins.py 2014-07-07 16:56:44.000000000 +0200 @@ -90,7 +90,6 @@ def test_Consumer_context(self): c, Acons, Bcons = self._context() - _connref = _chanref = None with c.Consumer() as (conn, channel, consumer): self.assertIs(conn, c.connection) @@ -104,7 +103,6 @@ self.assertIs(subcons.channel, conn.default_channel) Acons.__enter__.assert_called_with() Bcons.__enter__.assert_called_with() - _connref, _chanref = conn, channel c.on_consume_end.assert_called_with(conn, channel) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/kombu-3.0.16/kombu/tests/test_syn.py new/kombu-3.0.21/kombu/tests/test_syn.py --- old/kombu-3.0.16/kombu/tests/test_syn.py 2014-01-22 21:00:00.000000000 +0100 +++ new/kombu-3.0.21/kombu/tests/test_syn.py 2014-06-11 15:50:44.000000000 +0200 @@ -38,9 +38,12 @@ def test_detect_environment_gevent(self): with patch('gevent.socket', create=True) as m: prev, socket.socket = socket.socket, m.socket - self.assertTrue(sys.modules['gevent']) - env = syn._detect_environment() - self.assertEqual(env, 'gevent') + try: + self.assertTrue(sys.modules['gevent']) + env = syn._detect_environment() + self.assertEqual(env, 'gevent') + finally: + socket.socket = prev def test_detect_environment_no_eventlet_or_gevent(self): try: diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/kombu-3.0.16/kombu/tests/transport/test_mongodb.py new/kombu-3.0.21/kombu/tests/transport/test_mongodb.py --- old/kombu-3.0.16/kombu/tests/transport/test_mongodb.py 2014-03-03 17:25:11.000000000 +0100 +++ new/kombu-3.0.21/kombu/tests/transport/test_mongodb.py 2014-07-07 17:10:42.000000000 +0200 @@ -2,7 +2,7 @@ from kombu import Connection -from kombu.tests.case import Case, SkipTest, skip_if_not_module +from kombu.tests.case import Case, SkipTest, Mock, skip_if_not_module class MockConnection(dict): @@ -16,8 +16,14 @@ def _get_connection(self, url, **kwargs): from kombu.transport import mongodb + class _Channel(mongodb.Channel): + + def _create_client(self): + self._client = Mock(name='client') + class Transport(mongodb.Transport): Connection = MockConnection + Channel = _Channel return Connection(url, transport=Transport, **kwargs).connect() @@ -48,7 +54,7 @@ self.assertEquals(dbname, 'dbname') @skip_if_not_module('pymongo') - def test_custom_credentions(self): + def test_custom_credentials(self): url = 'mongodb://localhost/dbname' c = self._get_connection(url, userid='foo', password='bar') hostname, dbname, options = c.channels[0]._parse_uri() diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/kombu-3.0.16/kombu/tests/transport/test_redis.py new/kombu-3.0.21/kombu/tests/transport/test_redis.py --- old/kombu-3.0.16/kombu/tests/transport/test_redis.py 2014-05-06 14:59:05.000000000 +0200 +++ new/kombu-3.0.21/kombu/tests/transport/test_redis.py 2014-07-07 16:56:44.000000000 +0200 @@ -220,6 +220,7 @@ class test_Channel(Case): + @skip_if_not_module('redis') def setUp(self): self.connection = self.create_connection() self.channel = self.connection.default_channel @@ -788,6 +789,7 @@ class test_Redis(Case): + @skip_if_not_module('redis') def setUp(self): self.connection = Connection(transport=Transport) self.exchange = Exchange('test_Redis', type='direct') @@ -944,6 +946,7 @@ class test_MultiChannelPoller(Case): + @skip_if_not_module('redis') def setUp(self): self.Poller = redis.MultiChannelPoller @@ -1048,7 +1051,6 @@ p._channels.clear.assert_called_with() p._fd_to_chan.clear.assert_called_with() p._chan_to_sock.clear.assert_called_with() - self.assertIsNone(p.poller) def test_register_when_registered_reregisters(self): p = self.Poller() diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/kombu-3.0.16/kombu/tests/transport/virtual/test_base.py new/kombu-3.0.21/kombu/tests/transport/virtual/test_base.py --- old/kombu-3.0.16/kombu/tests/transport/virtual/test_base.py 2014-05-06 14:57:54.000000000 +0200 +++ new/kombu-3.0.21/kombu/tests/transport/virtual/test_base.py 2014-07-07 16:56:44.000000000 +0200 @@ -267,8 +267,8 @@ c.exchange_declare(n) c.queue_declare(n) c.queue_bind(n, n, n) - c.queue_bind(n, n, n) # tests code path that returns - # if queue already bound. + # tests code path that returns if queue already bound. + c.queue_bind(n, n, n) c.queue_delete(n, if_empty=True) self.assertIn(n, c.state.bindings) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/kombu-3.0.16/kombu/transport/amqplib.py new/kombu-3.0.21/kombu/transport/amqplib.py --- old/kombu-3.0.16/kombu/transport/amqplib.py 2014-05-06 14:57:54.000000000 +0200 +++ new/kombu-3.0.21/kombu/transport/amqplib.py 2014-07-07 16:56:44.000000000 +0200 @@ -17,11 +17,27 @@ pass from struct import unpack -from amqplib import client_0_8 as amqp -from amqplib.client_0_8 import transport -from amqplib.client_0_8.channel import Channel as _Channel -from amqplib.client_0_8.exceptions import AMQPConnectionException -from amqplib.client_0_8.exceptions import AMQPChannelException + +class NA(object): + pass + +try: + from amqplib import client_0_8 as amqp + from amqplib.client_0_8 import transport + from amqplib.client_0_8.channel import Channel as _Channel + from amqplib.client_0_8.exceptions import AMQPConnectionException + from amqplib.client_0_8.exceptions import AMQPChannelException +except ImportError: # pragma: no cover + + class NAx(object): + pass + amqp = NA + amqp.Connection = NA + transport = _Channel = NA # noqa + # Sphinx crashes if this is NA, must be different class + transport.TCPTransport = transport.SSLTransport = NAx + AMQPConnectionException = AMQPChannelException = NA # noqa + from kombu.five import items from kombu.utils.encoding import str_to_bytes @@ -321,6 +337,9 @@ self.client = client self.default_port = kwargs.get('default_port') or self.default_port + if amqp is NA: + raise ImportError('Missing amqplib library (pip install amqplib)') + def create_channel(self, connection): return connection.channel() diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/kombu-3.0.16/kombu/transport/beanstalk.py new/kombu-3.0.21/kombu/transport/beanstalk.py --- old/kombu-3.0.16/kombu/transport/beanstalk.py 2014-02-13 18:29:35.000000000 +0100 +++ new/kombu-3.0.21/kombu/transport/beanstalk.py 2014-07-07 16:56:44.000000000 +0200 @@ -10,7 +10,6 @@ """ from __future__ import absolute_import -import beanstalkc import socket from anyjson import loads, dumps @@ -20,6 +19,11 @@ from . import virtual +try: + import beanstalkc +except ImportError: # pragma: no cover + beanstalkc = None # noqa + DEFAULT_PORT = 11300 __author__ = 'David Ziegler <[email protected]>' @@ -127,16 +131,25 @@ default_port = DEFAULT_PORT connection_errors = ( virtual.Transport.connection_errors + ( - socket.error, beanstalkc.SocketError, IOError) + socket.error, IOError, + getattr(beanstalkc, 'SocketError', None), + ) ) channel_errors = ( virtual.Transport.channel_errors + ( socket.error, IOError, - beanstalkc.SocketError, - beanstalkc.BeanstalkcException) + getattr(beanstalkc, 'SocketError', None), + getattr(beanstalkc, 'BeanstalkcException', None), + ) ) driver_type = 'beanstalk' driver_name = 'beanstalkc' + def __init__(self, *args, **kwargs): + if beanstalkc is None: + raise ImportError( + 'Missing beanstalkc library (pip install beanstalkc)') + super(Transport, self).__init__(*args, **kwargs) + def driver_version(self): return beanstalkc.__version__ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/kombu-3.0.16/kombu/transport/couchdb.py new/kombu-3.0.21/kombu/transport/couchdb.py --- old/kombu-3.0.16/kombu/transport/couchdb.py 2014-02-13 18:29:35.000000000 +0100 +++ new/kombu-3.0.21/kombu/transport/couchdb.py 2014-07-07 16:56:44.000000000 +0200 @@ -11,7 +11,6 @@ from __future__ import absolute_import import socket -import couchdb from anyjson import loads, dumps @@ -21,6 +20,11 @@ from . import virtual +try: + import couchdb +except ImportError: # pragma: no cover + couchdb = None # noqa + DEFAULT_PORT = 5984 DEFAULT_DATABASE = 'kombu_default' @@ -80,7 +84,9 @@ port)) # Use username and password if avaliable try: - server.resource.credentials = (conninfo.userid, conninfo.password) + if conninfo.userid: + server.resource.credentials = (conninfo.userid, + conninfo.password) except AttributeError: pass try: @@ -110,20 +116,27 @@ connection_errors = ( virtual.Transport.connection_errors + ( socket.error, - couchdb.HTTPError, - couchdb.ServerError, - couchdb.Unauthorized) + getattr(couchdb, 'HTTPError', None), + getattr(couchdb, 'ServerError', None), + getattr(couchdb, 'Unauthorized', None), + ) ) channel_errors = ( virtual.Transport.channel_errors + ( - couchdb.HTTPError, - couchdb.ServerError, - couchdb.PreconditionFailed, - couchdb.ResourceConflict, - couchdb.ResourceNotFound) + getattr(couchdb, 'HTTPError', None), + getattr(couchdb, 'ServerError', None), + getattr(couchdb, 'PreconditionFailed', None), + getattr(couchdb, 'ResourceConflict', None), + getattr(couchdb, 'ResourceNotFound', None), + ) ) driver_type = 'couchdb' driver_name = 'couchdb' + def __init__(self, *args, **kwargs): + if couchdb is None: + raise ImportError('Missing couchdb library (pip install couchdb)') + super(Transport, self).__init__(*args, **kwargs) + def driver_version(self): return couchdb.__version__ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/kombu-3.0.16/kombu/transport/django/__init__.py new/kombu-3.0.21/kombu/transport/django/__init__.py --- old/kombu-3.0.16/kombu/transport/django/__init__.py 2014-02-13 18:29:35.000000000 +0100 +++ new/kombu-3.0.21/kombu/transport/django/__init__.py 2014-07-07 16:56:44.000000000 +0200 @@ -35,7 +35,6 @@ super(Channel, self).basic_consume(queue, *args, **kwargs) def _get(self, queue): - #self.refresh_connection() m = Queue.objects.fetch(queue) if m: return loads(bytes_to_str(m)) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/kombu-3.0.16/kombu/transport/mongodb.py new/kombu-3.0.21/kombu/transport/mongodb.py --- old/kombu-3.0.16/kombu/transport/mongodb.py 2014-05-06 14:57:54.000000000 +0200 +++ new/kombu-3.0.21/kombu/transport/mongodb.py 2014-07-07 17:08:40.000000000 +0200 @@ -87,6 +87,9 @@ self._broadcast_cursors = {} + # Evaluate connection + self._create_client() + def _new_queue(self, queue, **kwargs): pass @@ -207,7 +210,7 @@ self.get_broadcast().ensure_index([('queue', 1)]) self.get_routing().ensure_index([('queue', 1), ('exchange', 1)]) - #TODO Store a more complete exchange metatable in the routing collection + # TODO Store a more complete exchange metatable in the routing collection def get_table(self, exchange): """Get table of bindings for ``exchange``.""" localRoutes = frozenset(self.state.exchanges[exchange]['table']) @@ -250,12 +253,14 @@ self._fanout_queues.pop(queue) + def _create_client(self): + self._open() + self._ensure_indexes() + @property def client(self): if self._client is None: - self._open() - self._ensure_indexes() - + self._create_client() return self._client def get_messages(self): diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/kombu-3.0.16/kombu/transport/redis.py new/kombu-3.0.21/kombu/transport/redis.py --- old/kombu-3.0.16/kombu/transport/redis.py 2014-05-06 15:01:52.000000000 +0200 +++ new/kombu-3.0.21/kombu/transport/redis.py 2014-07-07 16:56:44.000000000 +0200 @@ -246,7 +246,6 @@ self._channels.clear() self._fd_to_chan.clear() self._chan_to_sock.clear() - self.poller = None def add(self, channel): self._channels.add(channel) @@ -475,6 +474,8 @@ crit('Could not restore message: %r', payload, exc_info=True) def _restore(self, message, leftmost=False): + if not self.ack_emulation: + return super(Channel, self)._restore(message) tag = message.delivery_tag with self.conn_or_acquire() as client: P, _ = client.pipeline() \ @@ -910,6 +911,8 @@ driver_name = 'redis' def __init__(self, *args, **kwargs): + if redis is None: + raise ImportError('Missing redis library (pip install redis)') super(Transport, self).__init__(*args, **kwargs) # Get redis-py exceptions. diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/kombu-3.0.16/kombu/transport/sqlalchemy/__init__.py new/kombu-3.0.21/kombu/transport/sqlalchemy/__init__.py --- old/kombu-3.0.16/kombu/transport/sqlalchemy/__init__.py 2014-02-13 18:29:35.000000000 +0100 +++ new/kombu-3.0.21/kombu/transport/sqlalchemy/__init__.py 2014-07-07 16:56:44.000000000 +0200 @@ -153,6 +153,7 @@ default_port = 0 driver_type = 'sql' driver_name = 'sqlalchemy' + connection_errors = (OperationalError, ) def driver_version(self): import sqlalchemy diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/kombu-3.0.16/kombu/transport/virtual/__init__.py new/kombu-3.0.21/kombu/transport/virtual/__init__.py --- old/kombu-3.0.16/kombu/transport/virtual/__init__.py 2014-05-06 14:57:54.000000000 +0200 +++ new/kombu-3.0.21/kombu/transport/virtual/__init__.py 2014-07-07 16:56:44.000000000 +0200 @@ -520,7 +520,7 @@ return self.typeof(exchange).deliver( message, exchange, routing_key, **kwargs ) - # anon exchange: routing_key is the destintaion queue + # anon exchange: routing_key is the destination queue return self._put(routing_key, message, **kwargs) def basic_consume(self, queue, no_ack, callback, consumer_tag, **kwargs): diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/kombu-3.0.16/kombu/utils/compat.py new/kombu-3.0.21/kombu/utils/compat.py --- old/kombu-3.0.16/kombu/utils/compat.py 2014-01-22 21:00:00.000000000 +0100 +++ new/kombu-3.0.21/kombu/utils/compat.py 2014-07-07 16:56:44.000000000 +0200 @@ -8,7 +8,7 @@ from __future__ import absolute_import -############## timedelta_seconds() -> delta.total_seconds #################### +# ############# timedelta_seconds() -> delta.total_seconds ################### from datetime import timedelta HAVE_TIMEDELTA_TOTAL_SECONDS = hasattr(timedelta, 'total_seconds') @@ -36,7 +36,7 @@ return 0 return delta.days * 86400 + delta.seconds + (delta.microseconds / 10e5) -############## socket.error.errno ############################################ +# ############# socket.error.errno ########################################### def get_errno(exc): @@ -53,7 +53,7 @@ pass return 0 -############## collections.OrderedDict ####################################### +# ############# collections.OrderedDict ###################################### try: from collections import OrderedDict except ImportError: diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/kombu-3.0.16/kombu/utils/limits.py new/kombu-3.0.21/kombu/utils/limits.py --- old/kombu-3.0.16/kombu/utils/limits.py 2014-01-22 21:00:00.000000000 +0100 +++ new/kombu-3.0.21/kombu/utils/limits.py 2014-07-04 18:46:19.000000000 +0200 @@ -25,10 +25,10 @@ """ - #: The rate in tokens/second that the bucket will be refilled + #: The rate in tokens/second that the bucket will be refilled. fill_rate = None - #: Maximum number of tokensin the bucket. + #: Maximum number of tokens in the bucket. capacity = 1 #: Timestamp of the last time a token was taken out of the bucket. diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/kombu-3.0.16/kombu/utils/url.py new/kombu-3.0.21/kombu/utils/url.py --- old/kombu-3.0.16/kombu/utils/url.py 2014-01-22 21:00:00.000000000 +0100 +++ new/kombu-3.0.21/kombu/utils/url.py 2014-07-07 16:56:44.000000000 +0200 @@ -1,12 +1,17 @@ from __future__ import absolute_import +from functools import partial + try: - from urllib.parse import unquote, urlparse, parse_qsl + from urllib.parse import parse_qsl, quote, unquote, urlparse except ImportError: - from urllib import unquote # noqa + from urllib import quote, unquote # noqa from urlparse import urlparse, parse_qsl # noqa from . import kwdict +from kombu.five import string_t + +safequote = partial(quote, safe='') def _parse_url(url): @@ -14,17 +19,9 @@ schemeless = url[len(scheme) + 3:] # parse with HTTP URL semantics parts = urlparse('http://' + schemeless) - - # The first pymongo.Connection() argument (host) can be - # a mongodb connection URI. If this is the case, don't - # use port but let pymongo get the port(s) from the URI instead. - # This enables the use of replica sets and sharding. - # See pymongo.Connection() for more info. - port = scheme != 'mongodb' and parts.port or None - hostname = schemeless if scheme == 'mongodb' else parts.hostname path = parts.path or '' path = path[1:] if path and path[0] == '/' else path - return (scheme, unquote(hostname or '') or None, port, + return (scheme, unquote(parts.hostname or '') or None, parts.port, unquote(parts.username or '') or None, unquote(parts.password or '') or None, unquote(path or '') or None, @@ -36,3 +33,32 @@ return dict(transport=scheme, hostname=host, port=port, userid=user, password=password, virtual_host=path, **query) + + +def as_url(scheme, host=None, port=None, user=None, password=None, + path=None, query=None, sanitize=False, mask='**'): + parts = ['{0}://'.format(scheme)] + if user or password: + if user: + parts.append(safequote(user)) + if password: + if sanitize: + parts.extend([':', mask] if mask else [':']) + else: + parts.extend([':', safequote(password)]) + parts.append('@') + parts.append(safequote(host) if host else '') + if port: + parts.extend([':', port]) + parts.extend(['/', path]) + return ''.join(str(part) for part in parts if part) + + +def sanitize_url(url, mask='**'): + return as_url(*_parse_url(url), sanitize=True, mask=mask) + + +def maybe_sanitize_url(url, mask='**'): + if isinstance(url, string_t) and '://' in url: + return sanitize_url(url, mask) + return url diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/kombu-3.0.16/kombu.egg-info/PKG-INFO new/kombu-3.0.21/kombu.egg-info/PKG-INFO --- old/kombu-3.0.16/kombu.egg-info/PKG-INFO 2014-05-06 15:37:40.000000000 +0200 +++ new/kombu-3.0.21/kombu.egg-info/PKG-INFO 2014-07-07 17:12:49.000000000 +0200 @@ -1,6 +1,6 @@ Metadata-Version: 1.1 Name: kombu -Version: 3.0.16 +Version: 3.0.21 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.16 + :Version: 3.0.21 `Kombu` is a messaging library for Python. diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/kombu-3.0.16/kombu.egg-info/requires.txt new/kombu-3.0.21/kombu.egg-info/requires.txt --- old/kombu-3.0.16/kombu.egg-info/requires.txt 2014-05-06 15:37:40.000000000 +0200 +++ new/kombu-3.0.21/kombu.egg-info/requires.txt 2014-07-07 17:12:49.000000000 +0200 @@ -5,7 +5,7 @@ sqlalchemy [librabbitmq] -librabbitmq>=1.5.1 +librabbitmq>=1.5.2 [sqs] boto>=2.13.3 @@ -31,6 +31,10 @@ [redis] redis>=2.8.0 +[:python_version=="2.6"] +importlib +ordereddict + [pyro] pyro4 diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/kombu-3.0.16/requirements/extras/librabbitmq.txt new/kombu-3.0.21/requirements/extras/librabbitmq.txt --- old/kombu-3.0.16/requirements/extras/librabbitmq.txt 2014-05-06 15:02:35.000000000 +0200 +++ new/kombu-3.0.21/requirements/extras/librabbitmq.txt 2014-06-11 15:50:44.000000000 +0200 @@ -1 +1 @@ -librabbitmq>=1.5.1 +librabbitmq>=1.5.2 diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/kombu-3.0.16/setup.cfg new/kombu-3.0.21/setup.cfg --- old/kombu-3.0.16/setup.cfg 2014-05-06 15:37:46.000000000 +0200 +++ new/kombu-3.0.21/setup.cfg 2014-07-07 17:12:53.000000000 +0200 @@ -17,6 +17,16 @@ importlib ordereddict +[wheel] +universal = 1 + +[metadata] +requires-dist = + anyjson >= 0.3.3 + amqp >= 1.4.5,<2.0 + importlib; python_version == "2.6" + ordereddict; python_version == "2.6" + [egg_info] tag_build = tag_date = 0 diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/kombu-3.0.16/setup.py new/kombu-3.0.21/setup.py --- old/kombu-3.0.16/setup.py 2014-04-23 18:45:15.000000000 +0200 +++ new/kombu-3.0.21/setup.py 2014-07-07 16:56:44.000000000 +0200 @@ -137,6 +137,8 @@ 'slmq': extras('slmq.txt'), } +extras_require[':python_version=="2.6"'] = reqs('py26.txt') + setup( name='kombu', version=meta['VERSION'], -- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
