Repository: pypa/cibuildwheel

Issue:
feat: use feature in-tree-build for pip
Closes #696



Discussion:
FYI @henryiii, I was curious if this was now available with our latest dep updates, so I merged `main`.
I think that it does work, but that dependency versions test pins pip to too old a version.
The latest pip (21.2) should also fix the issue with uri's not working, so we could update. Since this will be the new default, should we just force it in our next minor release or wait till we get pip 21.3?
@joerick, @mayeut, or @YannickJadoul should we do this, or just wait till 21.3?
I'm not sure we should do anything about it except maybe updating the docs.
Let's keep pip default behavior and allow users to change it by passing `PIP_USE_FEATURE` environment variable.
With this PR, we know all tests are passing with the option.

I agree, we don't need to rush this, let's just wait for pip 21.3. I think that `PIP_USE_DEPRECATED=out-of-tree-build` will be available as a temporary fallback for users hitting this change unexpectedly.
Let's try to get 21.3 into the next version. manylinux will get it either on Monday or hopefully might get manually triggered sooner (@mayeut?).
https://github.com/pypa/manylinux/pull/1207
@henryiii, I've triggered the workflows for manylinux as you've seen.
I won't be available until November 6th after that so I don't expect anything to happen there & I didn't had time to review other PRs here yet.

Resolving patch:
diff --git a/cibuildwheel/windows.py b/cibuildwheel/windows.py
--- a/cibuildwheel/windows.py
+++ b/cibuildwheel/windows.py
@@ -112,7 +112,6 @@ def install_pypy(version: str, arch: str, url: str) -> Path:
         download(url, pypy_zip)
         # Extract to the parent directory because the zip file still contains a directory
         extract_zip(pypy_zip, installation_path.parent)
-        (installation_path / "python.exe").symlink_to(installation_path / "pypy3.exe")
     return installation_path
 
 


Test patch:
diff --git a/test/utils.py b/test/utils.py
--- a/test/utils.py
+++ b/test/utils.py
@@ -130,7 +130,7 @@ def expected_wheels(
     python_abi_tags = ["cp36-cp36m", "cp37-cp37m", "cp38-cp38", "cp39-cp39", "cp310-cp310"]
 
     if machine_arch in ["x86_64", "AMD64", "x86", "aarch64"]:
-        python_abi_tags += ["pp37-pypy37_pp73"]
+        python_abi_tags += ["pp37-pypy37_pp73", "pp38-pypy38_pp73"]
 
     if platform == "macos" and machine_arch == "arm64":
         # currently, arm64 macs are only supported by cp39 & cp310
diff --git a/unit_test/build_selector_test.py b/unit_test/build_selector_test.py
--- a/unit_test/build_selector_test.py
+++ b/unit_test/build_selector_test.py
@@ -53,6 +53,9 @@ def test_skip():
 
     assert not build_selector("pp36-manylinux_x86_64")
     assert build_selector("pp37-manylinux_x86_64")
+    assert build_selector("pp38-manylinux_x86_64")
+    assert build_selector("pp37-manylinux_i686")
+    assert build_selector("pp38-manylinux_i686")
     assert build_selector("cp36-manylinux_x86_64")
     assert build_selector("cp37-manylinux_x86_64")
     assert not build_selector("cp36-manylinux_i686")
diff --git a/unit_test/option_prepare_test.py b/unit_test/option_prepare_test.py
--- a/unit_test/option_prepare_test.py
+++ b/unit_test/option_prepare_test.py
@@ -11,7 +11,7 @@
 from cibuildwheel import linux, util
 from cibuildwheel.__main__ import main
 
-ALL_IDS = {"cp36", "cp37", "cp38", "cp39", "cp310", "pp37"}
+ALL_IDS = {"cp36", "cp37", "cp38", "cp39", "cp310", "pp37", "pp38"}
 
 
 @pytest.fixture
@@ -132,7 +132,9 @@ def test_build_with_override_launches(mock_build_docker, monkeypatch, tmp_path):
     assert not kwargs["docker"]["simulate_32_bit"]
 
     identifiers = {x.identifier for x in kwargs["platform_configs"]}
-    assert identifiers == {f"{x}-manylinux_x86_64" for x in ALL_IDS - {"cp36", "cp310", "pp37"}}
+    assert identifiers == {
+        f"{x}-manylinux_x86_64" for x in ALL_IDS - {"cp36", "cp310", "pp37", "pp38"}
+    }
     assert kwargs["options"].build_options("cp37-manylinux_x86_64").before_all == ""
 
     kwargs = build_on_docker.call_args_list[2][1]
@@ -140,7 +142,11 @@ def test_build_with_override_launches(mock_build_docker, monkeypatch, tmp_path):
     assert kwargs["docker"]["cwd"] == Path("/project")
     assert not kwargs["docker"]["simulate_32_bit"]
     identifiers = {x.identifier for x in kwargs["platform_configs"]}
-    assert identifiers == {"cp310-manylinux_x86_64", "pp37-manylinux_x86_64"}
+    assert identifiers == {
+        "cp310-manylinux_x86_64",
+        "pp37-manylinux_x86_64",
+        "pp38-manylinux_x86_64",
+    }
 
     kwargs = build_on_docker.call_args_list[3][1]
     assert "quay.io/pypa/manylinux2010_i686" in kwargs["docker"]["docker_image"]