Repository: pypa/pip
File: tests/functional/test_pep660.py (Python)

Code before:
    result = script.pip(
        "install",
        "--no-index",
        "--no-build-isolation",
        "--editable",
        project_dir,
        "--config-settings",
        "x=y",
    )
    _assert_hook_called(project_dir, "prepare_metadata_for_build_editable")
    _assert_hook_called_with_config_settings(project_dir, "build_editable", {"x": "y"})
    assert (
        result.test_env.site_packages.joinpath("project.egg-link")
        not in result.files_created
    ), "a .egg-link file should not have been created"


def test_install_pep660_from_req_file(tmpdir: Path, script: PipTestEnvironment) -> None:
    """
    Test with backend that supports build_editable.
    """
    project_dir = _make_project(tmpdir, BACKEND_WITH_PEP660, with_setup_py=False)
    reqs_file = tmpdir / "requirements.txt"
    reqs_file.write_text(f"-e {project_dir.as_uri()} --config-setting x=y\n")
    result = script.pip(
        "install",
        "--no-index",
        "--no-build-isolation",
        "-r",
        reqs_file,
    )
    _assert_hook_called(project_dir, "prepare_metadata_for_build_editable")
    _assert_hook_called_with_config_settings(project_dir, "build_editable", {"x": "y"})
    assert (
        result.test_env.site_packages.joinpath("project.egg-link")
        not in result.files_created
    ), "a .egg-link file should not have been created"


def test_install_no_pep660_setup_py_fallback(
    tmpdir: Path, script: PipTestEnvironment
) -> None:
    """
    Test that we fall back to setuptools develop when using a backend that
    does not support build_editable. Since there is a pyproject.toml,
    the prepare_metadata_for_build_wheel hook is called.
    """
    project_dir = _make_project(tmpdir, BACKEND_WITHOUT_PEP660, with_setup_py=True)
    result = script.pip(
        "install",
        "--no-index",

Review comment (suggestion):
You can set `--config-setting{,s}`? That was new to me. Probably set the latter for consistency?

```suggestion
    reqs_file.write_text(f"-e {project_dir.as_uri()} --config-settings x=y\n")
```

Code after:
    result = script.pip(
        "install",
        "--no-index",
        "--no-build-isolation",
        "--editable",
        project_dir,
        "--config-setting",
        "x=y",
    )
    _assert_hook_called(project_dir, "prepare_metadata_for_build_editable")
    _assert_hook_called_with_config_settings(project_dir, "build_editable", {"x": "y"})
    assert (
        result.test_env.site_packages.joinpath("project.egg-link")
        not in result.files_created
    ), "a .egg-link file should not have been created"


def test_install_pep660_from_reqs_file(
    tmpdir: Path, script: PipTestEnvironment
) -> None:
    """
    Test with backend that supports build_editable.
    """
    project_dir = _make_project(tmpdir, BACKEND_WITH_PEP660, with_setup_py=False)
    reqs_file = tmpdir / "requirements.txt"
    reqs_file.write_text(f"-e {project_dir.as_uri()} --config-setting x=y\n")
    result = script.pip(
        "install",
        "--no-index",
        "--no-build-isolation",
        "-r",
        reqs_file,
    )
    _assert_hook_called(project_dir, "prepare_metadata_for_build_editable")
    _assert_hook_called_with_config_settings(project_dir, "build_editable", {"x": "y"})
    assert (
        result.test_env.site_packages.joinpath("project.egg-link")
        not in result.files_created
    ), "a .egg-link file should not have been created"


def test_install_no_pep660_setup_py_fallback(
    tmpdir: Path, script: PipTestEnvironment
) -> None:
    """
    Test that we fall back to setuptools develop when using a backend that
    does not support build_editable. Since there is a pyproject.toml,
    the prepare_metadata_for_build_wheel hook is called.
    """
    project_dir = _make_project(tmpdir, BACKEND_WITHOUT_PEP660, with_setup_py=True)
    result = script.pip(