@@ -567,7 +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 ]()
570+ self ._image_warnings : set [str ] = set ()
571571
572572 self .reader = OptionsReader (
573573 None if defaults else self .config_file_path ,
@@ -689,6 +689,20 @@ def globals(self) -> GlobalOptions:
689689 allow_empty = allow_empty ,
690690 )
691691
692+ def _check_pinned_image (self , value : str , pinned_images : Mapping [str , str ]) -> None :
693+ if (
694+ value in {"manylinux1" , "manylinux2010" , "manylinux_2_24" , "musllinux_1_1" }
695+ and value not in self ._image_warnings
696+ ):
697+ self ._image_warnings .add (value )
698+ msg = (
699+ f"Deprecated image { value !r} . This value will not work"
700+ " in a future version of cibuildwheel. Either upgrade to a supported"
701+ " image or continue using the deprecated image by pinning directly"
702+ f" to { pinned_images [value ]!r} ."
703+ )
704+ log .warning (msg )
705+
692706 def build_options (self , identifier : str | None ) -> BuildOptions :
693707 """
694708 Compute BuildOptions for a single run configuration.
@@ -786,24 +800,7 @@ def build_options(self, identifier: str | None) -> BuildOptions:
786800 # default to manylinux2014
787801 image = pinned_images ["manylinux2014" ]
788802 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 )
803+ self ._check_pinned_image (config_value , pinned_images )
807804 image = pinned_images [config_value ]
808805 else :
809806 image = config_value
@@ -818,6 +815,7 @@ def build_options(self, identifier: str | None) -> BuildOptions:
818815 if not config_value :
819816 image = pinned_images ["musllinux_1_2" ]
820817 elif config_value in pinned_images :
818+ self ._check_pinned_image (config_value , pinned_images )
821819 image = pinned_images [config_value ]
822820 else :
823821 image = config_value
0 commit comments