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
Add test to check if run()
matches Config.__init__()
#1545
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -218,9 +218,9 @@ def __init__( | |
http: Union[Type[asyncio.Protocol], HTTPProtocolType] = "auto", | ||
ws: Union[Type[asyncio.Protocol], WSProtocolType] = "auto", | ||
ws_max_size: int = 16 * 1024 * 1024, | ||
ws_ping_interval: Optional[float] = 20, | ||
ws_ping_timeout: Optional[float] = 20, | ||
ws_per_message_deflate: Optional[bool] = True, | ||
ws_ping_interval: Optional[float] = 20.0, | ||
ws_ping_timeout: Optional[float] = 20.0, | ||
ws_per_message_deflate: bool = True, | ||
Kludex marked this conversation as resolved.
Show resolved
Hide resolved
|
||
lifespan: LifespanType = "auto", | ||
env_file: Optional[Union[str, os.PathLike]] = None, | ||
log_config: Optional[Union[Dict[str, Any], str]] = LOGGING_CONFIG, | ||
|
@@ -231,7 +231,7 @@ def __init__( | |
debug: bool = False, | ||
reload: bool = False, | ||
reload_dirs: Optional[Union[List[str], str]] = None, | ||
reload_delay: Optional[float] = None, | ||
reload_delay: float = 0.25, | ||
Kludex marked this conversation as resolved.
Show resolved
Hide resolved
|
||
reload_includes: Optional[Union[List[str], str]] = None, | ||
reload_excludes: Optional[Union[List[str], str]] = None, | ||
workers: Optional[int] = None, | ||
|
@@ -245,7 +245,7 @@ def __init__( | |
backlog: int = 2048, | ||
timeout_keep_alive: int = 5, | ||
timeout_notify: int = 30, | ||
callback_notify: Callable[..., Awaitable[None]] = None, | ||
callback_notify: Optional[Callable[..., Awaitable[None]]] = None, | ||
ssl_keyfile: Optional[str] = None, | ||
ssl_certfile: Optional[Union[str, os.PathLike]] = None, | ||
ssl_keyfile_password: Optional[str] = None, | ||
|
@@ -277,7 +277,7 @@ def __init__( | |
self.interface = interface | ||
self.debug = debug | ||
self.reload = reload | ||
self.reload_delay = reload_delay or 0.25 | ||
self.reload_delay = reload_delay | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. There's no need to accept There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I agree it's cleaner but what if someone explicitly called it with There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. AFAIC, we shouldn't check a behavior that it's not allowed by the input, considering the type hint. I mean, But... As you've pointed out, this is a breaking change, and I don't want to add breaking changes on this PR. 😅 I'll revert this change, and adapt the There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Ok. I thought about it... Yep, you're right. I'll follow the path you suggested and add a note on the changelog about this. |
||
self.workers = workers or 1 | ||
self.proxy_headers = proxy_headers | ||
self.server_header = server_header | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
timeout_notify
andcallback_notify
are not available viarun()
. Should `run() support it?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Probably good to make a constant with those two values
CONFIG_ONLY_PARAMS
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
certainly not imho
callback_notify
it is just there to let the gunicorn know the worker is still alive iirc everytimeout_notify
those can be overridden if you are subclassing UvicornWorker, I wouldn't know how to do that with the CLI nor if it makes sense
why not yes, not opposed having them that way too
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Right. Thanks 🙏
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't see much benefit on the
CONFIG_ONLY_PARAMS
constant for a single test function. Is there?I'll merge this, but I don't mind creating a PR to add that. 🙏