Blob Blame History Raw
%bcond_without tests
# Packaging unstable?
%global prerel rc1
%global general_version 5.3.0
%global upstream_version %{general_version}%{?prerel}

Name:           python-celery
Version:        %{general_version}%{?prerel:~%{prerel}}
Release:        %autorelease
BuildArch:      noarch

License:        BSD
# Fix custom pytest markers for pytest
Source1:        pytest.ini
Summary:        Distributed Task Queue

An open source asynchronous task queue/job queue based on
distributed message passing. It is focused on real-time
operation, but supports scheduling as well.

The execution units, called tasks, are executed concurrently
on one or more worker nodes using multiprocessing, Eventlet
or gevent. Tasks can execute asynchronously (in the background)
or synchronously (wait until ready).

Celery is used in production systems to process millions of
tasks a day.

Celery is written in Python, but the protocol can be implemented
in any language. It can also operate with other languages using
web hooks.

The recommended message broker is RabbitMQ, but limited support
for Redis, Beanstalk, MongoDB, CouchDB and databases
(using SQLAlchemy or the Django ORM) is also available.

%package doc
Summary: Documentation for python-celery
License: CC-BY-SA

%description doc
Documentation for python-celery.

%package -n python3-celery
Summary:        Distributed Task Queue

# Requires are auto-generated from (and then from requirements/default.txt)

BuildRequires:  python3-devel
BuildRequires:  python3-setuptools

%if %{with tests}
BuildRequires:  python3-amqp
BuildRequires:  python3-billiard
BuildRequires:  python3-case
BuildRequires:  python3-cryptography
BuildRequires:  python3-click
BuildRequires:  python3-click-didyoumean
BuildRequires:  python3-click-plugins
BuildRequires:  python3-click-repl
BuildRequires:  python3-dns
BuildRequires:  python3-dateutil
BuildRequires:  python3-future
BuildRequires:  python3-kombu
BuildRequires:  python3-msgpack
BuildRequires:  python3-pytest
BuildRequires:  python3-pytest-click
BuildRequires:  python3-pytest-timeout
BuildRequires:  python3-pytest-subtests
BuildRequires:  python3-pytz
BuildRequires:  python3-pyyaml
BuildRequires:  python3-redis
BuildRequires:  python3-simplejson

%description -n python3-celery

%autosetup -p1 -n celery-%{upstream_version}

# Drop python tzdata requirement which doesn't make sense on Fedora
sed -i 's/tzdata>=2022.7//g' requirements/default.txt


#pushd docs
# missing python-sphinx_celery (for the moment)
#make %{?_smp_mflags} html

# fix custom celery markers in pytest
cp %{SOURCE1} .

pushd %{buildroot}%{_bindir}
mv celery celery-%{python3_version}
ln -s celery-%{python3_version} celery-3
ln -s celery-3 celery

# python-moto is not packaged in Fedora, ignore S3 tests
# mongodb is not packaged in Fedora, ignore mongodb tests
# pytest-celery is not packaged in Fedora, ignore integration test
%if %{with tests}
# cache tests
export TEST_BROKER=redis://
export TEST_BACKEND=cache+pylibmc://
%pytest --ignore=t/unit/backends/ --ignore=t/unit/backends/ --ignore=t/distro/ --ignore=t/integration/

# redis tests
export TEST_BROKER=redis://
export TEST_BACKEND=redis://
%pytest --ignore=t/unit/backends/ --ignore=t/unit/backends/ --ignore=t/distro/ --ignore=t/integration/

# rabbitmq tests
export TEST_BROKER=pyamqp://
export TEST_BACKEND=rpc
%pytest --ignore=t/unit/backends/ --ignore=t/unit/backends/ --ignore=t/distro/ --ignore=t/integration/

%files doc
%license LICENSE

%files -n python3-celery
%license LICENSE
%doc README.rst TODO CONTRIBUTORS.txt examples