fix: warn on deprecated images being set (#2312)
* fix: warn on deprecated images being set Signed-off-by: Henry Schreiner <henryschreineriii@gmail.com> * fix: handle repeated warning messages Signed-off-by: Henry Schreiner <henryschreineriii@gmail.com> * Apply suggestions from code review Co-authored-by: Joe Rickerby <joerick@mac.com> * fix: try making the warnings once per Options Signed-off-by: Henry Schreiner <henryschreineriii@gmail.com> --------- Signed-off-by: Henry Schreiner <henryschreineriii@gmail.com> Co-authored-by: Joe Rickerby <joerick@mac.com>
This commit is contained in:
co-authored by
Joe Rickerby
parent
25f2d3f313
commit
915d15cc32
@@ -576,6 +576,7 @@ class Options:
|
|||||||
self.command_line_arguments = command_line_arguments
|
self.command_line_arguments = command_line_arguments
|
||||||
self.env = env
|
self.env = env
|
||||||
self._defaults = defaults
|
self._defaults = defaults
|
||||||
|
self._image_warnings = set[str]()
|
||||||
|
|
||||||
self.reader = OptionsReader(
|
self.reader = OptionsReader(
|
||||||
None if defaults else self.config_file_path,
|
None if defaults else self.config_file_path,
|
||||||
@@ -777,6 +778,24 @@ class Options:
|
|||||||
# default to manylinux2014
|
# default to manylinux2014
|
||||||
image = pinned_images["manylinux2014"]
|
image = pinned_images["manylinux2014"]
|
||||||
elif config_value in pinned_images:
|
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]
|
image = pinned_images[config_value]
|
||||||
else:
|
else:
|
||||||
image = config_value
|
image = config_value
|
||||||
|
|||||||
Reference in New Issue
Block a user