def METHOD_NAME(
    extras: List[str],
    filename: str,
    include_pymedphys: bool,
    editable: Optional[bool] = None,
):
    """Create a requirements.txt file with poetry pins.
    Parameters
    ----------
    extras : List[str]
        A list of pip extras to include within the requirements file.
    filename : str
        The filename of the requirements file. Will be created in the
        repo root.
    include_pymedphys : bool
        Whether or not the requirements file should include an
        installation of the git repo.
    editable : bool
        Whether or not the pymedphys install should be 'editable'.
    """
    if not include_pymedphys and editable is not None:
        raise ValueError("Setting editable only works if using `include_pymedphys`")
    if include_pymedphys and editable is None:
        raise ValueError("When using `include_pymedphys` need to also set `editable`")
    filepath = REPO_ROOT.joinpath(filename)
    poetry_environment_flags = " ".join([f"-E {item}" for item in extras])
    # TODO: Once the hashes pinning issue in poetry is fixed, remove the
    # --without-hashes. See <https://github.com/python-poetry/poetry/issues/1584>
    # for more details.
    subprocess.check_call(
        (
            "poetry export --without-hashes "
            + poetry_environment_flags
            + " -f requirements.txt --output "
            + filename
        ),
        shell=True,
        cwd=REPO_ROOT,
    )
    if include_pymedphys:
        pymedphys_install_command = f".[{','.join(extras)}]\n"
        if editable:
            pymedphys_install_command = f"-e {pymedphys_install_command}"
        with open(filepath, "a") as f:
            f.write(pymedphys_install_command)