First of all, great project :)
Currently the CLI reloader only allows specifying the base path path to watch for changes (--watch path/to/watch). However the watcher is configured so that it only listens to changes on *.py files (source code).
I would like to be able to use the reloader with changes to other files such as configuration files.
It might look like the following:
# cli.py
parser.add_argument(
"-i",
"--watch-include",
action="append",
dest="include_patterns",
help="Additional patterns to watch for changes",
)
parser.add_argument(
"-x",
"--watch-exclude",
action="append",
dest="exclude_patterns",
help="Patterns to ignore for changes",
)
Which would then be used like:
dramatiq [...] --watch path/to/watch -i *.yml -i templates/*.html -x templates/*.png
Aside: in documentation / help strings it might be worth noting that prior to Python 3.13 these patterns only support multiple name (**) globbing at the start of the pattern (ref)
First of all, great project :)
Currently the CLI reloader only allows specifying the base path path to watch for changes (
--watch path/to/watch). However the watcher is configured so that it only listens to changes on*.pyfiles (source code).I would like to be able to use the reloader with changes to other files such as configuration files.
It might look like the following:
Which would then be used like:
Aside: in documentation / help strings it might be worth noting that prior to Python 3.13 these patterns only support multiple name (
**) globbing at the start of the pattern (ref)