-
Notifications
You must be signed in to change notification settings - Fork 17
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
Upgrade to Uvicorn 0.15 and implement new reload options #39
Conversation
This commit will implement the new Uvicorn 0.15 reload options: - `reload_delay` (env: `RELOAD_DELAY`, CLI: `--reload-delay`) - `reload_excludes` (env: `RELOAD_EXCLUDES`, CLI: `--reload-exclude`) - `reload_includes` (env: `RELOAD_INCLUDES`, CLI: `--reload-include`) The following auxiliary updates will also be made: - Move the string splitting logic previously used for `reload_dirs` into a separate helper method in `start.py` to avoid code duplication - Move the Uvicorn options customized for testing into a class attribute on `test_start.py::TestSetUvicornOptions` - Remove unnecessary test assertions (such as asserting that monkeypatch actually sets environment variables) - Parametrize tests with tuples instead of lists (lists unnecessary)
This commit will document the new Uvicorn 0.15 reload options: - `reload_delay` (env: `RELOAD_DELAY`, CLI: `--reload-delay`) - `reload_excludes` (env: `RELOAD_EXCLUDES`, CLI: `--reload-exclude`) - `reload_includes` (env: `RELOAD_INCLUDES`, CLI: `--reload-include`)
This pull request is being automatically deployed with Vercel (learn more). 🔍 Inspect: https://vercel.com/br3ndonland/inboard/5haxC2uzy9QxrWZrGZKeCiiKdnxH |
Codecov Report
@@ Coverage Diff @@
## develop #39 +/- ##
=========================================
Coverage 100.00% 100.00%
=========================================
Files 10 10
Lines 271 276 +5
=========================================
+ Hits 271 276 +5
Flags with carried forward coverage won't be shown. Click here to find out more.
Continue to review full report at Codecov.
|
be4088f
to
e37f2b1
Compare
* 'Refactored by Sourcery' * Fix formatting of @sourcery-ai[bot] refactoring #40 The Sourcery refactoring is acceptable, but code was not formatted with Black. This commit will fix the formatting to pass the pre-commit hooks. Co-authored-by: Sourcery AI <> Co-authored-by: Brendon Smith <bws@bws.bio>
e37f2b1
to
75b81a4
Compare
Sourcery Code Quality Report✅ Merging this PR will increase code quality in the affected files by 0.54%.
Here are some functions in these files that still need a tune-up:
Legend and ExplanationThe emojis denote the absolute quality of the code:
The 👍 and 👎 indicate whether the quality has improved or gotten worse with this pull request. Please see our documentation here for details on how these metrics are calculated. We are actively working on this report - lots more documentation and extra metrics to come! Help us improve this quality report! |
#21 #39 #41 PR #21 introduced support for the `reload_dirs` Uvicorn option. In order to support this option, the `RELOAD_DIRS` environment variable was split into a list of directories to watch and reload. This commit will clarify the syntax used to split the variable value. Rather than using single-letter variable names, the names will be: - `option`: environment variable key - `option_value`: environment variable value - `option_item`: each item in value after it has been split into a list
Description
PR #21 implemented the Uvicorn
reload_dirs
setting, enabling file watching and hot-reloading with watchgod for development.In encode/uvicorn#820 and Uvicorn 0.15, additional reload configuration options were added:
reload_delay
(CLI equivalent:--reload-delay
)reload_excludes
(CLI equivalent:--reload-exclude
)reload_includes
(CLI equivalent:--reload-include
)This PR will implement the new Uvicorn reload options. The options will be configured with the following environment variables:
RELOAD_DELAY
RELOAD_EXCLUDES
RELOAD_INCLUDES
Changes
Related
#21
encode/uvicorn#820
https://github.com/encode/uvicorn/releases/tag/0.15.0