from pathlib import Path


def _pyproject_directory(tmp_path: Path) -> Path:
    """ Fixture which creates the following directory structure in a temporary directory:

    temp
      | - child
            | - pyproject.toml
            | - grandchild
                  | - great-grandchild

    Returns:
        The lowest directory within the created directory structure.
    """
    lowest_directory = tmp_path / "child" / "grandchild" / "great-grandchild"
    lowest_directory.mkdir(parents=True)
    (tmp_path / "child" / "pyproject.toml").touch()
    return lowest_directory