This document describes the current stable version of Celery (5.1). For development docs, go here.
What’s new in Celery 5.0 (singularity)¶
Omer Katz (
omer.drow at gmail.com)
Celery is a simple, flexible, and reliable distributed programming framework to process vast amounts of messages, while providing operations with the tools required to maintain a distributed system with python.
It’s a task queue with focus on real-time processing, while also supporting task scheduling.
To read more about Celery you should go read the introduction.
While this version is mostly backward compatible with previous versions it’s important that you read the following section as this release is a new major version.
This version is officially supported on CPython 3.6, 3.7 & 3.8 and is also supported on PyPy3.
Table of Contents
Make sure you read the important notes before upgrading to this version.
The 5.0.0 release is a new major release for Celery.
Starting from now users should expect more frequent releases of major versions as we move fast and break things to bring you even better experience.
This version drops support for Python 2.7.x which has reached EOL in January 1st, 2020. This allows us, the maintainers to focus on innovating without worrying for backwards compatibility.
From now on we only support Python 3.6 and above. We will maintain compatibility with Python 3.6 until it’s EOL in December, 2021.
— Omer Katz
As we’d like to provide some time for you to transition, we’re designating Celery 4.x an LTS release. Celery 4.x will be supported until the 1st of August, 2021.
We will accept and apply patches for bug fixes and security issues. However, no new features will be merged for that version.
Celery 5.x is not an LTS release. We will support it until the release of Celery 6.x.
We’re in the process of defining our Long Term Support policy. Watch the next “What’s New” document for updates.
Artem Vasilyev <email@example.com> Ash Berlin-Taylor <firstname.lastname@example.org> Asif Saif Uddin (Auvi) <email@example.com> Asif Saif Uddin <firstname.lastname@example.org> Christian Clauss <email@example.com> Germain Chazot <firstname.lastname@example.org> Harry Moreno <email@example.com> kevinbai <firstname.lastname@example.org> Martin Paulus <email@example.com> Matus Valo <firstname.lastname@example.org> Matus Valo <email@example.com> maybe-sybr <firstname.lastname@example.org> Omer Katz <email@example.com> Patrick Cloke <firstname.lastname@example.org> qiaocc <email@example.com> Thomas Grainger <firstname.lastname@example.org> Weiliang Li <email@example.com>
This wall was automatically generated from git history, so sadly it doesn’t not include the people who help with more important things like answering mailing-list questions.
Celery 5.0 introduces a new CLI implementation which isn’t completely backwards compatible.
The global options can no longer be positioned after the sub-command. Instead, they must be positioned as an option for the celery command like so:
celery --app path.to.app worker
If you were using our Daemonization guide to deploy Celery in production, you should revisit it for updates.
If you haven’t already updated your configuration when you migrated to Celery 4.0, please do so now.
We elected to extend the deprecation period until 6.0 since we did not loudly warn about using these deprecated settings.
Please refer to the migration guide for instructions.
Make sure you are not affected by any of the important upgrade notes mentioned in the following section.
You should mainly verify that any of the breaking changes in the CLI do not affect you. Please refer to New Command Line Interface for details.
Celery 5.0 supports only Python 3. Therefore, you must ensure your code is compatible with Python 3.
If you haven’t ported your code to Python 3, you must do so before upgrading.
After the migration is done, run your test suite with Celery 4 to ensure nothing has been broken.
The supported Python Versions are:
PyPy3.6 7.2 (
Celery now requires Python 3.6 and above.
Python 2.7 has reached EOL in January 2020. In order to focus our efforts we have dropped support for Python 2.7 in this version.
In addition, Python 3.5 has reached EOL in September 2020. Therefore, we are also dropping support for Python 3.5.
If you still require to run Celery using Python 2.7 or Python 3.5 you can still use Celery 4.x. However we encourage you to upgrade to a supported Python version since no further security patches will be applied for Python 2.7 and as mentioned Python 3.5 is not supported for practical reasons.
Due to eventlet/eventlet#526 the minimum required version is eventlet 0.26.1.
The Couchbase result backend now uses the V3 Couchbase SDK.
As a result, we no longer support Couchbase Server 5.x.
Also, starting from this release, the minimum required version for the database client is couchbase 3.0.0.
To verify that your Couchbase Server is compatible with the V3 SDK, please refer to their documentation.
The Riak result backend has been removed as the database is no longer maintained.
The Python client only supports Python 3.6 and below which prevents us from supporting it and it is also unmaintained.
If you are still using Riak, refrain from upgrading to Celery 5.0 while you migrate your application to a different database.
We apologize for the lack of notice in advance but we feel that the chance you’ll be affected by this breaking change is minimal which is why we did it.
The celery.utils.encoding and the celery.task modules has been deprecated in version 4.0 and therefore are removed in 5.0.
If you were using the celery.utils.encoding module before, you should import kombu.utils.encoding instead.
If you were using the celery.task module before, you should import directly from the celery module instead.
The command line interface has been revamped using Click. As a result a few breaking changes has been introduced:
Postfix global options like celery worker –app path.to.app or celery worker –workdir /path/to/workdir are no longer supported. You should specify them as part of the global options of the main celery command.
celery amqp and celery shell require the repl sub command to start a shell. You can now also invoke specific commands without a shell. Type celery amqp –help or celery shell –help for details.
The API for adding user options has changed. Refer to the documentation for details.
Click provides shell completion out of the box. This functionality replaces our previous bash completion script and adds completion support for the zsh and fish shells.
The bash completion script was exported to extras/celery.bash for the packager’s convenience.
Starting from Celery 5.0, the pytest plugin is no longer enabled by default.
Please refer to the documentation for instructions.
Previously group results were not ordered by their invocation order. Celery 4.4.7 introduced an opt-in feature to make them ordered.
It is now an opt-out behavior.
If you were previously using the Redis result backend, you might need to opt-out of this behavior.
Please refer to the documentation for instructions on how to disable this feature.