Repository: pypa/cibuildwheel

Issue:
Enable building on Python 3.11 without CIBW_PRERELEASE_PYTHONS
### Description

The docs at https://cibuildwheel.readthedocs.io/en/stable/options/#prerelease-pythons say:

> Once Python is ABI stable and enters the release candidate phase, that version of Python will become available without this flag.

Now that Python 3.11.0rc1 has been released, should Python 3.11 be included in regular wheel builds?

(My motivation for the issue: I'm planning to make a package release later this week, and I'd like to include wheels for Python 3.11; I'm wondering whether the best way forward is to set `CIBW_PRERELEASE_PYTHONS` or not.)

### Build log

_No response_

### CI config

_No response_


Discussion:
the manylinux image with 3.11.0rc0 was uploaded two hours ago and only for [manylinux2014_x86_64](https://quay.io/repository/pypa/manylinux2014_x86_64), so there is a need to wait until all docker images are updated before change from 3.11.0b5 to 3.11.0rc0 in cibuildwheel. 
@Czaki Thanks for the update! Sounds like this is all in progress, and this issue was redundant - apologies for the noise. Should I just close this?
As it is open then may be closed when the new version is released to increase discoverability (people more often check open issues than closed one). 
I believe the rc1 builds finished last night, so a manual run of https://github.com/pypa/cibuildwheel/actions/workflows/update-dependencies.yml should get the rc1 image.

Resolving patch:
diff --git a/cibuildwheel/util.py b/cibuildwheel/util.py
--- a/cibuildwheel/util.py
+++ b/cibuildwheel/util.py
@@ -242,7 +242,7 @@ class BuildSelector:
     requires_python: SpecifierSet | None = None
 
     # a pattern that skips prerelease versions, when include_prereleases is False.
-    PRERELEASE_SKIP: ClassVar[str] = "cp311-*"
+    PRERELEASE_SKIP: ClassVar[str] = ""
     prerelease_pythons: bool = False
 
     def __call__(self, build_id: str) -> bool:


Test patch:
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
@@ -11,7 +11,7 @@ def test_build():
     assert build_selector("cp36-manylinux_x86_64")
     assert build_selector("cp37-manylinux_x86_64")
     assert build_selector("cp310-manylinux_x86_64")
-    assert not build_selector("cp311-manylinux_x86_64")
+    assert build_selector("cp311-manylinux_x86_64")
     assert build_selector("pp36-manylinux_x86_64")
     assert build_selector("pp37-manylinux_x86_64")
     assert build_selector("cp36-manylinux_i686")
@@ -30,7 +30,7 @@ def test_build():
     assert build_selector("cp36-win_amd64")
     assert build_selector("cp37-win_amd64")
     assert build_selector("cp310-win_amd64")
-    assert not build_selector("cp311-win_amd64")
+    assert build_selector("cp311-win_amd64")
     assert not build_selector("pp36-win_amd64")
     assert not build_selector("pp37-win_amd64")
 
diff --git a/unit_test/linux_build_steps_test.py b/unit_test/linux_build_steps_test.py
--- a/unit_test/linux_build_steps_test.py
+++ b/unit_test/linux_build_steps_test.py
@@ -60,8 +60,12 @@ def before_alls(step):
     pprint(build_steps)
 
     assert build_steps[0].container_image == "normal_container_image"
-    assert identifiers(build_steps[0]) == ["cp36-manylinux_x86_64", "cp37-manylinux_x86_64"]
-    assert before_alls(build_steps[0]) == ["", ""]
+    assert identifiers(build_steps[0]) == [
+        "cp36-manylinux_x86_64",
+        "cp37-manylinux_x86_64",
+        "cp311-manylinux_x86_64",
+    ]
+    assert before_alls(build_steps[0]) == ["", "", ""]
 
     assert build_steps[1].container_image == "other_container_image"
     assert identifiers(build_steps[1]) == ["cp38-manylinux_x86_64", "cp310-manylinux_x86_64"]
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
@@ -13,7 +13,7 @@
 from cibuildwheel import linux, util
 from cibuildwheel.__main__ import main
 
-ALL_IDS = {"cp36", "cp37", "cp38", "cp39", "cp310", "pp37", "pp38", "pp39"}
+ALL_IDS = {"cp36", "cp37", "cp38", "cp39", "cp310", "cp311", "pp37", "pp38", "pp39"}
 
 
 @pytest.fixture
@@ -137,7 +137,8 @@ def test_build_with_override_launches(mock_build_container, monkeypatch, tmp_pat
 
     identifiers = {x.identifier for x in kwargs["platform_configs"]}
     assert identifiers == {
-        f"{x}-manylinux_x86_64" for x in ALL_IDS - {"cp36", "cp310", "pp37", "pp38", "pp39"}
+        f"{x}-manylinux_x86_64"
+        for x in ALL_IDS - {"cp36", "cp310", "cp311", "pp37", "pp38", "pp39"}
     }
     assert kwargs["options"].build_options("cp37-manylinux_x86_64").before_all == ""
 
@@ -147,10 +148,7 @@ def test_build_with_override_launches(mock_build_container, monkeypatch, tmp_pat
     assert not kwargs["container"]["simulate_32_bit"]
     identifiers = {x.identifier for x in kwargs["platform_configs"]}
     assert identifiers == {
-        "cp310-manylinux_x86_64",
-        "pp37-manylinux_x86_64",
-        "pp38-manylinux_x86_64",
-        "pp39-manylinux_x86_64",
+        f"{x}-manylinux_x86_64" for x in {"cp310", "cp311", "pp37", "pp38", "pp39"}
     }
 
     kwargs = build_in_container.call_args_list[3][1]