[Python-modules-commits] [kombu] 01/06: Import kombu_3.0.35.orig.tar.gz
Brian May
bam at moszumanska.debian.org
Wed Apr 6 03:27:54 UTC 2016
This is an automated email from the git hooks/post-receive script.
bam pushed a commit to branch master
in repository kombu.
commit 4bb347eb24c6e85f9e055fb545c1387f8a296577
Author: Brian May <bam at debian.org>
Date: Wed Apr 6 13:07:10 2016 +1000
Import kombu_3.0.35.orig.tar.gz
---
Changelog | 43 ++-
LICENSE | 5 +-
PKG-INFO | 4 +-
README.rst | 2 +-
docs/changelog.rst | 43 ++-
docs/conf.py | 33 +-
docs/introduction.rst | 2 +-
extra/requirements/default.txt | 2 +
extra/requirements/dev.txt | 1 +
{requirements => extra/requirements}/docs.txt | 1 +
extra/requirements/extras/beanstalk.txt | 1 +
extra/requirements/extras/couchdb.txt | 1 +
extra/requirements/extras/kazoo.txt | 1 +
extra/requirements/extras/librabbitmq.txt | 1 +
extra/requirements/extras/mongodb.txt | 1 +
extra/requirements/extras/msgpack.txt | 1 +
extra/requirements/extras/pyro.txt | 1 +
extra/requirements/extras/qpid.txt | 2 +
extra/requirements/extras/redis.txt | 1 +
extra/requirements/extras/slmq.txt | 1 +
extra/requirements/extras/sqlalchemy.txt | 1 +
extra/requirements/extras/sqs.txt | 1 +
extra/requirements/extras/yaml.txt | 1 +
extra/requirements/extras/zeromq.txt | 1 +
extra/requirements/extras/zookeeper.txt | 1 +
extra/requirements/funtest.txt | 28 ++
extra/requirements/pkgutils.txt | 3 +
extra/requirements/py26.txt | 2 +
.../test-ci3.txt => extra/requirements/test-ci.txt | 2 +-
{requirements => extra/requirements}/test-ci3.txt | 1 -
extra/requirements/test.txt | 3 +
extra/requirements/test3.txt | 3 +
kombu.egg-info/PKG-INFO | 4 +-
kombu.egg-info/SOURCES.txt | 25 ++
kombu.egg-info/requires.txt | 48 +--
kombu/__init__.py | 2 +-
kombu/connection.py | 7 +-
kombu/serialization.py | 40 +--
kombu/tests/test_connection.py | 7 +-
kombu/tests/test_serialization.py | 5 +-
kombu/tests/transport/test_SQS.py | 22 +-
kombu/tests/transport/test_qpid.py | 45 ++-
kombu/transport/qpid.py | 346 ++++++++++++---------
kombu/transport/redis.py | 33 +-
requirements/docs.txt | 1 +
requirements/extras/msgpack.txt | 2 +-
requirements/test-ci3.txt | 1 -
setup.cfg | 4 +-
48 files changed, 535 insertions(+), 251 deletions(-)
diff --git a/Changelog b/Changelog
index 637c612..7836b3d 100644
--- a/Changelog
+++ b/Changelog
@@ -4,6 +4,46 @@
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
+======
+:release-date: 2016-03-03 05:30 P.M PST
+:release-by: Ask Solem
+
+- Qpid: Adds async error handling.
+
+ Contributed by Brian Bouterse.
+
+- Qpid: Delivery tag is now a UUID4 (Issue #563).
+
+ Fix contributed by Brian Bouterse.
+
+- Redis: Connection.as_uri() returned malformed URLs when the
+ ``redis+socket`` scheme was ised (Issue celery/celery#2995).
+
+- msgpack: Use binary encoding instead of utf-8 (Issue #570).
+
.. _version-3.0.33:
3.0.33
@@ -215,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 --git a/LICENSE b/LICENSE
index adf2437..47622b0 100644
--- a/LICENSE
+++ b/LICENSE
@@ -1,7 +1,6 @@
-Copyright (c) 2015 Ask Solem & contributors. All rights reserved.
+Copyright (c) 2015-2016 Ask Solem & contributors. All rights reserved.
Copyright (c) 2012-2014 GoPivotal, Inc. All rights reserved.
-Copyright (c) 2009-2012, Ask Solem & contributors.
-All rights reserved.
+Copyright (c) 2009-2012, Ask Solem & contributors. All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:
diff --git a/PKG-INFO b/PKG-INFO
index 0963536..f049842 100644
--- a/PKG-INFO
+++ b/PKG-INFO
@@ -1,6 +1,6 @@
Metadata-Version: 1.1
Name: kombu
-Version: 3.0.33
+Version: 3.0.35
Summary: Messaging library for Python
Home-page: http://kombu.readthedocs.org
Author: Ask Solem
@@ -12,7 +12,7 @@ Description: .. _kombu-index:
kombu - Messaging library for Python
========================================
- :Version: 3.0.33
+ :Version: 3.0.35
`Kombu` is a messaging library for Python.
diff --git a/README.rst b/README.rst
index 891984b..6fed73a 100644
--- a/README.rst
+++ b/README.rst
@@ -4,7 +4,7 @@
kombu - Messaging library for Python
========================================
-:Version: 3.0.33
+:Version: 3.0.35
`Kombu` is a messaging library for Python.
diff --git a/docs/changelog.rst b/docs/changelog.rst
index 637c612..7836b3d 100644
--- a/docs/changelog.rst
+++ b/docs/changelog.rst
@@ -4,6 +4,46 @@
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
+======
+:release-date: 2016-03-03 05:30 P.M PST
+:release-by: Ask Solem
+
+- Qpid: Adds async error handling.
+
+ Contributed by Brian Bouterse.
+
+- Qpid: Delivery tag is now a UUID4 (Issue #563).
+
+ Fix contributed by Brian Bouterse.
+
+- Redis: Connection.as_uri() returned malformed URLs when the
+ ``redis+socket`` scheme was ised (Issue celery/celery#2995).
+
+- msgpack: Use binary encoding instead of utf-8 (Issue #570).
+
.. _version-3.0.33:
3.0.33
@@ -215,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 --git a/docs/conf.py b/docs/conf.py
index 7904861..c753e21 100644
--- a/docs/conf.py
+++ b/docs/conf.py
@@ -12,11 +12,23 @@ import kombu # noqa
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']
@@ -29,7 +41,24 @@ master_doc = 'index'
# General information about the project.
project = 'Kombu'
-copyright = '2009-2014, Ask Solem'
+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
diff --git a/docs/introduction.rst b/docs/introduction.rst
index 891984b..6fed73a 100644
--- a/docs/introduction.rst
+++ b/docs/introduction.rst
@@ -4,7 +4,7 @@
kombu - Messaging library for Python
========================================
-:Version: 3.0.33
+:Version: 3.0.35
`Kombu` is a messaging library for Python.
diff --git a/extra/requirements/default.txt b/extra/requirements/default.txt
new file mode 100644
index 0000000..13bd65e
--- /dev/null
+++ b/extra/requirements/default.txt
@@ -0,0 +1,2 @@
+anyjson>=0.3.3
+amqp>=1.4.9,<2.0
diff --git a/extra/requirements/dev.txt b/extra/requirements/dev.txt
new file mode 100644
index 0000000..0ca0ffd
--- /dev/null
+++ b/extra/requirements/dev.txt
@@ -0,0 +1 @@
+https://github.com/celery/py-amqp/zipball/master
diff --git a/requirements/docs.txt b/extra/requirements/docs.txt
similarity index 67%
copy from requirements/docs.txt
copy to extra/requirements/docs.txt
index dcf9838..1106fab 100644
--- a/requirements/docs.txt
+++ b/extra/requirements/docs.txt
@@ -1,3 +1,4 @@
Sphinx
sphinxcontrib-issuetracker>=0.9
Django
+-r extras/mongodb.txt
diff --git a/extra/requirements/extras/beanstalk.txt b/extra/requirements/extras/beanstalk.txt
new file mode 100644
index 0000000..c62c81b
--- /dev/null
+++ b/extra/requirements/extras/beanstalk.txt
@@ -0,0 +1 @@
+beanstalkc
diff --git a/extra/requirements/extras/couchdb.txt b/extra/requirements/extras/couchdb.txt
new file mode 100644
index 0000000..3e100d4
--- /dev/null
+++ b/extra/requirements/extras/couchdb.txt
@@ -0,0 +1 @@
+couchdb
diff --git a/extra/requirements/extras/kazoo.txt b/extra/requirements/extras/kazoo.txt
new file mode 100644
index 0000000..8b13789
--- /dev/null
+++ b/extra/requirements/extras/kazoo.txt
@@ -0,0 +1 @@
+
diff --git a/extra/requirements/extras/librabbitmq.txt b/extra/requirements/extras/librabbitmq.txt
new file mode 100644
index 0000000..ffc97a0
--- /dev/null
+++ b/extra/requirements/extras/librabbitmq.txt
@@ -0,0 +1 @@
+librabbitmq>=1.6.1
diff --git a/extra/requirements/extras/mongodb.txt b/extra/requirements/extras/mongodb.txt
new file mode 100644
index 0000000..19e59fe
--- /dev/null
+++ b/extra/requirements/extras/mongodb.txt
@@ -0,0 +1 @@
+pymongo>=2.6.2
diff --git a/extra/requirements/extras/msgpack.txt b/extra/requirements/extras/msgpack.txt
new file mode 100644
index 0000000..e434150
--- /dev/null
+++ b/extra/requirements/extras/msgpack.txt
@@ -0,0 +1 @@
+msgpack-python>=0.4.7
diff --git a/extra/requirements/extras/pyro.txt b/extra/requirements/extras/pyro.txt
new file mode 100644
index 0000000..d19b0db
--- /dev/null
+++ b/extra/requirements/extras/pyro.txt
@@ -0,0 +1 @@
+pyro4
diff --git a/extra/requirements/extras/qpid.txt b/extra/requirements/extras/qpid.txt
new file mode 100644
index 0000000..61b8c8c
--- /dev/null
+++ b/extra/requirements/extras/qpid.txt
@@ -0,0 +1,2 @@
+qpid-python>=0.26
+qpid-tools>=0.26
diff --git a/extra/requirements/extras/redis.txt b/extra/requirements/extras/redis.txt
new file mode 100644
index 0000000..009cbe7
--- /dev/null
+++ b/extra/requirements/extras/redis.txt
@@ -0,0 +1 @@
+redis>=2.10.3
diff --git a/extra/requirements/extras/slmq.txt b/extra/requirements/extras/slmq.txt
new file mode 100644
index 0000000..2f06ed2
--- /dev/null
+++ b/extra/requirements/extras/slmq.txt
@@ -0,0 +1 @@
+softlayer_messaging>=1.0.3
diff --git a/extra/requirements/extras/sqlalchemy.txt b/extra/requirements/extras/sqlalchemy.txt
new file mode 100644
index 0000000..39fb2be
--- /dev/null
+++ b/extra/requirements/extras/sqlalchemy.txt
@@ -0,0 +1 @@
+sqlalchemy
diff --git a/extra/requirements/extras/sqs.txt b/extra/requirements/extras/sqs.txt
new file mode 100644
index 0000000..66b9583
--- /dev/null
+++ b/extra/requirements/extras/sqs.txt
@@ -0,0 +1 @@
+boto>=2.13.3
diff --git a/extra/requirements/extras/yaml.txt b/extra/requirements/extras/yaml.txt
new file mode 100644
index 0000000..17bf7fd
--- /dev/null
+++ b/extra/requirements/extras/yaml.txt
@@ -0,0 +1 @@
+PyYAML>=3.10
diff --git a/extra/requirements/extras/zeromq.txt b/extra/requirements/extras/zeromq.txt
new file mode 100644
index 0000000..d34ee10
--- /dev/null
+++ b/extra/requirements/extras/zeromq.txt
@@ -0,0 +1 @@
+pyzmq>=13.1.0
diff --git a/extra/requirements/extras/zookeeper.txt b/extra/requirements/extras/zookeeper.txt
new file mode 100644
index 0000000..81893ea
--- /dev/null
+++ b/extra/requirements/extras/zookeeper.txt
@@ -0,0 +1 @@
+kazoo>=1.3.1
diff --git a/extra/requirements/funtest.txt b/extra/requirements/funtest.txt
new file mode 100644
index 0000000..06cf309
--- /dev/null
+++ b/extra/requirements/funtest.txt
@@ -0,0 +1,28 @@
+# redis transport
+redis
+
+# MongoDB transport
+pymongo
+
+# CouchDB transport
+couchdb
+
+# Beanstalk transport
+beanstalkc
+
+# Zookeeper transport
+kazoo
+
+# SQLAlchemy transport
+kombu-sqlalchemy
+
+# Django ORM transport
+Django
+django-kombu
+
+# SQS transport
+boto
+
+# Qpid transport
+qpid-python>=0.26
+qpid-tools>=0.26
diff --git a/extra/requirements/pkgutils.txt b/extra/requirements/pkgutils.txt
new file mode 100644
index 0000000..5da811f
--- /dev/null
+++ b/extra/requirements/pkgutils.txt
@@ -0,0 +1,3 @@
+paver
+flake8
+Sphinx
diff --git a/extra/requirements/py26.txt b/extra/requirements/py26.txt
new file mode 100644
index 0000000..1807d7c
--- /dev/null
+++ b/extra/requirements/py26.txt
@@ -0,0 +1,2 @@
+importlib
+ordereddict
diff --git a/requirements/test-ci3.txt b/extra/requirements/test-ci.txt
similarity index 100%
copy from requirements/test-ci3.txt
copy to extra/requirements/test-ci.txt
index 3d5ce77..1962309 100644
--- a/requirements/test-ci3.txt
+++ b/extra/requirements/test-ci.txt
@@ -1,6 +1,6 @@
+boto
coverage>=3.0
coveralls
redis
PyYAML
msgpack-python>0.2.0 # 0.2.0 dropped 2.5 support
-boto
diff --git a/requirements/test-ci3.txt b/extra/requirements/test-ci3.txt
similarity index 94%
copy from requirements/test-ci3.txt
copy to extra/requirements/test-ci3.txt
index 3d5ce77..c5617bb 100644
--- a/requirements/test-ci3.txt
+++ b/extra/requirements/test-ci3.txt
@@ -3,4 +3,3 @@ coveralls
redis
PyYAML
msgpack-python>0.2.0 # 0.2.0 dropped 2.5 support
-boto
diff --git a/extra/requirements/test.txt b/extra/requirements/test.txt
new file mode 100644
index 0000000..f9bd644
--- /dev/null
+++ b/extra/requirements/test.txt
@@ -0,0 +1,3 @@
+nose
+unittest2>=0.5.0
+mock
diff --git a/extra/requirements/test3.txt b/extra/requirements/test3.txt
new file mode 100644
index 0000000..fdf7c43
--- /dev/null
+++ b/extra/requirements/test3.txt
@@ -0,0 +1,3 @@
+setuptools>=0.7
+nose
+mock>=0.7.0
diff --git a/kombu.egg-info/PKG-INFO b/kombu.egg-info/PKG-INFO
index 0963536..f049842 100644
--- a/kombu.egg-info/PKG-INFO
+++ b/kombu.egg-info/PKG-INFO
@@ -1,6 +1,6 @@
Metadata-Version: 1.1
Name: kombu
-Version: 3.0.33
+Version: 3.0.35
Summary: Messaging library for Python
Home-page: http://kombu.readthedocs.org
Author: Ask Solem
@@ -12,7 +12,7 @@ Description: .. _kombu-index:
kombu - Messaging library for Python
========================================
- :Version: 3.0.33
+ :Version: 3.0.35
`Kombu` is a messaging library for Python.
diff --git a/kombu.egg-info/SOURCES.txt b/kombu.egg-info/SOURCES.txt
index aed5208..ba68988 100644
--- a/kombu.egg-info/SOURCES.txt
+++ b/kombu.egg-info/SOURCES.txt
@@ -114,6 +114,31 @@ extra/release/doc4allmods
extra/release/flakeplus.py
extra/release/removepyc.sh
extra/release/verify-reference-index.sh
+extra/requirements/default.txt
+extra/requirements/dev.txt
+extra/requirements/docs.txt
+extra/requirements/funtest.txt
+extra/requirements/pkgutils.txt
+extra/requirements/py26.txt
+extra/requirements/test-ci.txt
+extra/requirements/test-ci3.txt
+extra/requirements/test.txt
+extra/requirements/test3.txt
+extra/requirements/extras/beanstalk.txt
+extra/requirements/extras/couchdb.txt
+extra/requirements/extras/kazoo.txt
+extra/requirements/extras/librabbitmq.txt
+extra/requirements/extras/mongodb.txt
+extra/requirements/extras/msgpack.txt
+extra/requirements/extras/pyro.txt
+extra/requirements/extras/qpid.txt
+extra/requirements/extras/redis.txt
+extra/requirements/extras/slmq.txt
+extra/requirements/extras/sqlalchemy.txt
+extra/requirements/extras/sqs.txt
+extra/requirements/extras/yaml.txt
+extra/requirements/extras/zeromq.txt
+extra/requirements/extras/zookeeper.txt
funtests/__init__.py
funtests/setup.cfg
funtests/setup.py
diff --git a/kombu.egg-info/requires.txt b/kombu.egg-info/requires.txt
index a51256f..ca97392 100644
--- a/kombu.egg-info/requires.txt
+++ b/kombu.egg-info/requires.txt
@@ -1,49 +1,49 @@
anyjson>=0.3.3
amqp>=1.4.9,<2.0
-[sqlalchemy]
-sqlalchemy
+[:python_version=="2.6"]
+importlib
+ordereddict
+
+[beanstalk]
+beanstalkc
+
+[couchdb]
+couchdb
[librabbitmq]
librabbitmq>=1.6.1
-[sqs]
-boto>=2.13.3
-
[mongodb]
pymongo>=2.6.2
-[zookeeper]
-kazoo>=1.3.1
-
-[beanstalk]
-beanstalkc
+[msgpack]
+msgpack-python>=0.4.7
-[slmq]
-softlayer_messaging>=1.0.3
+[pyro]
+pyro4
[qpid]
qpid-python>=0.26
qpid-tools>=0.26
-[msgpack]
-msgpack-python>=0.3.0
-
-[couchdb]
-couchdb
-
[redis]
redis>=2.10.3
-[:python_version=="2.6"]
-importlib
-ordereddict
+[slmq]
+softlayer_messaging>=1.0.3
-[pyro]
-pyro4
+[sqlalchemy]
+sqlalchemy
+
+[sqs]
+boto>=2.13.3
[yaml]
PyYAML>=3.10
[zeromq]
-pyzmq>=13.1.0
\ No newline at end of file
+pyzmq>=13.1.0
+
+[zookeeper]
+kazoo>=1.3.1
diff --git a/kombu/__init__.py b/kombu/__init__.py
index 42a8590..71d613f 100644
--- a/kombu/__init__.py
+++ b/kombu/__init__.py
@@ -11,7 +11,7 @@ version_info_t = namedtuple(
'version_info_t', ('major', 'minor', 'micro', 'releaselevel', 'serial'),
)
-VERSION = version_info_t(3, 0, 33, '', '')
+VERSION = version_info_t(3, 0, 35, '', '')
__version__ = '{0.major}.{0.minor}.{0.micro}{0.releaselevel}'.format(VERSION)
__author__ = 'Ask Solem'
__contact__ = 'ask at celeryproject.org'
diff --git a/kombu/connection.py b/kombu/connection.py
index 629411b..6cb9520 100644
--- a/kombu/connection.py
+++ b/kombu/connection.py
@@ -574,12 +574,13 @@ class Connection(object):
if self.uri_prefix:
return '%s+%s' % (self.uri_prefix, hostname)
return self.hostname
+ if self.uri_prefix:
+ return '%s+%s' % (self.uri_prefix, hostname)
fields = self.info()
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),
+ transport, hostname, port, userid, password, quote(vhost),
sanitize=not include_password, mask=mask,
)
diff --git a/kombu/serialization.py b/kombu/serialization.py
index 85376e7..77f0be1 100644
--- a/kombu/serialization.py
+++ b/kombu/serialization.py
@@ -362,29 +362,33 @@ def register_pickle():
def register_msgpack():
"""See http://msgpack.sourceforge.net/"""
+ pack = unpack = None
try:
- try:
- from msgpack import packb as pack, unpackb
-
- def unpack(s, encoding='utf-8'):
- return unpackb(s, encoding=encoding)
- 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 --git a/kombu/tests/test_connection.py b/kombu/tests/test_connection.py
index fbe4711..3c6954c 100644
--- a/kombu/tests/test_connection.py
+++ b/kombu/tests/test_connection.py
@@ -41,9 +41,10 @@ class test_connection_utils(Case):
self.assertEqual(conn.as_uri(include_password=True), self.url)
def test_as_uri_when_prefix(self):
- conn = Connection('memory://')
- conn.uri_prefix = 'foo'
- self.assertTrue(conn.as_uri().startswith('foo+memory://'))
+ conn = Connection('redis+socket:///var/spool/x/y/z/redis.sock')
+ self.assertEqual(
+ conn.as_uri(), 'redis+socket:///var/spool/x/y/z/redis.sock',
+ )
@skip_if_not_module('pymongo')
def test_as_uri_when_mongodb(self):
diff --git a/kombu/tests/test_serialization.py b/kombu/tests/test_serialization.py
index 2312071..142058f 100644
--- a/kombu/tests/test_serialization.py
+++ b/kombu/tests/test_serialization.py
@@ -1,7 +1,6 @@
#!/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
@@ -60,8 +59,8 @@ unicode: "Th\\xE9 quick brown fox jumps over th\\xE9 lazy dog"
msgpack_py_data = dict(py_data)
-# Unicode chars are lost in transmit :(
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\
W5n2gArVGhlIHF1aWNrIGJyb3duIGZveCBqdW1wcyBvdmVyIHRoZSBsYXp5IGRvZ6d1bmljb2Rl2g\
diff --git a/kombu/tests/transport/test_SQS.py b/kombu/tests/transport/test_SQS.py
index 0a33fb5..117135c 100644
--- a/kombu/tests/transport/test_SQS.py
+++ b/kombu/tests/transport/test_SQS.py
@@ -7,19 +7,25 @@ slightly.
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 @@ class test_Channel(Case):
# 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 --git a/kombu/tests/transport/test_qpid.py b/kombu/tests/transport/test_qpid.py
index 4131193..4340443 100644
--- a/kombu/tests/transport/test_qpid.py
+++ b/kombu/tests/transport/test_qpid.py
@@ -5,6 +5,7 @@ import ssl
import socket
import sys
import time
+import uuid
from collections import Callable
from itertools import count
@@ -940,10 +941,6 @@ class TestChannel(ExtraAssertionsMixin, Case):
self.assertIn('base64', Channel.codecs)
self.assertIsInstance(Channel.codecs['base64'], Base64)
- def test_delivery_tags(self):
- """Test that _delivery_tags is using itertools"""
- self.assertIsInstance(Channel._delivery_tags, count)
-
def test_size(self):
"""Test getting the number of messages in a queue specified by
name and returning them."""
@@ -1321,7 +1318,7 @@ class TestChannel(ExtraAssertionsMixin, Case):
mock_message['properties']['body_encoding'], mock_body_encoding,
)
self.assertIsInstance(
- mock_message['properties']['delivery_tag'], int,
+ mock_message['properties']['delivery_tag'], uuid.UUID,
)
self.assertIs(
mock_message['properties']['delivery_info']['exchange'],
@@ -1709,13 +1706,29 @@ class TestTransportEstablishConnection(Case):
transport='tcp',
)
- def test_transport_sets_qpid_message_received_handler(self):
+ def test_transport_sets_qpid_message_ready_handler(self):
self.transport.establish_connection()
- qpid_conn = self.mock_conn.return_value.get_qpid_connection
- new_mock_session = qpid_conn.return_value.session.return_value
- mock_set_callback = new_mock_session.set_message_received_handler
- expected_callback = self.transport._qpid_session_ready
- mock_set_callback.assert_called_once_with(expected_callback)
+ qpid_conn_call = self.mock_conn.return_value.get_qpid_connection
+ mock_session = qpid_conn_call.return_value.session.return_value
+ mock_set_callback = mock_session.set_message_received_notify_handler
+ expected_msg_callback = self.transport._qpid_message_ready_handler
+ mock_set_callback.assert_called_once_with(expected_msg_callback)
+
+ def test_transport_sets_session_exception_handler(self):
+ self.transport.establish_connection()
+ qpid_conn_call = self.mock_conn.return_value.get_qpid_connection
+ mock_session = qpid_conn_call.return_value.session.return_value
+ mock_set_callback = mock_session.set_async_exception_notify_handler
+ exc_callback = self.transport._qpid_async_exception_notify_handler
+ mock_set_callback.assert_called_once_with(exc_callback)
+
+ def test_transport_sets_connection_exception_handler(self):
+ self.transport.establish_connection()
+ qpid_conn_call = self.mock_conn.return_value.get_qpid_connection
+ qpid_conn = qpid_conn_call.return_value
+ mock_set_callback = qpid_conn.set_async_exception_notify_handler
+ exc_callback = self.transport._qpid_async_exception_notify_handler
+ mock_set_callback.assert_called_once_with(exc_callback)
@case_no_python3
@@ -1769,7 +1782,7 @@ class TestTransportRegisterWithEventLoop(Case):
@case_no_python3
@case_no_pypy
@disable_runtime_dependency_check
-class TestTransportQpidSessionReady(Case):
+class TestTransportQpidCallbackHandlers(Case):
def setUp(self):
self.patch_a = patch(QPID_MODULE + '.os.write')
@@ -1779,10 +1792,14 @@ class TestTransportQpidSessionReady(Case):
def tearDown(self):
self.patch_a.stop()
- def test_transport__qpid_session_ready_writes_symbol_to_fd(self):
- self.transport._qpid_session_ready()
+ def test__qpid_message_ready_handler_writes_symbol_to_fd(self):
+ self.transport._qpid_message_ready_handler(Mock())
self.mock_os_write.assert_called_once_with(self.transport._w, '0')
+ def test__qpid_async_exception_notify_handler_writes_symbol_to_fd(self):
+ self.transport._qpid_async_exception_notify_handler(Mock(), Mock())
+ self.mock_os_write.assert_called_once_with(self.transport._w, 'e')
+
@case_no_python3
@case_no_pypy
diff --git a/kombu/transport/qpid.py b/kombu/transport/qpid.py
index 639d837..9b21737 100644
--- a/kombu/transport/qpid.py
+++ b/kombu/transport/qpid.py
@@ -5,15 +5,19 @@ kombu.transport.qpid
`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 @@ command:
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 @@ The :attr:`~kombu.Connection.transport_options` argument to the
: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.
"""
@@ -79,8 +87,8 @@ import socket
import ssl
import sys
import time
+import uuid
-from itertools import count
from gettext import gettext as _
import amqp.protocol
@@ -147,19 +155,24 @@ class AuthenticationFailure(Exception):
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
... 922 lines suppressed ...
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/python-modules/packages/kombu.git
More information about the Python-modules-commits
mailing list