# Path: build_helpers/build_helpers.py
# def find(
#     root: Path,
#     include_files: List[str],
#     include_dirs: List[str],
#     excludes: List[str],
#     rbase: Optional[Path] = None,
#     scan_exclude: Optional[List[str]] = None,
# ) -> List[Path]:
#     if rbase is None:
#         rbase = Path()
#     if scan_exclude is None:
#         scan_exclude = []
#     files = []
#     scan_root = root / rbase
#     for entry in scan_root.iterdir():
#         path = rbase / entry.name
#         if matches(scan_exclude, path):
#             continue
# 
#         if entry.is_dir():
#             if matches(include_dirs, path):
#                 if not matches(excludes, path):
#                     files.append(path)
#             else:
#                 ret = find(
#                     root=root,
#                     include_files=include_files,
#                     include_dirs=include_dirs,
#                     excludes=excludes,
#                     rbase=path,
#                     scan_exclude=scan_exclude,
#                 )
#                 files.extend(ret)
#         else:
#             if matches(include_files, path) and not matches(excludes, path):
#                 files.append(path)
# 
#     return files
# 
# def find_version(*file_paths: str) -> str:
#     root = Path(__file__).parent.parent.absolute()
#     with codecs.open(root / Path(*file_paths), "r") as fp:  # type: ignore
#         version_file = fp.read()
#     version_match = re.search(r"^__version__ = ['\"]([^'\"]*)['\"]", version_file, re.M)
#     if version_match:
#         return version_match.group(1)
#     raise RuntimeError("Unable to find version string.")  # pragma: no cover
# 
# def matches(patterns: List[str], path: Path) -> bool:
#     string = str(path).replace(os.sep, "/")  # for Windows
#     for pattern in patterns:
#         if re.match(pattern, string):
#             return True
#     return False


from pathlib import Path
from typing import List
from build_helpers.build_helpers import find, find_version, matches
import pytest
                "a/b/file2.txt",
                "a/b/file1.txt",
                "c/bad_dir/.gitkeep",
                "c/file2.txt",
                "c/file1.txt",
            ],
            id="no_junk",
        ),
        pytest.param(
            "test_files",
            ["^.*/junk.txt"],
            [],
            [],
            [],
            ["a/b/junk.txt", "c/junk.txt"],
            id="junk_only",
        ),
        pytest.param("test_files", [], ["^a$"], [], [], ["a"], id="exact_a"),
        pytest.param(
            "test_files",
            [],
            [".*bad_dir$"],
            [],
            [],
            ["a/b/bad_dir", "c/bad_dir"],
            id="bad_dirs",
        ),
    ],
)
def test_find(

# Path: build_helpers/build_helpers.py
# def find(
#     root: Path,
#     include_files: List[str],
#     include_dirs: List[str],
#     excludes: List[str],
#     rbase: Optional[Path] = None,
#     scan_exclude: Optional[List[str]] = None,
# ) -> List[Path]:
#     if rbase is None:
#         rbase = Path()
#     if scan_exclude is None:
#         scan_exclude = []
#     files = []
#     scan_root = root / rbase
#     for entry in scan_root.iterdir():
#         path = rbase / entry.name
#         if matches(scan_exclude, path):
#             continue
# 
#         if entry.is_dir():
#             if matches(include_dirs, path):
#                 if not matches(excludes, path):
#                     files.append(path)
#             else:
#                 ret = find(
#                     root=root,
#                     include_files=include_files,
#                     include_dirs=include_dirs,
#                     excludes=excludes,
#                     rbase=path,
#                     scan_exclude=scan_exclude,
#                 )
#                 files.extend(ret)
#         else:
#             if matches(include_files, path) and not matches(excludes, path):
#                 files.append(path)
# 
#     return files
# 
# def find_version(*file_paths: str) -> str:
#     root = Path(__file__).parent.parent.absolute()
#     with codecs.open(root / Path(*file_paths), "r") as fp:  # type: ignore
#         version_file = fp.read()
#     version_match = re.search(r"^__version__ = ['\"]([^'\"]*)['\"]", version_file, re.M)
#     if version_match:
#         return version_match.group(1)
#     raise RuntimeError("Unable to find version string.")  # pragma: no cover
# 
# def matches(patterns: List[str], path: Path) -> bool:
#     string = str(path).replace(os.sep, "/")  # for Windows
#     for pattern in patterns:
#         if re.match(pattern, string):
#             return True
#     return False


# Path: build_helpers/test_helpers.py
from pathlib import Path
from typing import List
from build_helpers.build_helpers import find, find_version, matches
import pytest

                "a/b/file2.txt",
                "a/b/file1.txt",
                "c/bad_dir/.gitkeep",
                "c/file2.txt",
                "c/file1.txt",
            ],
            id="no_junk",
        ),
        pytest.param(
            "test_files",
            ["^.*/junk.txt"],
            [],
            [],
            [],
            ["a/b/junk.txt", "c/junk.txt"],
            id="junk_only",
        ),
        pytest.param("test_files", [], ["^a$"], [], [], ["a"], id="exact_a"),
        pytest.param(
            "test_files",
            [],
            [".*bad_dir$"],
            [],
            [],
            ["a/b/bad_dir", "c/bad_dir"],
            id="bad_dirs",
        ),
    ],
)
def test_find(

    path_rel: str,