Skip to content

Commit 915d15c

Browse files
henryiiijoerick
andauthored
fix: warn on deprecated images being set (#2312)
* fix: warn on deprecated images being set Signed-off-by: Henry Schreiner <[email protected]> * fix: handle repeated warning messages Signed-off-by: Henry Schreiner <[email protected]> * Apply suggestions from code review Co-authored-by: Joe Rickerby <[email protected]> * fix: try making the warnings once per Options Signed-off-by: Henry Schreiner <[email protected]> --------- Signed-off-by: Henry Schreiner <[email protected]> Co-authored-by: Joe Rickerby <[email protected]>
1 parent 25f2d3f commit 915d15c

File tree

1 file changed

+19
-0
lines changed

1 file changed

+19
-0
lines changed

cibuildwheel/options.py

+19
Original file line numberDiff line numberDiff line change
@@ -576,6 +576,7 @@ def __init__(
576576
self.command_line_arguments = command_line_arguments
577577
self.env = env
578578
self._defaults = defaults
579+
self._image_warnings = set[str]()
579580

580581
self.reader = OptionsReader(
581582
None if defaults else self.config_file_path,
@@ -777,6 +778,24 @@ def _compute_build_options(self, identifier: str | None) -> BuildOptions:
777778
# default to manylinux2014
778779
image = pinned_images["manylinux2014"]
779780
elif config_value in pinned_images:
781+
if (
782+
config_value
783+
in {
784+
"manylinux1",
785+
"manylinux2010",
786+
"manylinux_2_24",
787+
"musllinux_1_1",
788+
}
789+
and config_value not in self._image_warnings
790+
):
791+
self._image_warnings.add(config_value)
792+
msg = (
793+
f"Deprecated image {config_value!r}. This value will not work"
794+
" in a future version of cibuildwheel. Either upgrade to a supported"
795+
" image or continue using the deprecated image by pinning directly"
796+
f" to {pinned_images[config_value]!r}."
797+
)
798+
log.warning(msg)
780799
image = pinned_images[config_value]
781800
else:
782801
image = config_value

0 commit comments

Comments
 (0)