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

[DONE] update celery to 5.4.0 #1127

Merged
merged 1 commit into from
May 15, 2024
Merged

Conversation

azmeuk
Copy link
Contributor

@azmeuk azmeuk commented May 15, 2024

Update celery to v5.4.0 to fix bugs I met while writing tests for #1058.

Related changelog

I removed the billiard and vine requirements, as they are not directly called in the code, and the versions are already constrained since those are dependencies of celery.

For the record, the traceback of the exception I met
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/home/eloi/.virtualenvs/esup-pod-acfu/lib/python3.12/site-packages/celery/app/base.py", line 1250, in backend
    return self._local.backend
           ^^^^^^^^^^^^^^^^^^^
AttributeError: '_thread._local' object has no attribute 'backend'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/home/eloi/dev/yaal/esup-pod/pod/activitypub/tests/test_federation.py", line 107, in test_follow_accept
    response = self.client.post(
               ^^^^^^^^^^^^^^^^^
  File "/home/eloi/.virtualenvs/esup-pod-acfu/lib/python3.12/site-packages/django/test/client.py", line 751, in post
    response = super().post(path, data=data, content_type=content_type, secure=secure, **extra)
               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/eloi/.virtualenvs/esup-pod-acfu/lib/python3.12/site-packages/django/test/client.py", line 407, in post
    return self.generic('POST', path, post_data, content_type,
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/eloi/.virtualenvs/esup-pod-acfu/lib/python3.12/site-packages/django/test/client.py", line 473, in generic
    return self.request(**r)
           ^^^^^^^^^^^^^^^^^
  File "/home/eloi/.virtualenvs/esup-pod-acfu/lib/python3.12/site-packages/django/test/client.py", line 719, in request
    self.check_exception(response)
  File "/home/eloi/.virtualenvs/esup-pod-acfu/lib/python3.12/site-packages/django/test/client.py", line 580, in check_exception
    raise exc_value
  File "/home/eloi/.virtualenvs/esup-pod-acfu/lib/python3.12/site-packages/django/core/handlers/exception.py", line 47, in inner
    response = get_response(request)
               ^^^^^^^^^^^^^^^^^^^^^
  File "/home/eloi/.virtualenvs/esup-pod-acfu/lib/python3.12/site-packages/django/core/handlers/base.py", line 181, in _get_response
    response = wrapped_callback(request, *callback_args, **callback_kwargs)
               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/eloi/.virtualenvs/esup-pod-acfu/lib/python3.12/site-packages/django/views/decorators/csrf.py", line 54, in wrapped_view
    return view_func(*args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/eloi/dev/yaal/esup-pod/pod/activitypub/views.py", line 184, in inbox
    task_send_accept_request.delay(
  File "/home/eloi/.virtualenvs/esup-pod-acfu/lib/python3.12/site-packages/celery/app/task.py", line 425, in delay
    return self.apply_async(args, kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/eloi/.virtualenvs/esup-pod-acfu/lib/python3.12/site-packages/celery/app/task.py", line 572, in apply_async
    return self.apply(args, kwargs, task_id=task_id or uuid(),
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/eloi/.virtualenvs/esup-pod-acfu/lib/python3.12/site-packages/celery/app/task.py", line 793, in apply
    ret = tracer(task_id, args, kwargs, request)
          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/eloi/.virtualenvs/esup-pod-acfu/lib/python3.12/site-packages/celery/app/trace.py", line 518, in trace_task
    task.backend.mark_as_done(
    ^^^^^^^^^^^^
  File "/home/eloi/.virtualenvs/esup-pod-acfu/lib/python3.12/site-packages/celery/app/task.py", line 1091, in backend
    return self.app.backend
           ^^^^^^^^^^^^^^^^
  File "/home/eloi/.virtualenvs/esup-pod-acfu/lib/python3.12/site-packages/celery/app/base.py", line 1252, in backend
    self._local.backend = new_backend = self._get_backend()
                                        ^^^^^^^^^^^^^^^^^^^
  File "/home/eloi/.virtualenvs/esup-pod-acfu/lib/python3.12/site-packages/celery/app/base.py", line 955, in _get_backend
    backend, url = backends.by_url(
                   ^^^^^^^^^^^^^^^^
  File "/home/eloi/.virtualenvs/esup-pod-acfu/lib/python3.12/site-packages/celery/app/backends.py", line 69, in by_url
    return by_name(backend, loader), url
           ^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/eloi/.virtualenvs/esup-pod-acfu/lib/python3.12/site-packages/celery/app/backends.py", line 47, in by_name
    aliases.update(load_extension_class_names(extension_namespace))
  File "/home/eloi/.virtualenvs/esup-pod-acfu/lib/python3.12/site-packages/celery/utils/imports.py", line 145, in load_extension_class_names
    for ep in entry_points().get(namespace, []):
              ^^^^^^^^^^^^^^^^^^
AttributeError: 'EntryPoints' object has no attribute 'get'

----------------------------------------------------------------------
  • You have read our contribution guidelines.
  • Your PR targets the develop branch.
  • The title of your PR starts with [WIP] or [DONE].

Copy link
Contributor

@ptitloup ptitloup left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ok pour moi

@ptitloup
Copy link
Contributor

les tests d'encodage et de transcription via celery passent bien donc ok pour moi

@ptitloup ptitloup merged commit d86cbee into EsupPortail:develop May 15, 2024
3 checks passed
@azmeuk azmeuk deleted the celery branch May 15, 2024 12:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants