@@ -567,7 +567,7 @@ def __init__(
567
567
self .command_line_arguments = command_line_arguments
568
568
self .env = env
569
569
self ._defaults = defaults
570
- self ._image_warnings = set [str ]()
570
+ self ._image_warnings : set [str ] = set ()
571
571
572
572
self .reader = OptionsReader (
573
573
None if defaults else self .config_file_path ,
@@ -689,6 +689,20 @@ def globals(self) -> GlobalOptions:
689
689
allow_empty = allow_empty ,
690
690
)
691
691
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
+
692
706
def build_options (self , identifier : str | None ) -> BuildOptions :
693
707
"""
694
708
Compute BuildOptions for a single run configuration.
@@ -786,24 +800,7 @@ def build_options(self, identifier: str | None) -> BuildOptions:
786
800
# default to manylinux2014
787
801
image = pinned_images ["manylinux2014" ]
788
802
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 )
807
804
image = pinned_images [config_value ]
808
805
else :
809
806
image = config_value
@@ -818,6 +815,7 @@ def build_options(self, identifier: str | None) -> BuildOptions:
818
815
if not config_value :
819
816
image = pinned_images ["musllinux_1_2" ]
820
817
elif config_value in pinned_images :
818
+ self ._check_pinned_image (config_value , pinned_images )
821
819
image = pinned_images [config_value ]
822
820
else :
823
821
image = config_value
0 commit comments