yera.locations

Shared filesystem location primitives for config, credentials, and CLI.

Symbols

def discover_pyproject — Find the nearest pyproject.toml walking up from CWD, stopping at .git.
def resolve_project_root — Return the directory containing the nearest pyproject.toml.
def yera_home_dir — Return the Yera user data directory.

discover_pyproject

discover_pyproject(
    require_tool_yera: bool = False,
) → Path | None

Find the nearest pyproject.toml walking up from CWD, stopping at .git.

If require_tool_yera=True, only return files that contain [tool.yera]. Returns None when no qualifying file is found.

resolve_project_root

resolve_project_root() → Path | None

Return the directory containing the nearest pyproject.toml.

Uses require_tool_yera=False — accepts any pyproject.toml. Used by credential authorisation to establish the authoritative project root, independently of whether the project has configured Yera yet.

yera_home_dir

yera_home_dir() → Path

Return the Yera user data directory.

Default: ~/.yera/ Override: YERA_HOME environment variable.