mirror of
https://github.com/pypiserver/pypiserver
synced 2024-11-09 16:45:51 +01:00
fix: explicit optional types in config.py
(#472)
* fix: make auther function optional in Config * fix: make args optional in from_args * chore: autoformatting
This commit is contained in:
parent
ae3dcf2bbd
commit
d716d0faf3
@ -689,7 +689,7 @@ class RunConfig(_ConfigCommon):
|
||||
log_req_frmt: str,
|
||||
log_res_frmt: str,
|
||||
log_err_frmt: str,
|
||||
auther: t.Callable[[str, str], bool] = None,
|
||||
auther: t.Optional[t.Callable[[str, str], bool]] = None,
|
||||
**kwargs: t.Any,
|
||||
) -> None:
|
||||
"""Construct a RuntimeConfig."""
|
||||
@ -828,7 +828,9 @@ class Config:
|
||||
return default_config.with_updates(**overrides)
|
||||
|
||||
@classmethod
|
||||
def from_args(cls, args: t.Sequence[str] = None) -> Configuration:
|
||||
def from_args(
|
||||
cls, args: t.Optional[t.Sequence[str]] = None
|
||||
) -> Configuration:
|
||||
"""Construct a Config from the passed args or sys.argv."""
|
||||
# If pulling args from sys.argv (commandline arguments), argv[0] will
|
||||
# be the program name, (i.e. pypi-server), so we don't need to
|
||||
|
Loading…
Reference in New Issue
Block a user