From 2013478ff268cfe34fc82694a2bd54a58c696ef55ef0c0d09de1cb3de9da2ac9 Mon Sep 17 00:00:00 2001 From: Daniel Garcia Date: Mon, 29 May 2023 15:43:35 +0000 Subject: [PATCH 1/2] - Add sqlalchemy-2.0.patch to support latest version of sqlalchemy. gh#celery/celery#8271 OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/python-celery?expand=0&rev=151 --- python-celery.changes | 6 ++++++ python-celery.spec | 6 ++++-- sqlalchemy-2.0.patch | 19 +++++++++++++++++++ 3 files changed, 29 insertions(+), 2 deletions(-) create mode 100644 sqlalchemy-2.0.patch diff --git a/python-celery.changes b/python-celery.changes index da2717f..d054aa6 100644 --- a/python-celery.changes +++ b/python-celery.changes @@ -1,3 +1,9 @@ +------------------------------------------------------------------- +Mon May 29 15:38:50 UTC 2023 - Daniel Garcia + +- Add sqlalchemy-2.0.patch to support latest version of sqlalchemy. + gh#celery/celery#8271 + ------------------------------------------------------------------- Tue Mar 28 09:19:04 UTC 2023 - Dirk Müller diff --git a/python-celery.spec b/python-celery.spec index 3aa9623..8e2f59f 100644 --- a/python-celery.spec +++ b/python-celery.spec @@ -16,7 +16,6 @@ # -%{?!python_module:%define python_module() python-%{**} python3-%{**}} %define skip_python2 1 %global flavor @BUILD_FLAVOR@%{nil} %if "%{flavor}" == "test" @@ -39,6 +38,8 @@ Patch1: tests.patch # PATCH-FIX-UPSTREAM compatibility with newer billiard Patch2: https://github.com/celery/celery/commit/b260860988469ef8ad74f2d4225839c2fa91d590.patch Patch3: https://github.com/celery/celery/commit/879af6341974c3778077d8212d78f093b2d77a4f.patch +# PATCH-FIX-UPSTREAM sqlalchemy-2.0.patch -- gh#celery/celery#8271 +Patch4: sqlalchemy-2.0.patch BuildRequires: %{python_module setuptools} BuildRequires: fdupes BuildRequires: netcfg @@ -122,7 +123,8 @@ scheduling as well. %python_uninstall_alternative celery %files %{python_files} -%{python_sitelib}/* +%{python_sitelib}/celery +%{python_sitelib}/celery-%{version}*-info %license LICENSE %doc README.rst TODO %python_alternative %{_bindir}/celery diff --git a/sqlalchemy-2.0.patch b/sqlalchemy-2.0.patch new file mode 100644 index 0000000..875226f --- /dev/null +++ b/sqlalchemy-2.0.patch @@ -0,0 +1,19 @@ +Index: celery-5.2.7/t/unit/backends/test_database.py +=================================================================== +--- celery-5.2.7.orig/t/unit/backends/test_database.py ++++ celery-5.2.7/t/unit/backends/test_database.py +@@ -410,7 +410,13 @@ class test_SessionManager: + from sqlalchemy.dialects.sqlite import dialect + from sqlalchemy.exc import DatabaseError + +- sqlite = dialect.dbapi() ++ if hasattr(dialect, 'dbapi'): ++ # Method name in SQLAlchemy < 2.0 ++ sqlite = dialect.dbapi() ++ else: ++ # Newer method name in SQLAlchemy 2.0 ++ sqlite = dialect.import_dbapi() ++ + manager = SessionManager() + engine = manager.get_engine('dburi') + From d0bb7d5d06bd3c21d788e3f3fd50d4cd3b9cbb92dfb2334a78b383002cc8d7ee Mon Sep 17 00:00:00 2001 From: Dirk Mueller Date: Tue, 30 May 2023 19:15:18 +0000 Subject: [PATCH 2/2] OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/python-celery?expand=0&rev=152 --- 879af6341974c3778077d8212d78f093b2d77a4f.patch | 8 ++++---- b260860988469ef8ad74f2d4225839c2fa91d590.patch | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/879af6341974c3778077d8212d78f093b2d77a4f.patch b/879af6341974c3778077d8212d78f093b2d77a4f.patch index 35f94ec..2eaf0eb 100644 --- a/879af6341974c3778077d8212d78f093b2d77a4f.patch +++ b/879af6341974c3778077d8212d78f093b2d77a4f.patch @@ -12,7 +12,7 @@ Subject: [PATCH] Fixed error handling bugs due to upgrade to a newer version 4 files changed, 23 insertions(+), 12 deletions(-) diff --git a/celery/app/task.py b/celery/app/task.py -index 212bc772e0..d6108fbef8 100644 +index 212bc772e01..d6108fbef8c 100644 --- a/celery/app/task.py +++ b/celery/app/task.py @@ -1,7 +1,7 @@ @@ -34,7 +34,7 @@ index 212bc772e0..d6108fbef8 100644 return retval.sig.apply(retries=retries + 1) state = states.SUCCESS if ret.info is None else ret.info.state diff --git a/celery/worker/request.py b/celery/worker/request.py -index d89971468c..d0004a19cc 100644 +index d89971468c6..d0004a19ccc 100644 --- a/celery/worker/request.py +++ b/celery/worker/request.py @@ -10,6 +10,7 @@ @@ -85,7 +85,7 @@ index d89971468c..d0004a19cc 100644 task_ready(self) diff --git a/t/unit/utils/test_collections.py b/t/unit/utils/test_collections.py -index ce776cebf1..aae685ebc7 100644 +index ce776cebf1a..aae685ebc7c 100644 --- a/t/unit/utils/test_collections.py +++ b/t/unit/utils/test_collections.py @@ -145,8 +145,8 @@ def test_exception_info(self): @@ -100,7 +100,7 @@ index ce776cebf1..aae685ebc7 100644 assert repr(einfo) diff --git a/t/unit/worker/test_request.py b/t/unit/worker/test_request.py -index a34f70dc80..b818f2837c 100644 +index a34f70dc80d..b818f2837cc 100644 --- a/t/unit/worker/test_request.py +++ b/t/unit/worker/test_request.py @@ -155,7 +155,7 @@ def test_execute_jail_failure(self): diff --git a/b260860988469ef8ad74f2d4225839c2fa91d590.patch b/b260860988469ef8ad74f2d4225839c2fa91d590.patch index be27bcc..257a9d8 100644 --- a/b260860988469ef8ad74f2d4225839c2fa91d590.patch +++ b/b260860988469ef8ad74f2d4225839c2fa91d590.patch @@ -11,7 +11,7 @@ We should adjust the code in Celery as well. 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/celery/concurrency/asynpool.py b/celery/concurrency/asynpool.py -index b9f2875a26..489336936c 100644 +index b9f2875a261..489336936c1 100644 --- a/celery/concurrency/asynpool.py +++ b/celery/concurrency/asynpool.py @@ -26,7 +26,7 @@