[Python-modules-commits] [celery] 01/01: Convert from git-dpm to patches unapplied format
Brian May
bam at moszumanska.debian.org
Mon Jul 3 21:44:54 UTC 2017
This is an automated email from the git hooks/post-receive script.
bam pushed a commit to branch debian/master
in repository celery.
commit aaecf9920306be4532f8842371dc0e6947754384
Author: Brian May <bam at moszumanska.debian.org>
Date: Mon Jul 3 21:44:54 2017 +0000
Convert from git-dpm to patches unapplied format
---
celery/tests/utils/test_functional.py | 5 +----
celery/tests/worker/test_worker.py | 2 --
celery/utils/functional.py | 21 +++++++++++----------
debian/.git-dpm | 11 -----------
debian/gbp.conf | 2 ++
docs/.templates/sidebarintro.html | 12 +++++++++++-
docs/.templates/sidebarlogo.html | 12 +++++++++++-
docs/conf.py | 24 +++++++-----------------
extra/generic-init.d/celerybeat | 23 +++--------------------
extra/generic-init.d/celeryd | 20 ++------------------
setup.py | 32 ++++++++++++++++++++++++++++++++
11 files changed, 80 insertions(+), 84 deletions(-)
diff --git a/celery/tests/utils/test_functional.py b/celery/tests/utils/test_functional.py
index ce112ac..73f0d1d 100644
--- a/celery/tests/utils/test_functional.py
+++ b/celery/tests/utils/test_functional.py
@@ -1,7 +1,6 @@
from __future__ import absolute_import
import pickle
-import sys
from kombu.utils.functional import lazy
@@ -15,7 +14,7 @@ from celery.utils.functional import (
maybe_list,
)
-from celery.tests.case import Case, SkipTest
+from celery.tests.case import Case
class test_LRUCache(Case):
@@ -69,8 +68,6 @@ class test_LRUCache(Case):
self.assertEqual(list(x.keys()), [98, 99])
def assertSafeIter(self, method, interval=0.01, size=10000):
- if sys.version_info >= (3,5):
- raise SkipTest('Fails on Py3.5')
from threading import Thread, Event
from time import sleep
x = LRUCache(size)
diff --git a/celery/tests/worker/test_worker.py b/celery/tests/worker/test_worker.py
index 27451d0..b700a6c 100644
--- a/celery/tests/worker/test_worker.py
+++ b/celery/tests/worker/test_worker.py
@@ -416,7 +416,6 @@ class test_Consumer(AppCase):
self.assertIs(self.buffer.get_nowait(), task)
def test_receieve_message_eta_isoformat(self):
- raise SkipTest('broken test, may fail at random')
l = _MyKombuConsumer(self.buffer.put, timer=self.timer, app=self.app)
l.blueprint.state = RUN
l.steps.pop()
@@ -517,7 +516,6 @@ class test_Consumer(AppCase):
self.assertTrue(logger.critical.call_count)
def test_receive_message_eta(self):
- raise SkipTest('broken test, may fail at random')
import sys
from functools import partial
if os.environ.get('C_DEBUG_TEST'):
diff --git a/celery/utils/functional.py b/celery/utils/functional.py
index 6d383e0..944a095 100644
--- a/celery/utils/functional.py
+++ b/celery/utils/functional.py
@@ -24,7 +24,7 @@ __all__ = ['LRUCache', 'is_list', 'maybe_list', 'memoize', 'mlazy', 'noop',
'first', 'firstmethod', 'chunks', 'padlist', 'mattrgetter', 'uniq',
'regen', 'dictfilter', 'lazy', 'maybe_evaluate']
-IS_PY3 = sys.version_info[0] == 3
+IS_PYPY = hasattr(sys, 'pypy_version_info')
KEYWORD_MARK = object()
@@ -56,7 +56,7 @@ class LRUCache(UserDict):
def __getitem__(self, key):
with self.mutex:
value = self[key] = self.data.pop(key)
- return value
+ return value
def update(self, *args, **kwargs):
with self.mutex:
@@ -67,7 +67,9 @@ class LRUCache(UserDict):
for _ in range(len(data) - limit):
data.popitem(last=False)
- def popitem(self, last=True):
+ def popitem(self, last=True, _needs_lock=IS_PYPY):
+ if not _needs_lock:
+ return self.data.popitem(last)
with self.mutex:
return self.data.popitem(last)
@@ -81,8 +83,8 @@ class LRUCache(UserDict):
def __iter__(self):
return iter(self.data)
- def _iterate_items(self):
- with self.mutex:
+ def _iterate_items(self, _need_lock=IS_PYPY):
+ with self.mutex if _need_lock else DummyContext():
for k in self:
try:
yield (k, self.data[k])
@@ -90,8 +92,8 @@ class LRUCache(UserDict):
pass
iteritems = _iterate_items
- def _iterate_values(self):
- with self.mutex:
+ def _iterate_values(self, _need_lock=IS_PYPY):
+ with self.mutex if _need_lock else DummyContext():
for k in self:
try:
yield self.data[k]
@@ -102,8 +104,7 @@ class LRUCache(UserDict):
def _iterate_keys(self):
# userdict.keys in py3k calls __getitem__
- with self.mutex:
- return keys(self.data)
+ return keys(self.data)
iterkeys = _iterate_keys
def incr(self, key, delta=1):
@@ -112,7 +113,7 @@ class LRUCache(UserDict):
# integer as long as it exists and we can cast it
newval = int(self.data.pop(key)) + delta
self[key] = str(newval)
- return newval
+ return newval
def __getstate__(self):
d = dict(vars(self))
diff --git a/debian/.git-dpm b/debian/.git-dpm
deleted file mode 100644
index a2eb396..0000000
--- a/debian/.git-dpm
+++ /dev/null
@@ -1,11 +0,0 @@
-# see git-dpm(1) from git-dpm package
-fe0a322f110f182dc98d703815d17663fa5ac893
-fe0a322f110f182dc98d703815d17663fa5ac893
-6753277798b7b79fec667e858b4cbf459c1c277c
-6753277798b7b79fec667e858b4cbf459c1c277c
-celery_3.1.23.orig.tar.gz
-4c51da2190dee77e723b658a939809fd74f4da96
-1310624
-debianTag="debian/%e%v"
-patchedTag="patched/%e%v"
-upstreamTag="upstream/%e%u"
diff --git a/debian/gbp.conf b/debian/gbp.conf
new file mode 100644
index 0000000..3879982
--- /dev/null
+++ b/debian/gbp.conf
@@ -0,0 +1,2 @@
+[DEFAULT]
+debian-branch=debian/master
diff --git a/docs/.templates/sidebarintro.html b/docs/.templates/sidebarintro.html
index f1e739c..cc68b8f 100644
--- a/docs/.templates/sidebarintro.html
+++ b/docs/.templates/sidebarintro.html
@@ -1,3 +1,13 @@
<p class="logo"><a href="{{ pathto(master_doc) }}">
- <img class="logo" src="{{ pathto("_images/celery_128.png", 1) }}" alt="Logo"/>
+ <img class="logo" src="http://cloud.github.com/downloads/celery/celery/celery_128.png" alt="Logo"/>
</a></p>
+<div id="donate">
+ <b>Donations welcome:</b>
+ <form action="https://www.paypal.com/cgi-bin/webscr" method="post" target="_top">
+ <input type="hidden" name="cmd" value="_s-xclick">
+ <input type="hidden" name="encrypted" value="-----BEGIN PKCS7-----MIIHTwYJKoZIhvcNAQcEoIIHQDCCBzwCAQExggEwMIIBLAIBADCBlDCBjjELMAkGA1UEBhMCVVMxCzAJBgNVBAgTAkNBMRYwFAYDVQQHEw1Nb3VudGFpbiBWaWV3MRQwEgYDVQQKEwtQYXlQYWwgSW5jLjETMBEGA1UECxQKbGl2ZV9jZXJ0czERMA8GA1UEAxQIbGl2ZV9hcGkxHDAaBgkqhkiG9w0BCQEWDXJlQHBheXBhbC5jb20CAQAwDQYJKoZIhvcNAQEBBQAEgYA2+c723xlntHKQYQR9yn9BEtUhDoUUlnOqhniqvNMWB4k2R0JpVkrNSu5JCbdjNOqDXKHoRfIWe3HXJJMPZBJKFMD5Izprb6xEZlTGaWnlrGXFfkdBaILQQgWYqV0DnuNmtDXCvfYmyu0p1K04wL [...]
+ ">
+ <input type="image" src="https://www.paypalobjects.com/en_US/i/btn/btn_donateCC_LG.gif" border="0" name="submit" alt="PayPal - The safer, easier way to pay online!">
+ <img alt="" border="0" src="https://www.paypalobjects.com/en_US/i/scr/pixel.gif" width="1" height="1">
+ </form>
+</div>
diff --git a/docs/.templates/sidebarlogo.html b/docs/.templates/sidebarlogo.html
index f1e739c..cc68b8f 100644
--- a/docs/.templates/sidebarlogo.html
+++ b/docs/.templates/sidebarlogo.html
@@ -1,3 +1,13 @@
<p class="logo"><a href="{{ pathto(master_doc) }}">
- <img class="logo" src="{{ pathto("_images/celery_128.png", 1) }}" alt="Logo"/>
+ <img class="logo" src="http://cloud.github.com/downloads/celery/celery/celery_128.png" alt="Logo"/>
</a></p>
+<div id="donate">
+ <b>Donations welcome:</b>
+ <form action="https://www.paypal.com/cgi-bin/webscr" method="post" target="_top">
+ <input type="hidden" name="cmd" value="_s-xclick">
+ <input type="hidden" name="encrypted" value="-----BEGIN PKCS7-----MIIHTwYJKoZIhvcNAQcEoIIHQDCCBzwCAQExggEwMIIBLAIBADCBlDCBjjELMAkGA1UEBhMCVVMxCzAJBgNVBAgTAkNBMRYwFAYDVQQHEw1Nb3VudGFpbiBWaWV3MRQwEgYDVQQKEwtQYXlQYWwgSW5jLjETMBEGA1UECxQKbGl2ZV9jZXJ0czERMA8GA1UEAxQIbGl2ZV9hcGkxHDAaBgkqhkiG9w0BCQEWDXJlQHBheXBhbC5jb20CAQAwDQYJKoZIhvcNAQEBBQAEgYA2+c723xlntHKQYQR9yn9BEtUhDoUUlnOqhniqvNMWB4k2R0JpVkrNSu5JCbdjNOqDXKHoRfIWe3HXJJMPZBJKFMD5Izprb6xEZlTGaWnlrGXFfkdBaILQQgWYqV0DnuNmtDXCvfYmyu0p1K04wL [...]
+ ">
+ <input type="image" src="https://www.paypalobjects.com/en_US/i/btn/btn_donateCC_LG.gif" border="0" name="submit" alt="PayPal - The safer, easier way to pay online!">
+ <img alt="" border="0" src="https://www.paypalobjects.com/en_US/i/scr/pixel.gif" width="1" height="1">
+ </form>
+</div>
diff --git a/docs/conf.py b/docs/conf.py
index b2722d8..551e7a6 100644
--- a/docs/conf.py
+++ b/docs/conf.py
@@ -75,23 +75,13 @@ unused_docs = [
# If true, '()' will be appended to :func: etc. cross-reference text.
add_function_parentheses = True
-def check_object_path(key, url, path):
- if os.path.isfile(path):
- return {key: (url, path)}
- return {}
-
-intersphinx_mapping = {}
-intersphinx_mapping.update(check_object_path('python',
- 'http://docs.python.org/',
- '/usr/share/doc/python'
- + '.'.join([str(x) for x in sys.version_info[0:2]])
- + '/html/objects.inv'))
-intersphinx_mapping.update(check_object_path('kombu',
- 'http://kombu.readthedocs.org/en/latest/',
- '/usr/share/doc/python-kombu-doc/html/objects.inv'))
-intersphinx_mapping.update(check_object_path('amqp',
- 'http://amqp.readthedocs.org/en/latest/',
- '/usr/share/doc/python-amqp-doc/html/objects.inv'))
+intersphinx_mapping = {
+ 'python': ('http://docs.python.org/dev', None),
+ 'kombu': ('http://kombu.readthedocs.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),
+}
# The name of the Pygments (syntax highlighting) style to use.
pygments_style = 'colorful'
diff --git a/extra/generic-init.d/celerybeat b/extra/generic-init.d/celerybeat
index a1596a3..2db4e9a 100755
--- a/extra/generic-init.d/celerybeat
+++ b/extra/generic-init.d/celerybeat
@@ -15,15 +15,11 @@
# Default-Start: 2 3 4 5
# Default-Stop: 0 1 6
# Short-Description: celery periodic task scheduler
-# Description: Controls the Celery periodic task scheduler.
### END INIT INFO
# Cannot use set -e/bash -e since the kill -0 command will abort
# abnormally in the absence of a valid process ID.
#set -e
-
-. /lib/lsb/init-functions
-
VERSION=10.1
echo "celery init v${VERSION}."
@@ -33,14 +29,9 @@ if [ $(id -u) -ne 0 ]; then
exit 1
fi
-origin_is_runlevel_dir () {
- set +e
- dirname $0 | grep -q "/etc/rc.\.d"
- echo $?
-}
-# Can be a runlevel symlink (e.g. S02celeryd)
-if [ $(origin_is_runlevel_dir) -eq 0 ]; then
+# May be a runlevel symlink (e.g. S02celeryd)
+if [ -L "$0" ]; then
SCRIPT_FILE=$(readlink "$0")
else
SCRIPT_FILE="$0"
@@ -94,7 +85,6 @@ _config_sanity() {
scripts=""
-
if test -f /etc/default/celeryd; then
scripts="/etc/default/celeryd"
_config_sanity /etc/default/celeryd
@@ -116,13 +106,6 @@ DEFAULT_PID_FILE="/var/run/celery/beat.pid"
DEFAULT_LOG_FILE="/var/log/celery/beat.log"
DEFAULT_LOG_LEVEL="INFO"
DEFAULT_CELERYBEAT="$CELERY_BIN beat"
-DEFAULT_ENABLED="false"
-
-ENABLED=${ENABLED:-$DEFAULT_ENABLED}
-if [ "$ENABLED" != "true" ]; then
- echo "celerybeat daemon disabled - see $scripts."
- exit 0
-fi
CELERYBEAT=${CELERYBEAT:-$DEFAULT_CELERYBEAT}
CELERYBEAT_LOG_LEVEL=${CELERYBEAT_LOG_LEVEL:-${CELERYBEAT_LOGLEVEL:-$DEFAULT_LOG_LEVEL}}
@@ -254,7 +237,7 @@ stop_beat () {
}
_chuid () {
- su "$CELERYBEAT_USER" --shell=/bin/sh -c "$CELERYBEAT $*"
+ su "$CELERYBEAT_USER" -c "$CELERYBEAT $*"
}
start_beat () {
diff --git a/extra/generic-init.d/celeryd b/extra/generic-init.d/celeryd
index d88e029..362383d 100755
--- a/extra/generic-init.d/celeryd
+++ b/extra/generic-init.d/celeryd
@@ -16,7 +16,6 @@
# Default-Start: 2 3 4 5
# Default-Stop: 0 1 6
# Short-Description: celery task worker daemon
-# Description: Controls a celery task worker daemon instance
### END INIT INFO
#
#
@@ -29,9 +28,6 @@
#
# You can then configure this by manipulating /etc/default/little-worker.
#
-
-. /lib/lsb/init-functions
-
VERSION=10.1
echo "celery init v${VERSION}."
if [ $(id -u) -ne 0 ]; then
@@ -41,14 +37,9 @@ if [ $(id -u) -ne 0 ]; then
exit 1
fi
-origin_is_runlevel_dir () {
- set +e
- dirname $0 | grep -q "/etc/rc.\.d"
- echo $?
-}
# Can be a runlevel symlink (e.g. S02celeryd)
-if [ $(origin_is_runlevel_dir) -eq 0 ]; then
+if [[ `dirname $0` == /etc/rc*.d ]]; then
SCRIPT_FILE=$(readlink "$0")
else
SCRIPT_FILE="$0"
@@ -61,7 +52,6 @@ DEFAULT_LOG_FILE="/var/log/celery/%n.log"
DEFAULT_LOG_LEVEL="INFO"
DEFAULT_NODES="celery"
DEFAULT_CELERYD="-m celery worker --detach"
-DEFAULT_ENABLED="false"
CELERY_DEFAULTS=${CELERY_DEFAULTS:-"/etc/default/${SCRIPT_NAME}"}
@@ -114,12 +104,6 @@ if [ -f "$CELERY_DEFAULTS" ]; then
. "$CELERY_DEFAULTS"
fi
-ENABLED=${ENABLED:-$DEFAULT_ENABLED}
-if [ "$ENABLED" != "true" ]; then
- echo "celery daemon disabled - see $CELERY_DEFAULTS"
- exit 0
-fi
-
# Sets --app argument for CELERY_BIN
CELERY_APP_ARG=""
if [ ! -z "$CELERY_APP" ]; then
@@ -246,7 +230,7 @@ _get_pids() {
_chuid () {
- su "$CELERYD_USER" --shell=/bin/sh -c "$CELERYD_MULTI $*"
+ su "$CELERYD_USER" -c "$CELERYD_MULTI $*"
}
diff --git a/setup.py b/setup.py
index a4c2729..4ba98eb 100644
--- a/setup.py
+++ b/setup.py
@@ -23,6 +23,38 @@ CELERY_COMPAT_PROGRAMS = int(os.environ.get('CELERY_COMPAT_PROGRAMS', 1))
if sys.version_info < (2, 6):
raise Exception('Celery 3.1 requires Python 2.6 or higher.')
+downgrade_packages = [
+ 'celery.app.task',
+]
+orig_path = sys.path[:]
+for path in (os.path.curdir, os.getcwd()):
+ if path in sys.path:
+ sys.path.remove(path)
+try:
+ import imp
+ import shutil
+ for pkg in downgrade_packages:
+ try:
+ parent, module = pkg.rsplit('.', 1)
+ print('- Trying to upgrade %r in %r' % (module, parent))
+ parent_mod = __import__(parent, None, None, [parent])
+ _, mod_path, _ = imp.find_module(module, parent_mod.__path__)
+ if mod_path.endswith('/' + module):
+ print('- force upgrading previous installation')
+ print(' - removing {0!r} package...'.format(mod_path))
+ try:
+ shutil.rmtree(os.path.abspath(mod_path))
+ except Exception:
+ sys.stderr.write('Could not remove {0!r}: {1!r}\n'.format(
+ mod_path, sys.exc_info[1]))
+ except ImportError:
+ print('- upgrade %s: no old version found.' % module)
+except:
+ pass
+finally:
+ sys.path[:] = orig_path
+
+
NAME = 'celery'
entrypoints = {}
extra = {}
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/python-modules/packages/celery.git
More information about the Python-modules-commits
mailing list