← 输入框|github.com|刷新
Skip to content

Allow configuring hot reload paths #318

Closed

Description

@kyboi

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.

Activity

  1. s3rius commented on Apr 28, 2024

    @s3rius
    Member

    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.

  2. Exagone313 commented on Jul 27, 2025

    @Exagone313

    Also note that the gitignore_parser library doesn't support the gitignore format completely, e.g. mherrmann/gitignore_parser#43

  3. danfimov commented on Dec 1, 2025

    @danfimov
    Member

    Seems like --reload-dir argument solve this issue. For more information you can check documentation about hot reload.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions