From a880bf5105e70f0add65d840db82a7cc6c1555e4 Mon Sep 17 00:00:00 2001 From: Henry Schreiner Date: Tue, 11 Mar 2025 16:44:06 -0400 Subject: [PATCH] fix: warn on deprecated images being set (#2312) * fix: warn on deprecated images being set Signed-off-by: Henry Schreiner * fix: handle repeated warning messages Signed-off-by: Henry Schreiner * Apply suggestions from code review Co-authored-by: Joe Rickerby * fix: try making the warnings once per Options Signed-off-by: Henry Schreiner --------- Signed-off-by: Henry Schreiner Co-authored-by: Joe Rickerby --- cibuildwheel/options.py | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/cibuildwheel/options.py b/cibuildwheel/options.py index 3fb9ebb7..9179f40b 100644 --- a/cibuildwheel/options.py +++ b/cibuildwheel/options.py @@ -567,6 +567,7 @@ class Options: self.command_line_arguments = command_line_arguments self.env = env self._defaults = defaults + self._image_warnings = set[str]() self.reader = OptionsReader( None if defaults else self.config_file_path, @@ -785,6 +786,24 @@ class Options: # default to manylinux2014 image = pinned_images["manylinux2014"] elif config_value in pinned_images: + if ( + config_value + in { + "manylinux1", + "manylinux2010", + "manylinux_2_24", + "musllinux_1_1", + } + and config_value not in self._image_warnings + ): + self._image_warnings.add(config_value) + msg = ( + f"Deprecated image {config_value!r}. This value will not work" + " in a future version of cibuildwheel. Either upgrade to a supported" + " image or continue using the deprecated image by pinning directly" + f" to {pinned_images[config_value]!r}." + ) + log.warning(msg) image = pinned_images[config_value] else: image = config_value