@@ -14,8 +14,14 @@ def parse_version(v):
1414
1515def get_github_python_versions ():
1616 versions_json = requests .get (_VERSIONS_URL ).json ()
17- raw_versions = [v ["version" ] for v in versions_json ]
1817
18+ # windows platform support isn't great for older versions of python
19+ # get a map of version: platform/arch so we can exclude here
20+ platforms = {}
21+ for v in versions_json :
22+ platforms [v ["version" ]] = set ((f ["platform" ], f ["arch" ]) for f in v ["files" ])
23+
24+ raw_versions = [v ["version" ] for v in versions_json ]
1925 minor_versions = defaultdict (list )
2026
2127 for version_str in raw_versions :
@@ -46,11 +52,13 @@ def get_github_python_versions():
4652
4753 versions .extend (f"{ major } .{ minor } .{ patch } " for patch in patches )
4854
49- return versions
55+ return versions , platforms
5056
5157
5258def update_python_test_versions ():
53- versions = sorted (get_github_python_versions (), key = parse_version )
59+ versions , platforms = get_github_python_versions ()
60+ versions = sorted (versions , key = parse_version )
61+
5462 build_yml_path = (
5563 pathlib .Path (__file__ ).parent .parent / ".github" / "workflows" / "build.yml"
5664 )
@@ -82,9 +90,15 @@ def update_python_test_versions():
8290 # since it currently fails in GHA on SIP errors
8391 exclusions = []
8492 for v in versions :
85- if v .startswith ("3.11.10" ) or v .startswith ("3.12" ):
93+ # if we don't have a python version for osx/windows skip
94+ if ("darwin" , "x64" ) not in platforms [v ] or v .startswith ("3.12" ):
8695 exclusions .append (" - os: macos-13\n " )
8796 exclusions .append (f" python-version: { v } \n " )
97+
98+ if ("win32" , "x64" ) not in platforms [v ] or v .startswith ("3.12" ):
99+ exclusions .append (" - os: windows-latest\n " )
100+ exclusions .append (f" python-version: { v } \n " )
101+
88102 first_exclude_line = lines .index (" exclude:\n " , first_line )
89103 last_exclude_line = lines .index ("\n " , first_exclude_line )
90104 lines = lines [: first_exclude_line + 1 ] + exclusions + lines [last_exclude_line :]
0 commit comments