Commit 53047e39 authored by Brian May's avatar Brian May

New upstream version 4.0.2

parent 67532777
......@@ -11,7 +11,7 @@ that everyone must add themselves here, and not be added
by others, so it's currently incomplete waiting for everyone
to add their names.
The full list of authors can be found in docs/AUTHORS.txt.
The list of authors added before the policy change can be found in docs/AUTHORS.txt.
--
......@@ -156,6 +156,7 @@ Antoine Legrand, 2014/01/09
Pepijn de Vos, 2014/01/15
Dan McGee, 2014/01/27
Paul Kilgo, 2014/01/28
Môshe van der Sterre, 2014/01/31
Martin Davidsson, 2014/02/08
Chris Clark, 2014/02/20
Matthew Duggan, 2014/04/10
......@@ -176,6 +177,7 @@ Nathan Van Gheem, 2014/10/28
Gino Ledesma, 2014/10/28
Thomas French, 2014/11/10
Michael Permana, 2014/11/6
William King, 2014/11/21
Bert Vanderbauwhede, 2014/12/18
John Anderson, 2014/12/27
Luke Burden, 2015/01/24
......@@ -197,3 +199,29 @@ Krzysztof Bujniewicz, 2015/10/21
Sukrit Khera, 2015/10/26
Dave Smith, 2015/10/27
Dennis Brakhane, 2015/10/30
Chris Harris, 2015/11/27
Valentyn Klindukh, 2016/01/15
Wayne Chang, 2016/01/15
Mike Attwood, 2016/01/22
David Harrigan, 2016/02/01
Ahmet Demir, 2016/02/27
Maxime Verger, 2016/02/29
Alexander Oblovatniy, 2016/03/10
Komu Wairagu, 2016/04/03
Joe Sanford, 2016/04/11
Takeshi Kanemoto, 2016/04/22
Arthur Vuillard, 2016/04/22
Colin McIntosh, 2016/04/26
Jeremy Zafran, 2016/05/17
Anand Reddy Pandikunta, 2016/06/18
Adriano Martins de Jesus, 2016/06/22
Kevin Richardson, 2016/06/29
Andrew Stewart, 2016/07/04
Xin Li, 2016/08/03
Alli Witheford, 2016/09/29
Marat Sharafutdinov, 2016/11/04
Viktor Holmqvist, 2016/12/02
Rick Wargo, 2016/12/02
zhengxiaowai, 2016/12/07
Michael Howitz, 2016/12/08
Andreas Pelme, 2016/12/13
This diff is collapsed.
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, 2010, 2011, 2012 Ask Solem, and individual contributors. All rights reserved.
......
......@@ -6,16 +6,21 @@ include MANIFEST.in
include TODO
include setup.cfg
include setup.py
recursive-include celery *.py
recursive-include t *.py
recursive-include docs *
recursive-include extra/bash-completion *
recursive-include extra/centos *
recursive-include extra/generic-init.d *
recursive-include extra/osx *
recursive-include extra/macOS *
recursive-include extra/supervisord *
recursive-include extra/systemd *
recursive-include extra/zsh-completion *
recursive-include examples *
recursive-include requirements *.txt
prune *.pyc
prune *.sw*
recursive-include requirements *.txt *.rst
recursive-include celery/utils/static *.png
recursive-exclude docs/_build *
recursive-exclude * __pycache__
recursive-exclude * *.py[co]
recursive-exclude * .*.sw[a-z]
This diff is collapsed.
This diff is collapsed.
Please see our Issue Tracker at GitHub:
http://github.com/celery/celery/issues
https://github.com/celery/celery/issues
This diff is collapsed.
This diff is collapsed.
[console_scripts]
celery = celery.__main__:main
celerybeat = celery.__main__:_compat_beat
celeryd = celery.__main__:_compat_worker
celeryd-multi = celery.__main__:_compat_multi
[pytest11]
celery = celery.contrib.pytest
pytz>dev
billiard>=3.3.0.23,<3.4
kombu>=3.0.34,<3.1
billiard>=3.5.0.2,<3.6.0
kombu>=4.0.2,<5.0
[auth]
pyOpenSSL
[beanstalk]
beanstalkc
[cassandra]
pycassa
cassandra-driver
[consul]
python-consul
[couchbase]
couchbase
[couchdb]
couchdb
pycouchdb
[django]
Django>=1.8
[elasticsearch]
elasticsearch
[eventlet]
eventlet
......@@ -24,40 +30,44 @@ eventlet
gevent
[librabbitmq]
librabbitmq>=1.6.1
librabbitmq>=1.5.0
[memcache]
pylibmc
[mongodb]
pymongo>=2.6.2
[msgpack]
msgpack-python>=0.3.0
[pymemcache]
python-memcached
[pyro]
pyro4
[redis]
redis>=2.8.0
redis>=2.10.5
[riak]
riak >=2.0
[slmq]
softlayer_messaging>=1.0.3
[solar]
ephem
[sqlalchemy]
sqlalchemy
[sqs]
boto>=2.13.3
pycurl
[threads]
threadpool
[tblib]
tblib>=1.3.0
[yaml]
PyYAML>=3.10
[zeromq]
pyzmq>=13.1.0
[zookeeper]
kazoo>=1.3.1
# -*- coding: utf-8 -*-
"""Distributed Task Queue"""
# :copyright: (c) 2015 Ask Solem and individual contributors.
# All rights # reserved.
"""Distributed Task Queue."""
# :copyright: (c) 2015-2016 Ask Solem. All rights reserved.
# :copyright: (c) 2012-2014 GoPivotal, Inc., All rights reserved.
# :copyright: (c) 2009 - 2012 Ask Solem and individual contributors,
# All rights reserved.
# :license: BSD (3 Clause), see LICENSE for more details.
from __future__ import absolute_import
from __future__ import absolute_import, print_function, unicode_literals
import os
import re
import sys
from collections import namedtuple
version_info_t = namedtuple(
'version_info_t', ('major', 'minor', 'micro', 'releaselevel', 'serial'),
)
SERIES = 'latentcall'
SERIES = 'Cipater'
VERSION = version_info_t(3, 1, 23, '', '')
__version__ = '{0.major}.{0.minor}.{0.micro}{0.releaselevel}'.format(VERSION)
__version__ = '4.0.2'
__author__ = 'Ask Solem'
__contact__ = 'ask@celeryproject.org'
__homepage__ = 'http://celeryproject.org'
__docformat__ = 'restructuredtext'
__keywords__ = 'task job queue distributed messaging actor'
# -eof meta-
__all__ = [
'Celery', 'bugreport', 'shared_task', 'task',
'current_app', 'current_task', 'maybe_signature',
'chain', 'chord', 'chunks', 'group', 'signature',
'xmap', 'xstarmap', 'uuid', 'version', '__version__',
'xmap', 'xstarmap', 'uuid',
]
VERSION_BANNER = '{0} ({1})'.format(__version__, SERIES)
# -eof meta-
version_info_t = namedtuple('version_info_t', (
'major', 'minor', 'micro', 'releaselevel', 'serial',
))
# bumpversion can only search for {current_version}
# so we have to parse the version here.
_temp = re.match(
r'(\d+)\.(\d+).(\d+)(.+)?', __version__).groups()
VERSION = version_info = version_info_t(
int(_temp[0]), int(_temp[1]), int(_temp[2]), _temp[3] or '', '')
del _temp
del re
if os.environ.get('C_IMPDEBUG'): # pragma: no cover
from .five import builtins
real_import = builtins.__import__
def debug_import(name, locals=None, globals=None,
fromlist=None, level=-1):
fromlist=None, level=-1, real_import=builtins.__import__):
glob = globals or getattr(sys, 'emarfteg_'[::-1])(1).f_globals
importer_name = glob and glob.get('__name__') or 'unknown'
print('-- {0} imports {1}'.format(importer_name, name))
......@@ -69,18 +78,19 @@ if STATICA_HACK: # pragma: no cover
def _find_option_with_arg(argv, short_opts=None, long_opts=None):
"""Search argv for option specifying its short and longopt
alternatives.
Return the value of the option if found.
"""Search argv for options specifying short and longopt alternatives.
Returns:
str: value for option found
Raises:
KeyError: if option not found.
"""
for i, arg in enumerate(argv):
if arg.startswith('-'):
if long_opts and arg.startswith('--'):
name, _, val = arg.partition('=')
name, sep, val = arg.partition('=')
if name in long_opts:
return val
return val if sep else argv[i + 1]
if short_opts and arg in short_opts:
return argv[i + 1]
raise KeyError('|'.join(short_opts or [] + long_opts or []))
......@@ -89,31 +99,36 @@ def _find_option_with_arg(argv, short_opts=None, long_opts=None):
def _patch_eventlet():
import eventlet
import eventlet.debug
eventlet.monkey_patch()
EVENTLET_DBLOCK = int(os.environ.get('EVENTLET_NOBLOCK', 0))
if EVENTLET_DBLOCK:
eventlet.debug.hub_blocking_detection(EVENTLET_DBLOCK)
blockdetect = float(os.environ.get('EVENTLET_NOBLOCK', 0))
if blockdetect:
eventlet.debug.hub_blocking_detection(blockdetect, blockdetect)
def _patch_gevent():
from gevent import monkey, version_info
import gevent
from gevent import monkey, signal as gevent_signal
monkey.patch_all()
if version_info[0] == 0: # pragma: no cover
if gevent.version_info[0] == 0: # pragma: no cover
# Signals aren't working in gevent versions <1.0,
# and are not monkey patched by patch_all()
from gevent import signal as _gevent_signal
# and aren't monkey patched by patch_all()
_signal = __import__('signal')
_signal.signal = _gevent_signal
_signal.signal = gevent_signal
def maybe_patch_concurrency(argv=sys.argv,
short_opts=['-P'], long_opts=['--pool'],
patches={'eventlet': _patch_eventlet,
'gevent': _patch_gevent}):
"""With short and long opt alternatives that specify the command line
"""Apply eventlet/gevent monkeypatches.
With short and long opt alternatives that specify the command line
option to set the pool, this makes sure that anything that needs
to be patched is completed as early as possible.
(e.g. eventlet/gevent monkey patches)."""
(e.g., eventlet/gevent monkey patches).
"""
try:
pool = _find_option_with_arg(argv, short_opts, long_opts)
except KeyError:
......@@ -125,31 +140,41 @@ def maybe_patch_concurrency(argv=sys.argv,
pass
else:
patcher()
# set up eventlet/gevent environments ASAP.
# set up eventlet/gevent environments ASAP
from celery import concurrency
concurrency.get_implementation(pool)
# Lazy loading
from celery import five # noqa
from . import local # noqa
old_module, new_module = five.recreate_module( # pragma: no cover
# this just creates a new module, that imports stuff on first attribute
# access. This makes the library faster to use.
old_module, new_module = local.recreate_module( # pragma: no cover
__name__,
by_module={
'celery.app': ['Celery', 'bugreport', 'shared_task'],
'celery.app.task': ['Task'],
'celery._state': ['current_app', 'current_task'],
'celery.canvas': ['chain', 'chord', 'chunks', 'group',
'signature', 'maybe_signature', 'subtask',
'xmap', 'xstarmap'],
'celery.canvas': [
'Signature', 'chain', 'chord', 'chunks', 'group',
'signature', 'maybe_signature', 'subtask',
'xmap', 'xstarmap',
],
'celery.utils': ['uuid'],
},
direct={'task': 'celery.task'},
__package__='celery', __file__=__file__,
__path__=__path__, __doc__=__doc__, __version__=__version__,
__author__=__author__, __contact__=__contact__,
__homepage__=__homepage__, __docformat__=__docformat__, five=five,
__homepage__=__homepage__, __docformat__=__docformat__, local=local,
VERSION=VERSION, SERIES=SERIES, VERSION_BANNER=VERSION_BANNER,
version_info_t=version_info_t,
version_info=version_info,
maybe_patch_concurrency=maybe_patch_concurrency,
_find_option_with_arg=_find_option_with_arg,
absolute_import=absolute_import,
unicode_literals=unicode_literals,
print_function=print_function,
)
from __future__ import absolute_import
"""Entry-point for the :program:`celery` umbrella command."""
from __future__ import absolute_import, print_function, unicode_literals
import sys
from os.path import basename
from . import maybe_patch_concurrency
__all__ = ['main']
DEPRECATED_FMT = """
The {old!r} command is deprecated, please use {new!r} instead:
$ {new_argv}
"""
def _warn_deprecated(new):
print(DEPRECATED_FMT.format(
old=basename(sys.argv[0]), new=new,
new_argv=' '.join([new] + sys.argv[1:])),
)
def main():
"""Entrypoint to the ``celery`` umbrella command."""
if 'multi' not in sys.argv:
maybe_patch_concurrency()
from celery.bin.celery import main
main()
def _compat_worker():
maybe_patch_concurrency()
_warn_deprecated('celery worker')
from celery.bin.worker import main
main()
def _compat_multi():
_warn_deprecated('celery multi')
from celery.bin.multi import main
main()
def _compat_beat():
maybe_patch_concurrency()
_warn_deprecated('celery beat')
from celery.bin.beat import main
main()
from celery.bin.celery import main as _main