Skip to content

Commit 6d9ce82

Browse files
committed
chore: drop deprecated options
1 parent e1112fe commit 6d9ce82

File tree

10 files changed

+27
-103
lines changed

10 files changed

+27
-103
lines changed

.github/workflows/test.yml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -81,8 +81,7 @@ jobs:
8181
env:
8282
CIBW_ARCHS_MACOS: x86_64 universal2 arm64
8383
CIBW_BUILD_FRONTEND: 'build[uv]'
84-
CIBW_FREE_THREADED_SUPPORT: 1
85-
CIBW_PRERELEASE_PYTHONS: 1
84+
CIBW_ENABLE: "cpython-prerelease cpython-freethreading pypy"
8685

8786
- name: Run a sample build (GitHub Action, only)
8887
uses: ./

bin/generate_schema.py

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -119,11 +119,6 @@
119119
description: Set environment variables on the host to pass-through to the container
120120
during the build.
121121
type: string_array
122-
free-threaded-support:
123-
type: boolean
124-
default: false
125-
description: The project supports free-threaded builds of Python (PEP703)
126-
deprecated: Use the `enable` option instead.
127122
manylinux-aarch64-image:
128123
type: string
129124
description: Specify alternative manylinux / musllinux container images
@@ -277,7 +272,6 @@
277272
del non_global_options["build"]
278273
del non_global_options["skip"]
279274
del non_global_options["test-skip"]
280-
del non_global_options["free-threaded-support"]
281275
del non_global_options["enable"]
282276

283277
overrides["items"]["properties"]["select"]["oneOf"] = string_array

cibuildwheel/__main__.py

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -156,12 +156,6 @@ def main_inner(global_options: GlobalOptions) -> None:
156156
help="Do not report an error code if the build does not match any wheels.",
157157
)
158158

159-
parser.add_argument(
160-
"--prerelease-pythons",
161-
action="store_true",
162-
help="Enable pre-release Python versions if available.",
163-
)
164-
165159
parser.add_argument(
166160
"--debug-traceback",
167161
action="store_true",

cibuildwheel/options.py

Lines changed: 1 addition & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,6 @@
3232
EnableGroups,
3333
TestSelector,
3434
format_safe,
35-
read_python_configs,
3635
resources_dir,
3736
selector_matches,
3837
strtobool,
@@ -50,7 +49,6 @@ class CommandLineArguments:
5049
package_dir: Path
5150
print_build_identifiers: bool
5251
allow_empty: bool
53-
prerelease_pythons: bool
5452
debug_traceback: bool
5553

5654
@staticmethod
@@ -63,7 +61,6 @@ def defaults() -> CommandLineArguments:
6361
config_file="",
6462
output_dir=Path("wheelhouse"),
6563
package_dir=Path("."),
66-
prerelease_pythons=False,
6764
print_build_identifiers=False,
6865
debug_traceback=False,
6966
)
@@ -618,27 +615,6 @@ def globals(self) -> GlobalOptions:
618615
)
619616
enable = {EnableGroups(group) for group in enable_groups.split()}
620617

621-
free_threaded_support = strtobool(
622-
self.reader.get("free-threaded-support", env_plat=False, ignore_empty=True)
623-
)
624-
625-
prerelease_pythons = args.prerelease_pythons or strtobool(
626-
self.env.get("CIBW_PRERELEASE_PYTHONS", "0")
627-
)
628-
629-
if free_threaded_support or prerelease_pythons:
630-
msg = (
631-
"free-threaded-support and prerelease-pythons should be specified by enable instead"
632-
)
633-
if enable:
634-
raise OptionsReaderError(msg)
635-
log.warning(msg)
636-
637-
if free_threaded_support:
638-
enable.add(EnableGroups.CPythonFreeThreading)
639-
if prerelease_pythons:
640-
enable.add(EnableGroups.CPythonPrerelease)
641-
642618
# This is not supported in tool.cibuildwheel, as it comes from a standard location.
643619
# Passing this in as an environment variable will override pyproject.toml, setup.cfg, or setup.py
644620
requires_python_str: str | None = (
@@ -660,24 +636,10 @@ def globals(self) -> GlobalOptions:
660636
build_config=build_config,
661637
skip_config=skip_config,
662638
requires_python=requires_python,
663-
enable=frozenset(
664-
enable | {EnableGroups.PyPy}
665-
), # For backwards compatibility, we are adding PyPy for now
639+
enable=frozenset(enable),
666640
)
667641
test_selector = TestSelector(skip_config=test_skip)
668642

