Skip to contents

Locates the project root using criterion and appends the given path components to it. Equivalent to calling find_python_root and then file.path on the result.

Usage

python_root_file(..., criterion, path = ".")

Arguments

...

Character vectors of path components to append to the root.

criterion

A root_criterion object. See find_python_root.

path

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

Value

Character scalar. Absolute path to the specified file or directory within the project root.

See also

Examples

if (FALSE) { # \dontrun{
python_root_file("src", "mypackage", "__init__.py", criterion = is_uv_project)
python_root_file("requirements.txt", criterion = is_pip_project)
} # }