celery-singleton icon indicating copy to clipboard operation
celery-singleton copied to clipboard

Optional setting `single_json_encoder_class`: Set `json`-compatible encoder class to `generate_lock()`

Open tony opened this issue 3 years ago • 3 comments

Fixes cases such as #42 #36

json.dumps() accepts an optional cls of a jsonJSONEncoder

This matches the intention of the json library.

This is great for cases where users use a celery backend that supports passing uuid.UUID arguments and simply needs to cast. Many codebases already have an encoder for such purposes, some major packages have them such as django.core.serializers.json.DjangoJSONEncoder

tony avatar Feb 23 '22 21:02 tony

@steinitzu Is it possible you could give this a peak?

Can you also fix master's tests?

tony avatar Feb 24 '22 00:02 tony

@steinitzu Any update on this? Can you take a look?

tony avatar May 24 '22 11:05 tony

@steinitzu Also giving another ping and letting you know I'd love for you to take a look at this

Thank you!

tony avatar Sep 01 '22 17:09 tony

@steinitzu Rebased after 35a16b2 ✅

tony avatar Oct 02 '22 15:10 tony

Merging this as is. I'll fix the tests in a separate PR, they have other unrelated issues.

steinitzu avatar Oct 02 '22 16:10 steinitzu

@steinitzu Thank you!

tony avatar Oct 02 '22 16:10 tony

I'll fix the tests in a separate PR, they have other unrelated issues.

P.S. If you're interested in a CI setup for django + github actions, I have two examples you can use (MIT licensed):

  • django-slugify-processor:

    • GH Action: https://github.com/tony/django-slugify-processor/blob/v1.3.1a0/.github/workflows/tests.yml
    • pytest config: https://github.com/tony/django-slugify-processor/blob/v1.3.1a0/setup.cfg#L23-L32
  • django-docutils

    • GH Action: https://github.com/tony/django-docutils/blob/v0.9.0/.github/workflows/tests.yml
    • pytest config: https://github.com/tony/django-docutils/blob/v0.9.0/setup.cfg#L26-L34

tony avatar Oct 02 '22 16:10 tony