Skip to content

Commit a880bf5

Browse files
henryiiijoerick
andcommitted
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 c087d85 commit a880bf5

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
@@ -567,6 +567,7 @@ def __init__(
567567
self.command_line_arguments = command_line_arguments
568568
self.env = env
569569
self._defaults = defaults
570+
self._image_warnings = set[str]()
570571

571572
self.reader = OptionsReader(
572573
None if defaults else self.config_file_path,
@@ -785,6 +786,24 @@ def build_options(self, identifier: str | None) -> BuildOptions:
785786
# default to manylinux2014
786787
image = pinned_images["manylinux2014"]
787788
elif config_value in pinned_images:
789+
if (
790+
config_value
791+
in {
792+
"manylinux1",
793+
"manylinux2010",
794+
"manylinux_2_24",
795+
"musllinux_1_1",
796+
}
797+
and config_value not in self._image_warnings
798+
):
799+
self._image_warnings.add(config_value)
800+
msg = (
801+
f"Deprecated image {config_value!r}. This value will not work"
802+
" in a future version of cibuildwheel. Either upgrade to a supported"
803+
" image or continue using the deprecated image by pinning directly"
804+
f" to {pinned_images[config_value]!r}."
805+
)
806+
log.warning(msg)
788807
image = pinned_images[config_value]
789808
else:
790809
image = config_value

0 commit comments

Comments
 (0)