doc: add missing docstring + add missing feature to README (#57)

This commit is contained in:
d3vyce
2026-02-12 18:09:39 +01:00
committed by GitHub
parent c8c263ca8f
commit 8825c772ce
13 changed files with 88 additions and 15 deletions

View File

@@ -18,10 +18,16 @@ def _ensure_project_in_path():
def import_from_string(import_path: str):
"""Import an object from a string path like 'module.submodule:attribute'.
"""Import an object from a dotted string path.
Args:
import_path: Import path in ``"module.submodule:attribute"`` format
Returns:
The imported attribute
Raises:
typer.BadParameter: If the import path is invalid or import fails.
typer.BadParameter: If the import path is invalid or import fails
"""
if ":" not in import_path:
raise typer.BadParameter(

View File

@@ -10,6 +10,12 @@ def find_pyproject(start_path: Path | None = None) -> Path | None:
"""Find pyproject.toml by walking up the directory tree.
Similar to how pytest, black, and ruff discover their config files.
Args:
start_path: Directory to start searching from. Defaults to cwd.
Returns:
Path to pyproject.toml, or None if not found.
"""
path = (start_path or Path.cwd()).resolve()