Skip to contents

Walks up the directory tree from path until a directory satisfying criterion is found. Thin wrapper around find_root using pyprojroot criteria.

Usage

find_python_root(criterion, path = ".")

Arguments

criterion

A root_criterion object, typically one of the is_* criteria exported by this package (e.g. is_uv_project, is_python_project).

path

Character scalar. Starting directory for the upward search. Defaults to ".".

Value

Character scalar. Absolute path to the project root directory.

Examples

if (FALSE) { # \dontrun{
find_python_root(is_uv_project)
find_python_root(is_python_project, path = "/path/to/subdir")
} # }