import pathlib


def _parse_requirements(path: pathlib.Path):
    """Read and strip comments from a requirements.txt-like file. """
    lines = [line.strip() for line in path.read_text().splitlines() if line]
    return [line for line in lines if not line.startswith('#')]