669-
all_configs = read_python_configs(self.platform)
670-
all_pypy_ids = {
671-
config["identifier"] for config in all_configs if config["identifier"].startswith("pp")
672-
}
673-
if (
674-
not self._defaults
675-
and EnableGroups.PyPy not in enable
676-
and any(build_selector(build_id) for build_id in all_pypy_ids)
677-
):
678-
msg = "PyPy builds will be disabled by default in version 3. Enabling PyPy builds should be specified by enable"
679-
log.warning(msg)
680-
681643
return GlobalOptions(
682644
package_dir=package_dir,
683645
output_dir=output_dir,

cibuildwheel/resources/cibuildwheel.schema.json

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -284,13 +284,6 @@
284284
],
285285
"title": "CIBW_ENVIRONMENT_PASS"
286286
},
287-
"free-threaded-support": {
288-
"type": "boolean",
289-
"default": false,
290-
"description": "The project supports free-threaded builds of Python (PEP703)",
291-
"deprecated": "Use the `enable` option instead.",
292-
"title": "CIBW_FREE_THREADED_SUPPORT"
293-
},
294287
"manylinux-aarch64-image": {
295288
"type": "string",
296289
"description": "Specify alternative manylinux / musllinux container images",

cibuildwheel/resources/defaults.toml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22
build = "*"
33
skip = ""
44
test-skip = ""
5-
free-threaded-support = false
65
enable = []
76

87
archs = ["auto"]

docs/options.md

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -567,17 +567,14 @@ values are:
567567

568568

569569
- `cpython-prerelease`: Enables beta versions of Pythons if any are available
570-
(May-July, approximately). For backward compatibility, `CIBW_PRERELEASE_PYTHONS`
571-
is also supported until cibuildwheel 3.
570+
(May-July, approximately).
572571
- `cpython-freethreading`: [PEP 703](https://www.python.org/dev/peps/pep-0703)
573572
introduced variants of CPython that can be built without the Global
574573
Interpreter Lock (GIL). Those variants are also known as free-threaded /
575574
no-gil. This will enable building these wheels while they are experimental.
576575
The build identifiers for those variants have a `t` suffix in their
577-
`python_tag` (e.g. `cp313t-manylinux_x86_64`). For backward compatibility,
578-
`CIBW_FREE_THREADED_SUPPORT` is also supported until cibuildwheel 3.
579-
- `pypy`: Enable PyPy. For backward compatibility, this is always enabled until
580-
cibuildwheel 3 is released.
576+
`python_tag` (e.g. `cp313t-manylinux_x86_64`).
577+
- `pypy`: Enable PyPy.
581578

582579

583580
!!! caution
@@ -591,7 +588,7 @@ values are:
591588
!!! note
592589
Free threading is experimental: [What’s New In Python 3.13](https://docs.python.org/3.13/whatsnew/3.13.html#free-threaded-cpython)
593590

594-
Default: empty (`pypy` is always injected).
591+
Default: empty.
595592

596593
This option doesn't support overrides or platform specific variants; it is
597594
intended as a way to acknowledge that a project is aware that these extra

test/utils.py

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -47,11 +47,11 @@ def cibuildwheel_get_build_identifiers(
4747
for the current platform.
4848
"""
4949
cmd = [sys.executable, "-m", "cibuildwheel", "--print-build-identifiers", str(project_path)]
50-
if prerelease_pythons:
51-
cmd.append("--prerelease-pythons")
5250
if env is None:
5351
env = os.environ.copy()
54-
env.setdefault("CIBW_FREE_THREADED_SUPPORT", "1")
52+
env["CIBW_ENABLE"] = "cpython-freethreading pypy"
53+
if prerelease_pythons:
54+
env["CIBW_ENABLE"] += " cpython-prerelease"
5555

5656
cmd_output = subprocess.run(
5757
cmd,
@@ -115,7 +115,7 @@ def cibuildwheel_run(
115115

116116
_update_pip_cache_dir(env)
117117

118-
env.setdefault("CIBW_FREE_THREADED_SUPPORT", "1")
118+
env["CIBW_ENABLE"] = "cpython-prerelease cpython-freethreading pypy"
119119

120120
if single_python:
121121
env["CIBW_BUILD"] = "cp{}{}-*".format(*SINGLE_PYTHON_VERSION)
@@ -126,7 +126,6 @@ def cibuildwheel_run(
126126
sys.executable,
127127
"-m",
128128
"cibuildwheel",
129-
"--prerelease-pythons",
130129
"--output-dir",
131130
str(output_dir or tmp_output_dir),
132131
str(package_dir),

unit_test/option_prepare_test.py

Lines changed: 9 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -14,20 +14,8 @@
1414
from cibuildwheel.__main__ import main
1515
from cibuildwheel.oci_container import OCIPlatform
1616

17-
ALL_IDS = {
18-
"cp36",
19-
"cp37",
20-
"cp38",
21-
"cp39",
22-
"cp310",
23-
"cp311",
24-
"cp312",
25-
"cp313",
26-
"pp37",
27-
"pp38",
28-
"pp39",
29-
"pp310",
30-
}
17+
DEFAULT_IDS = {"cp36", "cp37", "cp38", "cp39", "cp310", "cp311", "cp312", "cp313"}
18+
ALL_IDS = DEFAULT_IDS | {"cp313t", "pp37", "pp38", "pp39", "pp310"}
3119

3220

3321
@pytest.fixture
@@ -77,33 +65,31 @@ def test_build_default_launches(monkeypatch):
7765
assert kwargs["container"]["oci_platform"] == OCIPlatform.AMD64
7866

7967
identifiers = {x.identifier for x in kwargs["platform_configs"]}
80-
assert identifiers == {f"{x}-manylinux_x86_64" for x in ALL_IDS}
68+
assert identifiers == {f"{x}-manylinux_x86_64" for x in DEFAULT_IDS}
8169

8270
kwargs = build_in_container.call_args_list[1][1]
8371
assert "quay.io/pypa/manylinux2014_i686" in kwargs["container"]["image"]
8472
assert kwargs["container"]["cwd"] == PurePosixPath("/project")
8573
assert kwargs["container"]["oci_platform"] == OCIPlatform.i386
8674

8775
identifiers = {x.identifier for x in kwargs["platform_configs"]}
88-
assert identifiers == {f"{x}-manylinux_i686" for x in ALL_IDS}
76+
assert identifiers == {f"{x}-manylinux_i686" for x in DEFAULT_IDS}
8977

9078
kwargs = build_in_container.call_args_list[2][1]
9179
assert "quay.io/pypa/musllinux_1_2_x86_64" in kwargs["container"]["image"]
9280
assert kwargs["container"]["cwd"] == PurePosixPath("/project")
9381
assert kwargs["container"]["oci_platform"] == OCIPlatform.AMD64
9482

9583
identifiers = {x.identifier for x in kwargs["platform_configs"]}
96-
assert identifiers == {
97-
f"{x}-musllinux_x86_64" for x in ALL_IDS for x in ALL_IDS if "pp" not in x
98-
}
84+
assert identifiers == {f"{x}-musllinux_x86_64" for x in DEFAULT_IDS}
9985

10086
kwargs = build_in_container.call_args_list[3][1]
10187
assert "quay.io/pypa/musllinux_1_2_i686" in kwargs["container"]["image"]
10288
assert kwargs["container"]["cwd"] == PurePosixPath("/project")
10389
assert kwargs["container"]["oci_platform"] == OCIPlatform.i386
10490

10591
identifiers = {x.identifier for x in kwargs["platform_configs"]}
106-
assert identifiers == {f"{x}-musllinux_i686" for x in ALL_IDS if "pp" not in x}
92+
assert identifiers == {f"{x}-musllinux_i686" for x in DEFAULT_IDS}
10793

10894

10995
@pytest.mark.usefixtures("mock_build_container")
@@ -117,6 +103,7 @@ def test_build_with_override_launches(monkeypatch, tmp_path):
117103
[tool.cibuildwheel]
118104
manylinux-x86_64-image = "manylinux_2_28"
119105
musllinux-x86_64-image = "musllinux_1_2"
106+
enable = ["pypy", "cpython-freethreading"]
120107
121108
# Before Python 3.10, use manylinux2014, musllinux_1_1
122109
[[tool.cibuildwheel.overrides]]
@@ -158,7 +145,7 @@ def test_build_with_override_launches(monkeypatch, tmp_path):
158145
assert identifiers == {
159146
f"{x}-manylinux_x86_64"
160147
for x in ALL_IDS
161-
- {"cp36", "cp310", "cp311", "cp312", "cp313", "pp37", "pp38", "pp39", "pp310"}
148+
- {"cp36", "cp310", "cp311", "cp312", "cp313", "cp313t", "pp37", "pp38", "pp39", "pp310"}
162149
}
163150
assert kwargs["options"].build_options("cp37-manylinux_x86_64").before_all == ""
164151

@@ -169,7 +156,7 @@ def test_build_with_override_launches(monkeypatch, tmp_path):
169156
identifiers = {x.identifier for x in kwargs["platform_configs"]}
170157
assert identifiers == {
171158
f"{x}-manylinux_x86_64"
172-
for x in ["cp310", "cp311", "cp312", "cp313", "pp37", "pp38", "pp39", "pp310"]
159+
for x in ["cp310", "cp311", "cp312", "cp313", "cp313t", "pp37", "pp38", "pp39", "pp310"]
173160
}
174161

175162
kwargs = build_in_container.call_args_list[3][1]

unit_test/options_test.py

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -429,14 +429,14 @@ def test_override_inherit_environment_with_references(tmp_path: Path) -> None:
429429
("toml_assignment", "env", "expected_result"),
430430
[
431431
("", {}, False),
432-
("free-threaded-support = true", {}, True),
433-
("free-threaded-support = false", {}, False),
434-
("", {"CIBW_FREE_THREADED_SUPPORT": "0"}, False),
435-
("", {"CIBW_FREE_THREADED_SUPPORT": "1"}, True),
436-
("free-threaded-support = false", {"CIBW_FREE_THREADED_SUPPORT": "1"}, True),
437-
("free-threaded-support = true", {"CIBW_FREE_THREADED_SUPPORT": "0"}, False),
438-
("free-threaded-support = true", {"CIBW_FREE_THREADED_SUPPORT": ""}, True),
439-
("free-threaded-support = false", {"CIBW_FREE_THREADED_SUPPORT": ""}, False),
432+
("enable = ['cpython-freethreading']", {}, True),
433+
("enable = []", {}, False),
434+
("", {"CIBW_ENABLE": "pypy"}, False),
435+
("", {"CIBW_ENABLE": "cpython-freethreading"}, True),
436+
("enable = []", {"CIBW_ENABLE": "cpython-freethreading"}, True),
437+
("enable = ['cpython-freethreading']", {"CIBW_ENABLE": "pypy"}, True),
438+
("enable = ['cpython-freethreading']", {"CIBW_ENABLE": ""}, True),
439+
("enable = []", {"CIBW_ENABLE": ""}, False),
440440
],
441441
)
442442
def test_free_threaded_support(

0 commit comments

Comments
 (0)