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

Allow configuring hot reload paths #318

Open
kyboi opened this issue Apr 26, 2024 · 1 comment
Open

Allow configuring hot reload paths #318

kyboi opened this issue Apr 26, 2024 · 1 comment

Comments

@kyboi
Copy link

kyboi commented Apr 26, 2024

Currently using --reload argument will take into account .gitignore, but there are files that will trigger a reload even when it isn't necessary. These files must be in the repo so can't be added to the ignore, e.g. docker configuration files.

Perhaps something like uvicorn does, with watchfiles:

https://github.com/encode/uvicorn/blob/master/uvicorn/supervisors/watchfilesreload.py

--reload                        Enable auto-reload.
--reload-dir PATH               Set reload directories explicitly, instead
                                  of using the current working directory.
--reload-include TEXT           Set glob patterns to include while watching
                                  for files. Includes '*.py' by default; these
                                  defaults can be overridden with `--reload-
                                  exclude`. This option has no effect unless
                                  watchfiles is installed.
--reload-exclude TEXT           Set glob patterns to exclude while watching
                                  for files. Includes '.*, .py[cod], .sw.*,
                                  ~*' by default; these defaults can be
                                  overridden with `--reload-include`. This
                                  option has no effect unless watchfiles is
                                  installed.
@s3rius
Copy link
Member

s3rius commented Apr 28, 2024

That might be a good idea. Actually I'd want to implement it the way gunicorn did. Then actually check all files that are actually used by your python project and trigger reload only one of them has changed. Which might be a better fit.

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

No branches or pull requests

2 participants