Gentoo Archives: gentoo-commits

From: Ian Delaney <idella4@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] repo/gentoo:master commit in: dev-python/django-celery/files/, dev-python/django-celery/
Date: Tue, 27 Oct 2015 09:54:25
Message-Id: 1445939648.919a19fb17521df84f592cf4a7227edf88b2ba76.idella4@gentoo
1 commit: 919a19fb17521df84f592cf4a7227edf88b2ba76
2 Author: Ian Delaney <idella4 <AT> gentoo <DOT> org>
3 AuthorDate: Tue Oct 27 09:53:43 2015 +0000
4 Commit: Ian Delaney <idella4 <AT> gentoo <DOT> org>
5 CommitDate: Tue Oct 27 09:54:08 2015 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=919a19fb
7
8 dev-python/django-celery: patch to fix broken tests
9
10 patch from upstream submitted via the gentoo bug and runtested
11 by 'wraeth', drop py3.3 support, add missed PYTHON_REQ_USE value
12 for sqlite, set required bordering to django subsequent to
13 runtesting, fixes the gentoo bug
14
15 Gentoo bug: #564250
16
17 Package-Manager: portage-2.2.23
18
19 .../django-celery/django-celery-3.1.16.ebuild | 14 ++++++--
20 .../django-celery-3.1.16-py3-test-failures.patch | 39 ++++++++++++++++++++++
21 2 files changed, 50 insertions(+), 3 deletions(-)
22
23 diff --git a/dev-python/django-celery/django-celery-3.1.16.ebuild b/dev-python/django-celery/django-celery-3.1.16.ebuild
24 index 44b6fe2..872f74f 100644
25 --- a/dev-python/django-celery/django-celery-3.1.16.ebuild
26 +++ b/dev-python/django-celery/django-celery-3.1.16.ebuild
27 @@ -3,9 +3,10 @@
28 # $Id$
29
30 EAPI=5
31 -PYTHON_COMPAT=( python{2_7,3_3,3_4} )
32 +PYTHON_COMPAT=( python{2_7,3_4} )
33 +PYTHON_REQ_USE="sqlite(+)"
34
35 -inherit distutils-r1
36 +inherit distutils-r1 eutils
37
38 DESCRIPTION="Celery Integration for Django"
39 HOMEPAGE="http://celeryproject.org/"
40 @@ -16,9 +17,14 @@ SLOT="0"
41 KEYWORDS="amd64 x86"
42 IUSE="doc examples test"
43
44 +# Python testsuite fails when built against dev-python/django-1.8.5
45 +# with ValueError: save() prohibited to prevent data loss due to
46 +# unsaved related object 'interval'.
47 +
48 PY2_USEDEP=$(python_gen_usedep python2_7)
49 RDEPEND=">=dev-python/celery-3.1.15[${PYTHON_USEDEP}]
50 - dev-python/django[${PYTHON_USEDEP}]
51 + >dev-python/django-1.4[${PYTHON_USEDEP}]
52 + <=dev-python/django-1.7.10[${PYTHON_USEDEP}]
53 dev-python/pytz[${PYTHON_USEDEP}]"
54 DEPEND="${RDEPEND}
55 dev-python/setuptools[${PYTHON_USEDEP}]
56 @@ -37,6 +43,8 @@ PY27_REQUSE="$(python_gen_useflags 'python2.7')"
57 REQUIRED_USE="
58 doc? ( ${PY27_REQUSE} )"
59
60 +PATCHES=( "${FILESDIR}/${P}-py3-test-failures.patch" )
61 +
62 python_compile_all() {
63 use doc && emake -C docs html
64 }
65
66 diff --git a/dev-python/django-celery/files/django-celery-3.1.16-py3-test-failures.patch b/dev-python/django-celery/files/django-celery-3.1.16-py3-test-failures.patch
67 new file mode 100644
68 index 0000000..4b44b66
69 --- /dev/null
70 +++ b/dev-python/django-celery/files/django-celery-3.1.16-py3-test-failures.patch
71 @@ -0,0 +1,39 @@
72 +https://github.com/brianmay/django-celery/commit/8c4449f2a1b65f16eb405ecb3a2ef98ea7a8bf4f
73 +diff --git a/djcelery/loaders.py b/djcelery/loaders.py
74 +index c86455a..61c6d04 100644
75 +--- a/djcelery/loaders.py
76 ++++ b/djcelery/loaders.py
77 +# Patch to fix failing tests test_list_registered_tasks and
78 +# test_apply with python3. Patch sourced from upstream
79 +# https://github.com/celery/django-celery/issues/342
80 +@@ -201,7 +201,8 @@ def find_related_module(app, related_name):
81 + return
82 +
83 + try:
84 +- imp.find_module(related_name, app_path)
85 ++ file, _, _ = imp.find_module(related_name, app_path)
86 ++ file.close()
87 + except ImportError:
88 + return
89 +
90 +diff --git a/djcelery/views.py b/djcelery/views.py
91 +index 34cb307..4d07e0a 100644
92 +--- a/djcelery/views.py
93 ++++ b/djcelery/views.py
94 +@@ -34,7 +34,7 @@ def task_view(task):
95 + kwargs = kwdict(request.method == 'POST' and
96 + request.POST or request.GET)
97 + # no multivalue
98 +- kwargs = dict(((k, v) for k, v in kwargs.iteritems()), **options)
99 ++ kwargs = dict(((k, v) for k, v in kwargs.items()), **options)
100 + result = task.apply_async(kwargs=kwargs)
101 + return JsonResponse({'ok': 'true', 'task_id': result.task_id})
102 +
103 +@@ -78,8 +78,8 @@ def task_status(request, task_id):
104 +
105 + def registered_tasks(request):
106 + """View returning all defined tasks as a JSON object."""
107 +- return JsonResponse({'regular': tasks.regular().keys(),
108 +- 'periodic': tasks.periodic().keys()})
109 ++ return JsonResponse({'regular': list(tasks.regular().keys()),
110 ++ 'periodic': list(tasks.periodic().keys())})