mathlibtools/lib.py
def find_root(path: Path) -> Path:
    """
    Find a Lean project root in path by searching for leanpkg.toml in path and
    its ancestors.
    """
    if (path/'leanpkg.toml').exists():
        return path
    parent = path.absolute().parent
    if parent != path:
        return find_root(parent)
    else:
        raise InvalidLeanProject('Could not find a leanpkg.toml')

    Find a Lean project root in path by searching for leanpkg.toml in path and
    its ancestors.
    
Find a Lean project root in path by searching for leanpkg.toml in path and
its ancestors.
Find a Lean project root in path by searching for leanpkg . toml in path and its ancestors .
def find_root(path: Path) -> Path:
    if (path/'leanpkg.toml').exists():
        return path
    parent = path.absolute().parent
    if parent != path:
        return find_root(parent)
    else:
        raise InvalidLeanProject('Could not find a leanpkg.toml')
def find_root ( path : Path ) -> Path : if ( path / 'leanpkg.toml' ) . exists ( ) : return path parent = path . absolute ( ) . parent if parent != path : return find_root ( parent ) else : raise InvalidLeanProject ( 'Could not find a leanpkg.toml' )
Find a Lean project root in path by searching for leanpkg.toml in path and
its ancestors.
Find a Lean project root in path by searching for leanpkg . toml in path and its ancestors .
"""
    Find a Lean project root in path by searching for leanpkg.toml in path and
    its ancestors.
    """
path
Path