fix: change filepath options type to pathlib.Path (#1506)
This commit is contained in:
parent
db8dd87d61
commit
d986302de2
|
@ -1,3 +1,4 @@
|
||||||
|
from pathlib import Path
|
||||||
from typing import Callable
|
from typing import Callable
|
||||||
|
|
||||||
import click
|
import click
|
||||||
|
@ -27,7 +28,7 @@ def cli_logging_options(func: Callable) -> Callable:
|
||||||
"--log-filepath",
|
"--log-filepath",
|
||||||
"log_filepath",
|
"log_filepath",
|
||||||
envvar=f"{DEFAULT_ENV_PREFIX}_LOG_FILEPATH",
|
envvar=f"{DEFAULT_ENV_PREFIX}_LOG_FILEPATH",
|
||||||
type=click.Path(),
|
type=click.Path(path_type=Path),
|
||||||
help="Path to the logging file.",
|
help="Path to the logging file.",
|
||||||
default=None,
|
default=None,
|
||||||
)(func)
|
)(func)
|
||||||
|
@ -40,7 +41,7 @@ def cli_config_options(func: Callable) -> Callable:
|
||||||
Decorator function to add config file options to a click application.
|
Decorator function to add config file options to a click application.
|
||||||
|
|
||||||
This decorator add the following arguments:
|
This decorator add the following arguments:
|
||||||
- config_filepath: Path
|
- config_filepath: Optional[Path]
|
||||||
"""
|
"""
|
||||||
|
|
||||||
func = click.option(
|
func = click.option(
|
||||||
|
@ -48,7 +49,7 @@ def cli_config_options(func: Callable) -> Callable:
|
||||||
"--config",
|
"--config",
|
||||||
"config_filepath",
|
"config_filepath",
|
||||||
envvar=f"{DEFAULT_ENV_PREFIX}_CONFIG_FILEPATH",
|
envvar=f"{DEFAULT_ENV_PREFIX}_CONFIG_FILEPATH",
|
||||||
type=click.Path(),
|
type=click.Path(path_type=Path),
|
||||||
help="Path to the config file.",
|
help="Path to the config file.",
|
||||||
default=None,
|
default=None,
|
||||||
)(func)
|
)(func)
|
||||||
|
|
Loading…
Reference in New Issue