import pathlib


def click_convert_to_path(ctx, param, value):
    """
    Callback function for click.option to ensure all pathes are PosixPathes.
    """
    assert value is not None
    if isinstance(value, str):
        value = pathlib.Path(value)

    return value