INNER CODE UNIT · Python

_normalized_absolute_path

koxudaxi/datamodel-code-generator · src/datamodel_code_generator/__init__.py:463

def _normalized_absolute_path(path: Path, *, resolve_aliases: bool = False) -> Path:
    """Return a normalized absolute path, resolving aliases only when needed."""
    expanded_path = path.expanduser()
    if resolve_aliases:
        return expanded_path.resolve(strict=False)
    return Path(os.path.abspath(expanded_path))  # noqa: PTH100


def _validate_generation_path_conflicts(  # noqa: PLR0912
    input_: _GenerationInput,
    output: Path | None,
    model_metadata: Path | None,
    lockfile: Path | None = None,
) -> None:
    if output is None and model_metadata is None and lockfile is None:
        return

    targets = [

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…