Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

increase celery dep #84

Merged
merged 3 commits into from
Feb 19, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
#
# This file is part of Invenio.
# Copyright (C) 2015-2018 CERN.
# Copyright (C) 2022 Graz University of Technology.
# Copyright (C) 2022-2024 Graz University of Technology.
#
# Invenio is free software; you can redistribute it and/or modify it
# under the terms of the MIT License; see LICENSE file for more details.
Expand Down Expand Up @@ -316,7 +316,9 @@


# Example configuration for intersphinx: refer to the Python standard library.
intersphinx_mapping = {"https://docs.python.org/": None}
intersphinx_mapping = {
"python": ("https://docs.python.org/", None),
}

# Autodoc configuraton.
autoclass_content = "both"
4 changes: 2 additions & 2 deletions setup.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
#
# This file is part of Invenio.
# Copyright (C) 2015-2018 CERN.
# Copyright (C) 2022 Graz University of Technology.
# Copyright (C) 2022-2024 Graz University of Technology.
#
# Invenio is free software; you can redistribute it and/or modify it
# under the terms of the MIT License; see LICENSE file for more details.
Expand Down Expand Up @@ -37,7 +37,7 @@ install_requires =

[options.extras_require]
tests =
pytest-black>=0.3.0,<0.3.10
pytest-black-ng>=0.4.0
pytest-invenio>=1.4.0
Sphinx>=5.0.0,<6.0.0
# Kept for backwards compatibility
Expand Down
42 changes: 22 additions & 20 deletions tests/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
#
# This file is part of Invenio.
# Copyright (C) 2015-2018 CERN.
# Copyright (C) 2024 Graz University of Technology.
#
# Invenio is free software; you can redistribute it and/or modify it
# under the terms of the MIT License; see LICENSE file for more details.
Expand All @@ -13,12 +14,13 @@

import sys

import celery._state
import pytest
from celery import Celery, shared_task
from flask import Flask


@pytest.yield_fixture()
@pytest.fixture()
def app(request):
"""Flask app fixture."""
app = Flask("testapp")
Expand All @@ -38,22 +40,22 @@ def shared_compute():
"""Dummy function."""
pass

yield app

import celery._state

celery._state._apps.discard(
app.extensions["invenio-celery"].celery._get_current_object()
)
celery._state._on_app_finalizers = set()
celery._state.set_default_app(Celery())

# Clear our modules to get them re-imported by Celery.
pkgs = [
"bpackage.first_tasks",
"bpackage.second_tasks",
"apackage.third_tasks",
]
for pkg in pkgs:
if pkg in sys.modules:
del sys.modules[pkg]
def set_celery_state():
celery._state._apps.discard(
app.extensions["invenio-celery"].celery._get_current_object()
)
celery._state._on_app_finalizers = set()
celery._state.set_default_app(Celery())

# Clear our modules to get them re-imported by Celery.
pkgs = [
"bpackage.first_tasks",
"bpackage.second_tasks",
"apackage.third_tasks",
]
for pkg in pkgs:
if pkg in sys.modules:
del sys.modules[pkg]

request.addfinalizer(set_celery_state)
return app
Loading