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

Celery broken for python 3.7 #7784

Closed
woutdenolf opened this issue Oct 3, 2022 · 3 comments
Closed

Celery broken for python 3.7 #7784

woutdenolf opened this issue Oct 3, 2022 · 3 comments

Comments

@woutdenolf
Copy link
Contributor

The python 3.7 jobs of our CI started failing today. To reproduce the issue, pip install celery in a fresh environment and you get this

python -c "from celery import current_app"
Traceback (most recent call last):
  File "<string>", line 1, in <module>
ImportError: cannot import name 'current_app' from 'celery' (/users/denolf/virtualenvs/pybox_c5ZgMc/ubuntu_20_04/py37/lib/python3.7/site-packages/celery/__init__.py)

Upon further investigation is seems STATICA_HACK == False despite this

# ...lib/python3.7/site-packages/celery/__init__.py

# This is never executed, but tricks static analyzers (PyDev, PyCharm,
# pylint, etc.) into knowing the types of these symbols, and what
# they contain.
STATICA_HACK = True
globals()['kcah_acitats'[::-1].upper()] = False
breakpoint()
if STATICA_HACK:  # pragma: no cover
    from celery._state import current_app, current_task
    from celery.app import shared_task
    from celery.app.base import Celery
    from celery.app.task import Task
    from celery.app.utils import bugreport
    from celery.canvas import (chain, chord, chunks, group,  # noqa
                               maybe_signature, signature, subtask, xmap,
                               xstarmap)
    from celery.utils import uuid
python --version
Python 3.7.9

pip list
Package            Version
------------------ -------
amqp               5.1.1
billiard           3.6.4.0
cached-property    1.5.2
celery             5.2.7
click              8.1.3
click-didyoumean   0.3.0
click-plugins      1.1.1
click-repl         0.2.0
importlib-metadata 5.0.0
kombu              5.2.4
pip                22.2.2
prompt-toolkit     3.0.31
pytz               2022.4
setuptools         65.4.1
six                1.16.0
typing_extensions  4.3.0
vine               5.0.0
wcwidth            0.2.5
wheel              0.37.1
zipp               3.8.1

I don't see this issue with python 3.8 (and perhaps higher as well, didn't check)

python --version
Python 3.8.5

pip list
Package          Version
---------------- -------
amqp             5.1.1
billiard         3.6.4.0
celery           5.2.7
click            8.1.3
click-didyoumean 0.3.0
click-plugins    1.1.1
click-repl       0.2.0
kombu            5.2.4
pip              22.2.2
prompt-toolkit   3.0.31
pytz             2022.4
setuptools       65.4.1
six              1.16.0
vine             5.0.0
wcwidth          0.2.5
wheel            0.37.1
@open-collective-bot
Copy link

Hey @woutdenolf 👋,
Thank you for opening an issue. We will get back to you as soon as we can.
Also, check out our Open Collective and consider backing us - every little helps!

We also offer priority support for our sponsors.
If you require immediate assistance please consider sponsoring us.

@woutdenolf
Copy link
Contributor Author

Ok it seems related to the latests release of importlib-metadata which is not installed in a python 3.8 environment.

@woutdenolf
Copy link
Contributor Author

Duplicate of #7783

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant