Skip to content

Commit

Permalink
Merge pull request #72 from tumb1er/master
Browse files Browse the repository at this point in the history
Support celery-4.4.4
  • Loading branch information
tumb1er authored Jun 5, 2020
2 parents 7557630 + 08e4d88 commit d6c57f3
Show file tree
Hide file tree
Showing 6 changed files with 30 additions and 22 deletions.
3 changes: 2 additions & 1 deletion celery_rpc/runtests/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,8 @@
'OVERRIDE_BASE_TASKS': {
'ModelTask': 'celery_rpc.tests.tasks.CustomModelTask'
},
'WRAP_REMOTE_ERRORS': True
'WRAP_REMOTE_ERRORS': True,
'CELERY_TASK_SERIALIZER': 'x-rpc-json'
}

MIDDLEWARE_CLASSES = []
3 changes: 2 additions & 1 deletion celery_rpc/tasks.py
Original file line number Diff line number Diff line change
Expand Up @@ -232,7 +232,8 @@ def pipe(self, pipeline):
args.append(result)
else:
args.append(r)
r = task.apply(args=args, kwargs=t['kwargs'], headers=headers).get()
res = task.apply(args=args, kwargs=t['kwargs'], headers=headers)
r = res.get(disable_sync_subtasks=False)
result.append(r)

return result
Expand Down
10 changes: 6 additions & 4 deletions celery_rpc/tests/test_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -103,19 +103,21 @@ def setUpClass(cls):

def setUp(self):
super(AlterIdentityTests, self).setUp()
self.data = {'datetime': datetime.max, 'char': self.models[0].char}
self.dt = datetime.max.replace(microsecond=998000)
self.data = {'datetime': self.dt,
'char': self.models[0].char}
self.kwargs = {'identity': 'char'}

def testUpdate(self):
""" Update with alter identity field looks good.
"""
r = self.rpc_client.update(self.MODEL_SYMBOL, self.data, self.kwargs)
if DRF3:
dt = serializers.DateTimeField().to_representation(datetime.max)
dt = serializers.DateTimeField().to_representation(self.dt)
else:
dt = datetime.max
dt = self.dt
self.assertEqual(dt, r['datetime'])
self.assertEqual(datetime.max,
self.assertEqual(self.dt,
self.MODEL.objects.get(pk=self.models[0].pk).datetime)

def testDelete(self):
Expand Down
3 changes: 2 additions & 1 deletion requirements.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
celery==3.1.26.post2
Celery==4.4.4
future==0.18.2
Django==3.0.7
djangorestframework==3.11.0
factory-boy==2.12.0
Expand Down
4 changes: 2 additions & 2 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -74,8 +74,8 @@ def get_version():
description='Remote access from one system to models and functions of '
'another one using Celery machinery.',
install_requires=[
'celery >=3.1.5, <4.0.0',
'jsonpickle',
'celery >=3.1.5, <4.5.0',
'jsonpickle >=0.8.0, <1.4.1',
'six',
# celery_rpc server still needs django and djangorestframework packages,
# but they are unnecessary for client
Expand Down
29 changes: 16 additions & 13 deletions tox.ini
Original file line number Diff line number Diff line change
@@ -1,18 +1,18 @@
[tox]
envlist =
{py3.5,py3.6,py3.7,py3.8}-django-200-{drf310,drf311}
{py3.5,py3.6,py3.7,py3.8}-django-201-{drf310,drf311}
{py3.5,py3.6,py3.7,py3.8}-django-202-{drf310,drf311}
{py3.5,py3.6,py3.7,py3.8}-django-300-{drf310,drf311}
{py2.7,py3.5}-django111-drf{37,36,35}
{py2.7,py3.5}-django110-drf{34,33}
{py2.7,py3.5}-django19-drf{34,33,32,31}
{py2.7,py3.5}-django18-drf{34,33,32,31,30,24}
py2.7-django17-drf{33,32,31,30,24,23}
py2.7-django16-drf{32,31,30,24,23}
py2.7-django15-drf{24,23}
py2.7-django14-drf23
py2.7-django13-drf23
{py3.5,py3.6,py3.7,py3.8}-django-200-{drf310,drf311}-{c31,c44}
{py3.5,py3.6,py3.7,py3.8}-django-201-{drf310,drf311}-{c31,c44}
{py3.5,py3.6,py3.7,py3.8}-django-202-{drf310,drf311}-{c31,c44}
{py3.5,py3.6,py3.7,py3.8}-django-300-{drf310,drf311}-{c31,c44}
{py2.7,py3.5}-django111-drf{37,36,35}-{c31,c44}
{py2.7,py3.5}-django110-drf{34,33}-c31
{py2.7,py3.5}-django19-drf{34,33,32,31}-c31
{py2.7,py3.5}-django18-drf{34,33,32,31,30,24}-c31
py2.7-django17-drf{33,32,31,30,24,23}-c31
py2.7-django16-drf{32,31,30,24,23}-c31
py2.7-django15-drf{24,23}-c31
py2.7-django14-drf23-c31
py2.7-django13-drf23-c31

[gh-actions]
python =
Expand Down Expand Up @@ -65,4 +65,7 @@ deps =
drf39: djangorestframework>=3.9,<3.10
drf310: djangorestframework>=3.10,<3.11
drf311: djangorestframework>=3.11,<3.12
c31: celery<4.0
c44: celery>=4.4,<4.5
c44: future>=0.18.2,<1.0.0
commands = python setup.py test

0 comments on commit d6c57f3

Please sign in to comment.