Skip to content

Commit

Permalink
chore: Add Celery 5 to CI (#839)
Browse files Browse the repository at this point in the history
Co-authored-by: sentry-bot <markus+ghbot@sentry.io>
  • Loading branch information
untitaker and sentry-bot committed Sep 28, 2020
1 parent 4d16ef6 commit 867beae
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 5 deletions.
17 changes: 13 additions & 4 deletions tests/integrations/celery/test_celery.py
Expand Up @@ -51,10 +51,19 @@ def inner(propagate_traces=True, backend="always_eager", **kwargs):
request.addfinalizer(lambda: Hub.main.bind_client(None))

# Once we drop celery 3 we can use the celery_worker fixture
w = worker.worker(app=celery)
t = threading.Thread(target=w.run)
t.daemon = True
t.start()
if VERSION < (5,):
worker_fn = worker.worker(app=celery).run
else:
from celery.bin.base import CLIContext

worker_fn = lambda: worker.worker(
obj=CLIContext(app=celery, no_color=True, workdir=".", quiet=False),
args=[],
)

worker_thread = threading.Thread(target=worker_fn)
worker_thread.daemon = True
worker_thread.start()
else:
raise ValueError(backend)

Expand Down
4 changes: 3 additions & 1 deletion tox.ini
Expand Up @@ -38,9 +38,10 @@ envlist =
{py3.6,py3.7}-sanic-19

# TODO: Add py3.9
{pypy,py2.7}-celery-3
{pypy,py2.7,py3.5,py3.6}-celery-{4.1,4.2}
{pypy,py2.7,py3.5,py3.6,py3.7,py3.8}-celery-{4.3,4.4}
{pypy,py2.7}-celery-3
{py3.6,py3.7,py3.8}-celery-5.0

{py2.7,py3.7}-beam-{2.12,2.13}

Expand Down Expand Up @@ -138,6 +139,7 @@ deps =
celery-4.3: vine<5.0.0
# https://github.com/celery/celery/issues/6153
celery-4.4: Celery>=4.4,<4.5,!=4.4.4
celery-5.0: Celery>=5.0,<5.1

requests: requests>=2.0

Expand Down

0 comments on commit 867beae

Please sign in to comment.