From 140d1ecf9da712d71cfaad355ae82b329fbdd8de Mon Sep 17 00:00:00 2001 From: Adrian Moennich Date: Tue, 10 Oct 2023 11:26:08 +0200 Subject: [PATCH] Fix compatibility with flask 3 --- citadel/README.md | 4 ++++ citadel/indico_citadel/util.py | 4 ++-- citadel/pytest.ini | 1 - citadel/setup.cfg | 4 ++-- livesync/pytest.ini | 1 - payment_paypal/pytest.ini | 1 - prometheus/pytest.ini | 1 - storage_s3/pytest.ini | 1 - vc_zoom/pytest.ini | 1 - 9 files changed, 8 insertions(+), 10 deletions(-) diff --git a/citadel/README.md b/citadel/README.md index 617c7cd..1bb3550 100644 --- a/citadel/README.md +++ b/citadel/README.md @@ -5,6 +5,10 @@ to provide advanced search functionality using an Elasticsearch backend. ## Changelog +### 3.3 + +- Adapt to Indico 3.3 changes + ### 3.2.2 - Adapt to Indico 3.2.6 changes diff --git a/citadel/indico_citadel/util.py b/citadel/indico_citadel/util.py index 857c4e5..0ec95fc 100644 --- a/citadel/indico_citadel/util.py +++ b/citadel/indico_citadel/util.py @@ -12,7 +12,7 @@ from collections import defaultdict from functools import wraps from flask import current_app -from flask.globals import _app_ctx_stack +from flask.globals import _cv_app from indico.core.db import db from indico.core.db.sqlalchemy.principals import PrincipalMixin, PrincipalPermissionsMixin, PrincipalType @@ -29,7 +29,7 @@ def parallelize(func, entries, batch_size=200): finished = threading.Event() results = [] app = current_app._get_current_object() - main_app_context = _app_ctx_stack.top + main_app_context = _cv_app.get(None) worker_exc_info = None def worker(iterator): diff --git a/citadel/pytest.ini b/citadel/pytest.ini index c8baed0..2235e7b 100644 --- a/citadel/pytest.ini +++ b/citadel/pytest.ini @@ -8,7 +8,6 @@ indico_plugins = livesync citadel ; fail if there are warnings, but ignore ones that are likely just noise filterwarnings = error - ignore:.*_app_ctx_stack.*:DeprecationWarning ignore::sqlalchemy.exc.SAWarning ignore::UserWarning ignore:Creating a LegacyVersion has been deprecated:DeprecationWarning diff --git a/citadel/setup.cfg b/citadel/setup.cfg index 2b04a9a..15fdf78 100644 --- a/citadel/setup.cfg +++ b/citadel/setup.cfg @@ -1,6 +1,6 @@ [metadata] name = indico-plugin-citadel -version = 3.2.2 +version = 3.3-dev description = Indico search+livesync backend using Citadel+ElasticSearch long_description = file: README.md long_description_content_type = text/markdown; charset=UTF-8; variant=GFM @@ -23,7 +23,7 @@ zip_safe = false include_package_data = true python_requires = >=3.9.0, <3.13 install_requires = - indico>=3.2.6 + indico>=3.3.dev0 indico-plugin-livesync>=3.2.1 [options.entry_points] diff --git a/livesync/pytest.ini b/livesync/pytest.ini index 42b005f..aa53f70 100644 --- a/livesync/pytest.ini +++ b/livesync/pytest.ini @@ -8,7 +8,6 @@ indico_plugins = livesync ; fail if there are warnings, but ignore ones that are likely just noise filterwarnings = error - ignore:.*_app_ctx_stack.*:DeprecationWarning ignore::sqlalchemy.exc.SAWarning ignore::UserWarning ignore:Creating a LegacyVersion has been deprecated:DeprecationWarning diff --git a/payment_paypal/pytest.ini b/payment_paypal/pytest.ini index c6898ee..cb103c3 100644 --- a/payment_paypal/pytest.ini +++ b/payment_paypal/pytest.ini @@ -8,7 +8,6 @@ indico_plugins = payment_paypal ; fail if there are warnings, but ignore ones that are likely just noise filterwarnings = error - ignore:.*_app_ctx_stack.*:DeprecationWarning ignore::sqlalchemy.exc.SAWarning ignore::UserWarning ignore:Creating a LegacyVersion has been deprecated:DeprecationWarning diff --git a/prometheus/pytest.ini b/prometheus/pytest.ini index 9ed20ea..02f116c 100644 --- a/prometheus/pytest.ini +++ b/prometheus/pytest.ini @@ -8,7 +8,6 @@ indico_plugins = livesync prometheus ; fail if there are warnings, but ignore ones that are likely just noise filterwarnings = error - ignore:.*_app_ctx_stack.*:DeprecationWarning ignore::sqlalchemy.exc.SAWarning ignore::UserWarning ignore:Creating a LegacyVersion has been deprecated:DeprecationWarning diff --git a/storage_s3/pytest.ini b/storage_s3/pytest.ini index f35e126..dc5fb25 100644 --- a/storage_s3/pytest.ini +++ b/storage_s3/pytest.ini @@ -8,7 +8,6 @@ indico_plugins = storage_s3 ; fail if there are warnings, but ignore ones that are likely just noise filterwarnings = error - ignore:.*_app_ctx_stack.*:DeprecationWarning ignore::sqlalchemy.exc.SAWarning ignore::UserWarning ignore:Creating a LegacyVersion has been deprecated:DeprecationWarning diff --git a/vc_zoom/pytest.ini b/vc_zoom/pytest.ini index cb0d750..02e28ae 100644 --- a/vc_zoom/pytest.ini +++ b/vc_zoom/pytest.ini @@ -8,7 +8,6 @@ indico_plugins = vc_zoom ; fail if there are warnings, but ignore ones that are likely just noise filterwarnings = error - ignore:.*_app_ctx_stack.*:DeprecationWarning ignore::sqlalchemy.exc.SAWarning ignore::UserWarning ignore:Creating a LegacyVersion has been deprecated:DeprecationWarning