@@ -68,7 +68,7 @@ def construct_config_settings(*, name, default_version, versions, minor_mapping,
6868 visibility = ["//visibility:public" ],
6969 )
7070
71- _reverse_minor_mapping = {full : minor for minor , full in minor_mapping .items ()}
71+ _reverse_minor_mapping = {full : minor for minor , full in minor_mapping .items () if full }
7272 for version in versions :
7373 minor_version = _reverse_minor_mapping .get (version )
7474 if not minor_version :
@@ -109,12 +109,19 @@ def construct_config_settings(*, name, default_version, versions, minor_mapping,
109109 # It's private because matching the concept of e.g. "3.8" value is done
110110 # using the `is_python_X.Y` config setting group, which is aware of the
111111 # minor versions that could match instead.
112- for minor in minor_mapping .keys ():
113- native .config_setting (
114- name = "is_python_{}" .format (minor ),
115- flag_values = {_PYTHON_VERSION_MAJOR_MINOR_FLAG : minor },
116- visibility = ["//visibility:public" ],
117- )
112+ for minor , version in minor_mapping .items ():
113+ if version :
114+ native .config_setting (
115+ name = "is_python_{}" .format (minor ),
116+ flag_values = {_PYTHON_VERSION_MAJOR_MINOR_FLAG : minor },
117+ visibility = ["//visibility:public" ],
118+ )
119+ else :
120+ native .alias (
121+ name = "is_python_{}" .format (minor ),
122+ actual = "@platforms//:incompatible" ,
123+ visibility = ["//visibility:public" ],
124+ )
118125
119126 _current_config (
120127 name = "current_config" ,
0 commit comments