Bogdanp / django_dramatiq

A Django app that integrates with Dramatiq.
https://dramatiq.io
Other
331 stars 77 forks source link

Support ignore modules with a wildcard #94

Closed ashleybartlett closed 3 years ago

ashleybartlett commented 3 years ago

I have a case where we have tasks in a submodule, then our tests below that, I want to ignore those tests without having to define each one.

I also found a bug where in multi-recursive sub modules would duplicate discovered tasks when we handled sub modules. This looks like it is due ot the the is_pkg flag, which appears to refers to a __init__.py file, rather than a new sub folder. As walk_packages is already recursive, this was unnecessary.

The wildcard detection is done in such a way to be backwards compatible. So it may be a bit awkward as you will need to ignore the specific module, and have a wildcard ignore for sub modules.

The last thing was a fix for Django 3.2 compatibility as it now auto-discovers apps.py files, and was complaining about the name variable not matching.