mirror of https://github.com/celery/kombu.git
Install librabbitmq if supported, and amqp points to lrmq if installed
This commit is contained in:
parent
60d8ac1fbc
commit
4300eff0e9
|
@ -12,7 +12,14 @@ from __future__ import absolute_import
|
|||
|
||||
import sys
|
||||
|
||||
DEFAULT_TRANSPORT = "kombu.transport.amqplib.Transport"
|
||||
DEFAULT_TRANSPORT = "amqp"
|
||||
|
||||
try:
|
||||
import librabbitmq # noqa
|
||||
except ImportError:
|
||||
AMQP_TRANSPORT = "kombu.transport.amqplib.Transport"
|
||||
else:
|
||||
AMQP_TRANSPORT = "kombu.transport.librabbitmq.Transport"
|
||||
|
||||
|
||||
def _ghettoq(name, new, alias=None):
|
||||
|
@ -36,7 +43,7 @@ def _ghettoq(name, new, alias=None):
|
|||
|
||||
|
||||
TRANSPORT_ALIASES = {
|
||||
"amqp": "kombu.transport.amqplib.Transport",
|
||||
"amqp": AMQP_TRANSPORT,
|
||||
"amqplib": "kombu.transport.amqplib.Transport",
|
||||
"librabbitmq": "kombu.transport.librabbitmq.Transport",
|
||||
"pika": "kombu.transport.pika2.Transport",
|
||||
|
|
|
@ -1,2 +1,2 @@
|
|||
anyjson>=0.3.1
|
||||
amqplib>=1.0
|
||||
librabbitmq>=0.9.3
|
||||
|
|
16
setup.py
16
setup.py
|
@ -100,6 +100,17 @@ if os.path.exists("README.rst"):
|
|||
else:
|
||||
long_description = "See http://pypi.python.org/pypi/kombu"
|
||||
|
||||
install_requires = ["anyjson>=0.3.1"]
|
||||
|
||||
is_jython = sys.platform.startswith("java")
|
||||
is_pypy = hasattr(sys, "pypy_version_info")
|
||||
is_py3k = sys.version_info[0] == 3
|
||||
is_win = platform.system() == "Windows"
|
||||
if is_jython or is_pypy or is_py3k or is_win:
|
||||
install_requires.append("amqplib>=1.0.1")
|
||||
else:
|
||||
install_requires.append("librabbitmq>=0.9.3")
|
||||
|
||||
setup(
|
||||
name='kombu',
|
||||
version=meta["VERSION"],
|
||||
|
@ -112,10 +123,7 @@ setup(
|
|||
data_files=data_files,
|
||||
zip_safe=False,
|
||||
test_suite="nose.collector",
|
||||
install_requires=[
|
||||
'anyjson>=0.3.1',
|
||||
'amqplib>=1.0',
|
||||
],
|
||||
install_requires=install_requires,
|
||||
tests_require=tests_require,
|
||||
classifiers=[
|
||||
"Development Status :: 5 - Production/Stable",
|
||||
|
|
Loading…
Reference in New Issue